aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-10-05 19:27:33 +0000
committerRick Olson <technoweenie@gmail.com>2007-10-05 19:27:33 +0000
commit24c2457a26983c323f0c90d175c00453d853f3b6 (patch)
treef36c14c42fab53faa48ec8afec5f26d4df2c328d /activerecord/lib
parent58a5eef53eee7768d68cc034a1563914d21a68cb (diff)
downloadrails-24c2457a26983c323f0c90d175c00453d853f3b6.tar.gz
rails-24c2457a26983c323f0c90d175c00453d853f3b6.tar.bz2
rails-24c2457a26983c323f0c90d175c00453d853f3b6.zip
Don't call attr_readonly on polymorphic belongs_to associations, in case it matches the name of some other non-ActiveRecord class/module. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7748 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/associations.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 1ec7d6021f..6a2887e528 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -844,7 +844,7 @@ module ActiveRecord
)
module_eval(
- "#{reflection.class_name}.send(:attr_readonly,\"#{cache_column}\".intern) if defined?(#{reflection.class_name})"
+ "#{reflection.class_name}.send(:attr_readonly,\"#{cache_column}\".intern) if defined?(#{reflection.class_name}) && #{reflection.class_name}.respond_to?(:attr_readonly)"
)
end
end