Last active
November 14, 2015 02:56
-
-
Save eugeneius/e644d420da97dfc0b920 to your computer and use it in GitHub Desktop.
Demonstrates a bug in the identity_cache gem: https://github.com/Shopify/identity_cache/issues/246
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "test_helper" | |
class MemoizedAttributesTest < IdentityCache::TestCase | |
def test_memoization_should_not_break_dirty_tracking | |
item = Item.create! | |
IdentityCache.cache.with_memoization do | |
Item.fetch(item.id) | |
Item.fetch(item.id).title = "my title" | |
Item.fetch(item.id).update(title: "my title") | |
assert_equal "my title", Item.find(item.id).title | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment