aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/info_request.rb2
-rw-r--r--app/models/public_body.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index f2d8929bc..ed54da840 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'
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index e5ef26047..77da81d4c 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -186,7 +186,7 @@ class PublicBody < ActiveRecord::Base
end
acts_as_versioned
- self.non_versioned_columns << 'created_at' << 'updated_at' << 'first_letter' << 'api_key'
+ self.non_versioned_columns << 'created_at' << 'updated_at' << 'first_letter' << 'api_key' << 'info_requests_count'
class Version
attr_accessor :created_at