instance method
attribute_names
Ruby on Rails 3.2.22.5
Since v3.2.22.5Signature
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/attribute_methods.rb, line 128
def attribute_names
@attribute_names ||= if !abstract_class? && table_exists?
column_names
else
[]
end
end
Defined in activerecord/lib/active_record/attribute_methods.rb line 128
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AttributeMethods::ClassMethods