I would like to limit the number of model Objects a user can create. I\'ve tried the below but it is not working. I understand some changes have happened in rails 3.1 and
class User < ActiveRecord::Base
has_many :things
end
class Things :create
def thing_count_within_limit
if self.user.things(:reload).count >= 5
errors.add(:base, "Exceeded thing limit")
end
end
end