I have a model with:
has_and_belongs_to_many :users
How do I validate that the model has at least one user in the model? I tried:
In Rails 3.2.x:
validate :has_users? def has_users? errors.add(:base, 'Error message') if self.users.blank? end