diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/public_body.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb index d3544e13c..829625cac 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -166,6 +166,13 @@ class PublicBody < ActiveRecord::Base t.save! end else # Array => creating + warn "[DEPRECATION] PublicBody#translations_attributes= " \ + "will no longer accept an Array as of release 0.22. " \ + "Use Hash arguments instead. See " \ + "spec/models/public_body_spec.rb and " \ + "app/views/admin_public_body/_form.html.erb for more " \ + "details." + translation_attrs.each do |attrs| next if empty_translation?(attrs) new_translation = PublicBody::Translation.new(attrs) @@ -175,6 +182,12 @@ class PublicBody < ActiveRecord::Base end end + def translated_versions=(translation_attrs) + warn "[DEPRECATION] PublicBody#translated_versions= will be replaced " \ + "by PublicBody#translations_attributes= as of release 0.22" + self.translations_attributes = translation_attrs + end + def set_default_publication_scheme # Make sure publication_scheme gets the correct default value. # (This would work automatically, were publication_scheme not a translated attribute) |