Method: FeatureBox::User#votes_left
- Defined in:
- app/models/feature_box/user.rb
#votes_left ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'app/models/feature_box/user.rb', line 27 def votes_left if Settings.total_limit == -1 then return 100 end condition = Settings.time_limit.ago used = Vote.where("user_id = ? AND created_at > ?", self.id, condition).size return Settings.total_limit - used end |