method
attribute_names
v8.0.0 -
Show latest stable
- Class:
ActiveRecord::AttributeMethods::ClassMethods
attribute_names()public
Returns an array of column names as strings if it’s not an abstract class and table exists. Otherwise it returns an empty array.
class Person < ActiveRecord::Base end Person.attribute_names # => ["id", "created_at", "updated_at", "name", "age"]