alias_attribute(new_name, old_name) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activemodel/lib/active_model/attribute_methods.rb, line 238
      def alias_attribute(new_name, old_name)
        attribute_method_matchers.each do |matcher|
          matcher_new = matcher.method_name(new_name).to_s
          matcher_old = matcher.method_name(old_name).to_s

          if matcher_new =~ COMPILABLE_REGEXP && matcher_old =~ COMPILABLE_REGEXP
            module_eval               def #{matcher_new}(*args)                send(:#{matcher_old}, *args)              end, __FILE__, __LINE__ + 1
          else
            define_method(matcher_new) do |*args|
              send(matcher_old, *args)
            end
          end
        end
      end
Register or log in to add new notes.