From 2470392e89e3320e0e5d4de4dd73db0fd4a30181 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Sun, 15 May 2011 21:33:49 -0300 Subject: Add doc to #attribute_names --- activerecord/lib/active_record/base.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index cfe6d8d2de..cd16b8d3ca 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -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 -- cgit v1.2.3