Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/mongoid/versioning/monkey_patches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ def instantiate(attrs = nil, criteria_instance_id = nil)
doc.criteria_instance_id = criteria_instance_id
doc.instance_variable_set(:@attributes, attributes)
doc.apply_defaults
IdentityMap.set(doc) unless _loading_revision?
yield(doc) if block_given?
doc.run_callbacks(:find) unless doc._find_callbacks.empty?
doc.run_callbacks(:initialize) unless doc._initialize_callbacks.empty?
Expand Down
33 changes: 0 additions & 33 deletions spec/mongoid/versioning_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -497,37 +497,4 @@ class WikiPage
end
end

context "when the identity map is enabled" do

before do
Mongoid.identity_map_enabled = true
end

after do
Mongoid.identity_map_enabled = false
end

context "when updating a loaded attribute" do

let!(:page) do
WikiPage.create(title: "first")
end

let!(:loaded) do
WikiPage.find(page.id)
end

before do
loaded.update_attribute(:title, "revised")
end

let(:reloaded) do
WikiPage.find(page.id)
end

it "returns the revised im memory document" do
reloaded.title.should eq("revised")
end
end
end
end
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class Application < Rails::Application
# Drop all collections and clear the identity map before each spec.
config.before(:each) do
Mongoid.purge!
Mongoid::IdentityMap.clear
end

# On travis we are creating many different databases on each test run. We
Expand Down