From 0056d7eaad1219eb3e69432a71fcd14efee65825 Mon Sep 17 00:00:00 2001 From: Washington Botelho Date: Thu, 16 Jan 2020 18:44:32 -0300 Subject: [PATCH] up: avoid inverse merge --- lib/rating/models/rating/rate.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/rating/models/rating/rate.rb b/lib/rating/models/rating/rate.rb index 24bef7b..89e626a 100644 --- a/lib/rating/models/rating/rate.rb +++ b/lib/rating/models/rating/rate.rb @@ -34,9 +34,7 @@ module Rating end def self.rate_for(author:, extra_scopes: {}, resource:, scopeable: nil) - attributes = { author: author, resource: resource, scopeable: scopeable }.merge(extra_scopes) - - find_by attributes + find_by extra_scopes.merge(author: author, resource: resource, scopeable: scopeable) end private