diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-05-30 17:39:15 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-05-30 17:39:15 +0100 |
commit | ad4f931918ae9a8f3347db0b572dffb1280a5fe9 (patch) | |
tree | c843f3bbd8bce10b680f876749714ec949673464 /app/models/info_request.rb | |
parent | d9870d07db8fd364e1e39e0e8959342736d04ac9 (diff) | |
parent | 8308f4e115fcf51ec5d528e55af7e454963ce7aa (diff) |
Merge remote-tracking branch 'openaustralia_github/remove_random_request_action' into rails-3-develop
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index cf1af0e87..5d73fbca9 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1081,25 +1081,6 @@ public InfoRequest.update_all "allow_new_responses_from = 'nobody' where updated_at < (now() - interval '1 year') and allow_new_responses_from in ('anybody', 'authority_only') and url_title <> 'holding_pen'" end - # Returns a random FOI request - def InfoRequest.random - max_id = InfoRequest.connection.select_value('select max(id) as a from info_requests').to_i - info_request = nil - count = 0 - while info_request.nil? - if count > 100 - return nil - end - id = rand(max_id) + 1 - begin - count += 1 - info_request = find(id, :conditions => ["prominence = 'normal'"]) - rescue ActiveRecord::RecordNotFound - end - end - return info_request - end - def json_for_api(deep) ret = { :id => self.id, |