Displaying 1 result from an estimated 1 matches for "member_subscriptions".
2012 Jun 18
0
Creating an object with a nested has_many :through relationship
...Group, and GroupMember.
class Member < ActiveRecord::Base
> has_many :group_subscriptions, class_name: "GroupMember"
> has_many :groups, through: :group_subscriptions
> attr_accessible :email, :password
> end
> class Group < ActiveRecord::Base
> has_many :member_subscriptions, class_name: "GroupMember"
> has_many :members, through: :member_subscriptions
> attr_accessible :name
> end
> class GroupMember < ActiveRecord::Base
> belongs_to :group
> belongs_to :member
> attr_accessible :group_id, :introduction
> end
If I want...