converting an inject to a map + Hash[]
This commit is contained in:
parent
61bacc4ada
commit
13aa1e11a0
@ -230,7 +230,7 @@ def construct_limited_ids_condition(relation)
|
||||
end
|
||||
|
||||
def find_by_attributes(match, attributes, *args)
|
||||
conditions = attributes.inject({}) {|h, a| h[a] = args[attributes.index(a)]; h}
|
||||
conditions = Hash[attributes.map {|a| [a, args[attributes.index(a)]]}]
|
||||
result = where(conditions).send(match.finder)
|
||||
|
||||
if match.bang? && result.blank?
|
||||
|
Loading…
Reference in New Issue
Block a user