aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-05-15 16:13:29 -0700
committerJosé Valim <jose.valim@gmail.com>2011-05-15 16:13:29 -0700
commitd043d6539682f804a696d301b580accfc68f6cce (patch)
treed1303b0c4dc8a2ed14725c12eec300b7e1fa3bb5 /activerecord/lib
parent6e581cce1c1116d71484a5a4a5f92f0ea6fd29e4 (diff)
parentd77b306b63e20aabec5daf7159d31c8ee31492c9 (diff)
downloadrails-d043d6539682f804a696d301b580accfc68f6cce.tar.gz
rails-d043d6539682f804a696d301b580accfc68f6cce.tar.bz2
rails-d043d6539682f804a696d301b580accfc68f6cce.zip
Merge pull request #570 from sikachu/decouple_actionpack
Make ParamsWrapper use a well-defined API and not rely on AR methods
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/base.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index e1bf2ccc8a..cfe6d8d2de 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -767,6 +767,14 @@ module ActiveRecord #:nodoc:
super || (table_exists? && column_names.include?(attribute.to_s.sub(/=$/, '')))
end
+ def attribute_names
+ @attribute_names ||= if !abstract_class? && table_exists?
+ column_names
+ else
+ []
+ end
+ end
+
# Set the lookup ancestors for ActiveModel.
def lookup_ancestors #:nodoc:
klass = self