We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
user = User.create(name: "test", email: "test@gmail.com") user1 = User.fetch_by_uniq_keys(id: user.id) user2 = User.fetch_by_uniq_keys(id: user.id) user1.update_attribute(:name, "user1") user2.update_attribute(:email, "user2@gmail.com") user_from_cache = User.fetch_by_uniq_keys(id: user.id) user_from_database = User.without_second_level_cache { User.find(user.id) } assert_equal user_from_database.attributes, user_from_cache.attributes ------------------------------------------------------------------------------------------------------------------------------ bundle exec rake test result: Failure: FetchByUinqKeyTest#test_simulation_high_speed_update_same_record [/Code/second_level_cache/test/fetch_by_uniq_key_test.rb:111]: --- expected +++ actual @@ -1 +1 @@ -{"id"=>2, "options"=>[], "json_options"=>nil, "extras"=>{}, "name"=>"user1", "email"=>"user2@gmail.com", "status"=>"active", "books_count"=>0, "images_count"=>0, "created_at"=>2021-01-29 06:42:26.331878 UTC, "updated_at"=>2021-01-29 06:42:28.335177 UTC} +{"id"=>2, "options"=>[], "json_options"=>nil, "extras"=>{}, "name"=>"test", "email"=>"user2@gmail.com", "status"=>"active", "books_count"=>0, "images_count"=>0, "created_at"=>2021-01-29 06:42:26.331878 UTC, "updated_at"=>2021-01-29 06:42:28.335177 UTC}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: