Flowdock
method

attribute_names

Importance_1
Ruby on Rails latest stable (v4.0.2) - 0 notes - 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"]
Show source
Register or log in to add new notes.