aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-03-22 10:03:20 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-03-22 10:03:20 +1100
commit8308f4e115fcf51ec5d528e55af7e454963ce7aa (patch)
tree1c347cc86140c3021e6fc3c2832a3a327d9ed052 /app/models/info_request.rb
parentd09758c79fff462906b48dda6601ced25a8865da (diff)
Remove apparently unused action for showing random request
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r--app/models/info_request.rb19
1 files changed, 0 insertions, 19 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 156399b99..666cc642f 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -1070,25 +1070,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,