diff options
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/attribute_methods.rb | 11 | ||||
-rw-r--r-- | activemodel/lib/active_model/observing.rb | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/serializers/json.rb | 2 | ||||
-rwxr-xr-x | activemodel/lib/active_model/serializers/xml.rb | 6 |
4 files changed, 12 insertions, 9 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb index a1d01b2c89..86eaad830e 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -383,12 +383,11 @@ module ActiveModel def initialize(options = {}) if options[:prefix] == '' || options[:suffix] == '' - ActiveSupport::Deprecation.warn( - "Specifying an empty prefix/suffix for an attribute method is no longer " \ - "necessary. If the un-prefixed/suffixed version of the method has not been " \ - "defined when `define_attribute_methods` is called, it will be defined " \ - "automatically." - ) + message = "Specifying an empty prefix/suffix for an attribute method is no longer " \ + "necessary. If the un-prefixed/suffixed version of the method has not been " \ + "defined when `define_attribute_methods` is called, it will be defined " \ + "automatically." + ActiveSupport::Deprecation.warn message end @prefix, @suffix = options.fetch(:prefix, ''), options.fetch(:suffix, '') diff --git a/activemodel/lib/active_model/observing.rb b/activemodel/lib/active_model/observing.rb index 9419645e7b..5f1c99ce62 100644 --- a/activemodel/lib/active_model/observing.rb +++ b/activemodel/lib/active_model/observing.rb @@ -172,7 +172,7 @@ module ActiveModel # <tt>count_observers</tt> is deprecated. Use #observers_count. def count_observers msg = "count_observers is deprecated in favor of observers_count" - ActiveSupport::Deprecation.warn(msg) + ActiveSupport::Deprecation.warn msg observers_count end diff --git a/activemodel/lib/active_model/serializers/json.rb b/activemodel/lib/active_model/serializers/json.rb index a4252b995d..9d984b7a18 100644 --- a/activemodel/lib/active_model/serializers/json.rb +++ b/activemodel/lib/active_model/serializers/json.rb @@ -1,8 +1,8 @@ require 'active_support/json' module ActiveModel - # == Active Model JSON Serializer module Serializers + # == Active Model JSON Serializer module JSON extend ActiveSupport::Concern include ActiveModel::Serialization diff --git a/activemodel/lib/active_model/serializers/xml.rb b/activemodel/lib/active_model/serializers/xml.rb index cf742d0569..fb6093cce5 100755 --- a/activemodel/lib/active_model/serializers/xml.rb +++ b/activemodel/lib/active_model/serializers/xml.rb @@ -4,12 +4,16 @@ require 'active_support/core_ext/hash/conversions' require 'active_support/core_ext/hash/slice' module ActiveModel - # == Active Model XML Serializer module Serializers + # == Active Model XML Serializer module Xml extend ActiveSupport::Concern include ActiveModel::Serialization + included do + extend ActiveModel::Naming + end + class Serializer #:nodoc: class Attribute #:nodoc: attr_reader :name, :value, :type |