Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Account < ActiveRecord::Base
- has_many :manages
- has_many :users, :through => :manages
- end
- class User < ActiveRecord::Base
- has_many :manages
- has_many :accounts, :through => :manages
- end
- acc = usr.accounts.build
- acc.save
- usr.accounts
- acc.users
- class Manage < ActiveRecord::Base
- belongs_to :user
- belongs_to :account
- end
Add Comment
Please, Sign In to add comment