Forum: Ruby on Rails can i limit a has_many photos per user?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
treebeard (Guest)
on 2007-03-16 19:02
is there a rails way?

or should i just a do a before_save :check_limit, and just tally up the
amount of photos before saving? so maybe do something like

if user.photos.count == 4, max limit set. etc...

thanks
This topic is locked and can not be replied to.