Permalink
Browse files

Dont define respond_to? lookups for primary key

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@230 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent dad37cf commit c489b87d9d8e584541bc5b8f19c795eaff71a07d @dhh dhh committed Dec 19, 2004
Showing with 1 addition and 0 deletions.
  1. +1 −0 activerecord/lib/active_record/base.rb
View
1 activerecord/lib/active_record/base.rb
@@ -529,6 +529,7 @@ def content_columns
# 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

0 comments on commit c489b87

Please sign in to comment.