Skip to content

Commit

Permalink
Workaround for simple mode in/not_in, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernie Miller committed Jul 24, 2011
1 parent 48891b9 commit 119d470
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/ransack/nodes/condition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def extract(context, key, values)
:a => attributes,
:p => predicate.name,
:m => combinator,
:v => [values]
:v => %w(in not_in).include?(predicate.arel_predicate) ? Array(values) : [values]
)
# TODO: Figure out what to do with multiple types of attributes, if anything.
# Tempted to go with "garbage in, garbage out" on this one
Expand Down Expand Up @@ -113,7 +113,7 @@ def build_value(val = nil)
end

def value
predicate.compound ? values.map {|v| v.cast(default_type)} : values.first.cast(default_type)
predicate.wants_array ? values.map {|v| v.cast(default_type)} : values.first.cast(default_type)
end

def build(params)
Expand Down
2 changes: 1 addition & 1 deletion lib/ransack/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Ransack
VERSION = "0.5.3"
VERSION = "0.5.4"
end

0 comments on commit 119d470

Please sign in to comment.