attribute_names()
Instance Public methods
Returns an array of column names as strings if it's not an abstract class and table exists. Otherwise it returns an empty array.
1 2 3 4 5 | class Person < ActiveRecord::Base end Person.attribute_names # => ["id", "created_at", "updated_at", "name", "age"] |
Please login to continue.