提交 16718e3e 编写于 作者: T Tobias Lütke

Fixed that .with_scope imposed create parameters bypass attr_protected


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3393 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 7dd2d38b
*SVN*
* .with_scope imposed create parameters now bypass attr_protected [Tobias Luetke]
* Don't raise an exception when there are more keys than there are named bind variables when sanitizing conditions. [Marcel Molina Jr.]
* Multiple enhancements and adjustments to DB2 adaptor. #3377 [contact@maik-schmidt.de]
......
......@@ -444,9 +444,10 @@ def create(attributes = nil)
if attributes.is_a?(Array)
attributes.collect { |attr| create(attr) }
else
attributes.reverse_merge!(scope(:create)) if scoped?(:create)
object = new(attributes)
if scoped?(:create)
scope(:create).each { |att,value| object.send("#{att}=", value) }
end
object.save
object
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册