class method
self.attribute_names
Ruby on Rails 3.1.12
Since v3.1.12 Last seen in v3.1.12Signature
self.attribute_names()
Returns an array of column names as strings if it’s not an abstract class and table exists. Otherwise it returns an empty array.
Source
# File activerecord/lib/active_record/base.rb, line 797
def attribute_names
@attribute_names ||= if !abstract_class? && table_exists?
column_names
else
[]
end
end
Defined in activerecord/lib/active_record/base.rb line 797
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Base