Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- belongs_to :account
- has_many :users
- @account.users << someuser
- @account.users.create
- class User
- belongs_to :account
- end
- class User
- validates_each :account do |user, attr, value|
- user.errors.add attr, "too much users for account" if user.account.users.size >= 3
- end
- end
Add Comment
Please, Sign In to add comment