Skip to content
Browse files

Remove unnecessary scoping and validation checks from hm:t#create

  • Loading branch information...
1 parent d9c4087 commit 50b83984f111552b91a25b3b1d139f65efcc8e8f @lifo lifo committed Aug 10, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/associations/has_many_through_association.rb
View
2 activerecord/lib/active_record/associations/has_many_through_association.rb
@@ -36,7 +36,7 @@ def create_record(attrs, force = true)
ensure_owner_is_not_new
transaction do
- object = attrs ? @reflection.klass.send(:with_scope, :create => attrs) { @reflection.create_association } : @reflection.create_association
+ object = @reflection.klass.new(attrs)
add_record_to_target_with_callbacks(object) {|r| insert_record(object, force) }
object
end

0 comments on commit 50b8398

Please sign in to comment.
Something went wrong with that request. Please try again.