Skip to content

Commit

Permalink
Refactored, making any/all scope_options more consistent with other s…
Browse files Browse the repository at this point in the history
…cope_options.

Signed-off-by: Ben Johnson <bjohnson@binarylogic.com>
  • Loading branch information
laserlemon authored and binarylogic committed Aug 19, 2009
1 parent b1bd886 commit 8d0fd11
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/searchlogic/named_scopes/conditions.rb
Expand Up @@ -150,10 +150,8 @@ def scope_options(condition, column_type, sql, value_modifier = nil)
return {} if values.empty? return {} if values.empty?
values.flatten! values.flatten!


values.collect! { |value| value_with_modifier(value, value_modifier) }

join = $1 == "any" ? " OR " : " AND " join = $1 == "any" ? " OR " : " AND "
{:conditions => [values.collect { |value| sql }.join(join), *values]} {:conditions => [values.collect { |value| sql }.join(join), *values.collect { |value| value_with_modifier(value, value_modifier) }]}
} }
else else
searchlogic_lambda(column_type) { |value| {:conditions => [sql, value_with_modifier(value, value_modifier)]} } searchlogic_lambda(column_type) { |value| {:conditions => [sql, value_with_modifier(value, value_modifier)]} }
Expand Down

0 comments on commit 8d0fd11

Please sign in to comment.