[Ruby] [Updated from time to time] Ruby on Rails Convenient method

less than 1 minute read

I want to know the aliased attribute.

pry(main)> Member.attribute_aliases
=> {"user_name"=>"UserName", "mail_address"=>"MailAddress",}

methods I want to search with grep from the list of methods acquired by method.

pry(main)> Member.methods.grep /attribute_aliases/i
=> [:attribute_aliases, :attribute_aliases?, :attribute_aliases=]