diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-10-29 13:07:55 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-10-29 13:07:55 +0000 |
commit | 3d8c7eb13cf6503cdd34c99fe2a745aaf999599f (patch) | |
tree | fdb5b1e49056f6f2888b87338b60e70d440e66b5 /app/models | |
parent | 46c160d3b7b121ccda404c56e2cc54f48b16703d (diff) | |
parent | 8bd85eb0b35211a653243ec740a9b3a9368e882f (diff) |
Merge branch 'feature/nils_in_config' into develop
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/info_request.rb | 2 | ||||
-rw-r--r-- | app/models/user.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 47424e573..89893a396 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1139,7 +1139,7 @@ public before_save :purge_in_cache def purge_in_cache - if !Configuration::varnish_host.nil? && !self.id.nil? + if !Configuration::varnish_host.blank? && !self.id.nil? # we only do this for existing info_requests (new ones have a nil id) path = url_for(:controller => 'request', :action => 'show', :url_title => self.url_title, :only_path => true, :locale => :none) req = PurgeRequest.find_by_url(path) 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) |