Skip to content
Browse files

make sure new_record is set to true before inserting

  • Loading branch information...
1 parent 6555816 commit 5f5c55abf4c8564a174a047829ecb46422f44c74 @lawrencepit lawrencepit committed
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/model_stubbing/stub.rb
View
1 lib/model_stubbing/stub.rb
@@ -52,6 +52,7 @@ def inspect
def insert(attributes = {})
@inserting = true
object = record(attributes)
+ object.new_record = true # record could have returned one from the cache
object.save!
@inserting = false
end

0 comments on commit 5f5c55a

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