diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-09-20 13:38:04 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-09-20 13:38:04 +0100 |
commit | e32c63be6acd27534fb248e74e6394bf4fd8f28e (patch) | |
tree | baa2a51740fed2798d798836144458444d4fc82e /app/models/info_request.rb | |
parent | 6d3d9d9846fa905e606f0a2aa6f1ec32122f4850 (diff) | |
parent | 44d64c22bbd49722688a680ce89bff3d1d3a8bdb (diff) |
Merge branch 'release/0.6.6' into wdtk
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index f2d8929bc..2e16d0f58 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -35,7 +35,7 @@ class InfoRequest < ActiveRecord::Base belongs_to :user validate :must_be_internal_or_external - belongs_to :public_body + belongs_to :public_body, :counter_cache => true validates_presence_of :public_body_id has_many :outgoing_messages, :order => 'created_at' @@ -977,8 +977,9 @@ public def InfoRequest.find_old_unclassified(extra_params={}) params = old_unclassified_params(extra_params, include_last_response_time=true) - params[:limit] = extra_params[:limit] if extra_params[:limit] - params[:include] = extra_params[:include] if extra_params[:include] + [:limit, :include, :offset].each do |extra| + params[extra] = extra_params[extra] if extra_params[extra] + end if extra_params[:order] params[:order] = extra_params[:order] params.delete(:select) |