Ruby 1.9 compat: workaround module_eval bug. Closes #10641 [Frederick Cheung]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8507 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper
2007-12-29 05:06:06 +00:00
parent 58cf6df41a
commit 07392bfe87

View File

@@ -155,7 +155,7 @@ module ActiveRecord
if (instance_variable_get("@#{name}").nil? || force_reload) && (!allow_nil || mapping.any? {|pair| !read_attribute(pair.first).nil? })
instance_variable_set("@#{name}", class_name.constantize.new(*mapping.collect {|pair| read_attribute(pair.first)}))
end
return instance_variable_get("@#{name}")
instance_variable_get("@#{name}")
end
end