instance method
attribute_names
Ruby on Rails 4.2.9
Since v4.0.13Signature
attribute_names()
Returns an array of names for the attributes available on this object.
class Person < ActiveRecord::Base end person = Person.new person.attribute_names # => ["id", "created_at", "updated_at", "name", "age"]
Source
# File activerecord/lib/active_record/attribute_methods.rb, line 271
def attribute_names
@attributes.keys
end
Defined in activerecord/lib/active_record/attribute_methods.rb line 271
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AttributeMethods