def _set_attribute_as_deprecated(attribute)
      original_attribute_method = instance_method(attribute.to_sym)

      klass = self
      define_method attribute.to_sym do |*args|
        backtrace_cleaner = ActiveSupport::BacktraceCleaner.new

        backtrace = backtrace_cleaner.clean(caller)

        klass._notify_deprecated_attribute_call({klass: self, attribute: attribute, args: args, backtrace: backtrace})

        # Call the original attribute method.
        original_attribute_method.bind(self).call(*args)
      end
    end
def _set_attribute_as_deprecated(attribute)
      original_attribute_method = instance_method(attribute.to_sym)

      klass = self
      define_method attribute.to_sym do |*args|
        backtrace_cleaner = ActiveSupport::BacktraceCleaner.new

        backtrace = backtrace_cleaner.clean(caller)

        klass._notify_deprecated_attribute_call({klass: self, attribute: attribute, args: args, backtrace: backtrace})

        # Call the original attribute method.
        original_attribute_method.bind(self).call(*args)
      end
    end
Wrap the original attribute method with appropriate notification while leaving the functionality
 of the original method unchanged.