diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-10-22 12:01:56 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-10-25 17:55:06 +0100 |
commit | 5cae053fa21bea192ae0db7c2e8d9d21f1e509ab (patch) | |
tree | fabde4eeb49db28558f1514fa5655e0fd9acf66c /app/models/user.rb | |
parent | 278720386d3d1cb474eae9c2bc9973be0d77878a (diff) |
Given that MAX_REQUESTS_PER_USER_PER_DAY is documented as an optional variable, but that commonlib/rblib/config.rb does not allow nil defaults, replace nil value clause (which can never be reached) with blank value condition(blank now returned by default by lib/configuation.rb)
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 4a68d60d1..70386f7e4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -286,7 +286,7 @@ class User < ActiveRecord::Base return false if self.no_limit # Has the user issued as many as MAX_REQUESTS_PER_USER_PER_DAY requests in the past 24 hours? - return false if Configuration::max_requests_per_user_per_day.nil? + return false if Configuration::max_requests_per_user_per_day.blank? recent_requests = InfoRequest.count(:conditions => ["user_id = ? and created_at > now() - '1 day'::interval", self.id]) return (recent_requests >= Configuration::max_requests_per_user_per_day) |