Easily build a great vocabulary without studying! Now on the App Store!
Click here for more info about the app

Aliasing Attributes in Ruby on Rails


Alias an attribute with alias_attribute method.

The first argument is the name for the new attribute, while the second argument is to identify the attribute that is already defined.

class User < ActiveRecord::Base
  alias_attribute :username, :login
Tagged w/ #activerecord #aliasing #quick tipsruby on rails