Skip to content

Instantly share code, notes, and snippets.

@azraai
Created May 13, 2013 08:36
Show Gist options
  • Save azraai/5566952 to your computer and use it in GitHub Desktop.
Save azraai/5566952 to your computer and use it in GitHub Desktop.
Is this association possbile?
class Item < ActiveRecord::Base
belongs_to :user
belongs_to :messenger, :class_name => 'User'
end
class User < ActiveRecord::Base
has_many :items, :foreign_key => [:user_id, :messenger_id]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment