up: avoid inverse merge

main
Washington Botelho 2020-01-16 18:44:32 -03:00
parent bff0655f37
commit 0056d7eaad
No known key found for this signature in database
GPG Key ID: 5DE4F42A8F073617
1 changed files with 1 additions and 3 deletions

View File

@ -34,9 +34,7 @@ module Rating
end end
def self.rate_for(author:, extra_scopes: {}, resource:, scopeable: nil) def self.rate_for(author:, extra_scopes: {}, resource:, scopeable: nil)
attributes = { author: author, resource: resource, scopeable: scopeable }.merge(extra_scopes) find_by extra_scopes.merge(author: author, resource: resource, scopeable: scopeable)
find_by attributes
end end
private private