Module: ActiveCopy::Finders
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#matches?(query) ⇒ Boolean
Test if the query matches this particular model.
Instance Method Details
#matches?(query) ⇒ Boolean
Test if the query matches this particular model.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/active_copy/finders.rb', line 9 def matches? query query.reduce(true) do |matches, (key, value)| matches = if key == 'tag' return false unless .present? .include? value else attributes[key] == value end end end |