mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add doc to #attribute_names
This commit is contained in:
parent
d043d65396
commit
2470392e89
1 changed files with 3 additions and 0 deletions
|
@ -767,6 +767,9 @@ module ActiveRecord #:nodoc:
|
|||
super || (table_exists? && column_names.include?(attribute.to_s.sub(/=$/, '')))
|
||||
end
|
||||
|
||||
# Returns an array of column names as strings if it's not
|
||||
# an abstract class and table exists.
|
||||
# Otherwise it returns an empty array.
|
||||
def attribute_names
|
||||
@attribute_names ||= if !abstract_class? && table_exists?
|
||||
column_names
|
||||
|
|
Loading…
Reference in a new issue