aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-19 22:40:09 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-19 22:40:09 +0000
commitc489b87d9d8e584541bc5b8f19c795eaff71a07d (patch)
tree988f5c73c928c21478820506f059ec96e8970991 /activerecord
parentdad37cfafa65a9f0ed2d0db6473c1d6b323dcdfe (diff)
downloadrails-c489b87d9d8e584541bc5b8f19c795eaff71a07d.tar.gz
rails-c489b87d9d8e584541bc5b8f19c795eaff71a07d.tar.bz2
rails-c489b87d9d8e584541bc5b8f19c795eaff71a07d.zip
Dont define respond_to? lookups for primary key
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@230 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rwxr-xr-xactiverecord/lib/active_record/base.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 0f07af2d09..ff0d42f39e 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -529,6 +529,7 @@ module ActiveRecord #:nodoc:
# is available.
def column_methods_hash
@dynamic_methods_hash ||= columns_hash.keys.inject(Hash.new(false)) do |methods, attr|
+ next if attr == primary_key
methods[attr.to_sym] = true
methods["#{attr}=".to_sym] = true
methods["#{attr}?".to_sym] = true