Skip to content

Commit

Permalink
Fixed error with save and arguments in IM.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Jan 19, 2010
1 parent 954190e commit e82f7f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mongo_mapper/plugins/identity_map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def identity_map
self.class.identity_map
end

def save
def save(*args)
if result = super
identity_map[identity_map_key] = self
end
Expand Down
7 changes: 7 additions & 0 deletions test/functional/test_identity_map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ def assert_not_in_map(resource)
person.save.should be_true
assert_in_map(person)
end

should "allow saving with options" do
person = @person_class.new
assert_nothing_raised do
person.save(:validate => false).should be_true
end
end

should "remove key from map when deleted" do
person = @person_class.create(:name => 'Fred')
Expand Down

0 comments on commit e82f7f4

Please sign in to comment.