aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/public_body.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/public_body.rb')
-rw-r--r--app/models/public_body.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 9efeadf55..60ecb2781 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
# == Schema Information
#
# Table name: public_bodies
@@ -41,6 +42,7 @@ class PublicBody < ActiveRecord::Base
has_many :info_requests, :order => 'created_at desc'
has_many :track_things, :order => 'created_at desc'
+ has_many :censor_rules, :order => 'created_at desc'
has_tag_string
@@ -91,8 +93,9 @@ class PublicBody < ActiveRecord::Base
# Make sure publication_scheme gets the correct default value.
# (This would work automatically, were publication_scheme not a translated attribute)
self.publication_scheme = "" if self.publication_scheme.nil?
-
- # Set an API key if there isn’t one
+ end
+
+ def before_save
self.api_key = SecureRandom.base64(33) if self.api_key.nil?
end