def attr_deprecated(*attributes)
      attributes = Set.new(attributes.compact)
      self._deprecated_attributes ||= Set.new

      # Rails uses lazy initialization to wrap methods, so make sure we pre-initialize any deprecated attributes
      if defined?(ActiveRecord) && ancestors.include?(ActiveRecord::Base)

        # pre-initialize a new instance of our ActiveRecord model from `attributes`
        new(Hash[attributes.zip(attributes.map {})])
      end

      # Taking the difference of the two sets ensures we don't deprecate the same attribute more than once
      (attributes - deprecated_attributes).each do |attribute|
        _set_attribute_as_deprecated attribute
      end

      self._deprecated_attributes += attributes
    end
def attr_deprecated(*attributes)
      attributes = Set.new(attributes.compact)
      self._deprecated_attributes ||= Set.new

      # Rails uses lazy initialization to wrap methods, so make sure we pre-initialize any deprecated attributes
      if defined?(ActiveRecord) && ancestors.include?(ActiveRecord::Base)

        # pre-initialize a new instance of our ActiveRecord model from `attributes`
        new(Hash[attributes.zip(attributes.map {})])
      end

      # Taking the difference of the two sets ensures we don't deprecate the same attribute more than once
      (attributes - deprecated_attributes).each do |attribute|
        _set_attribute_as_deprecated attribute
      end

      self._deprecated_attributes += attributes
    end
== attr_deprecated

 class macro definition to non-destructively mark an attribute as deprecated.

 The original method (i.e. the one marked as deprecated) is renamed and wrapped in an alias that dispatches the
 notification.

 (See the `around_alias` pattern. [Paolo Perotta. Metaprogramming Ruby, p. 121])