ransack 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -128,15 +128,22 @@ module Ransack
128
128
  end
129
129
 
130
130
  def combinator_select(options = {}, html_options = {})
131
- choices = Nodes::Condition === object ? [:or, :and] : [:and, :or]
132
131
  @template.collection_select(
133
- @object_name, :m, choices.map {|o| [o.to_s, Translate.word(o)]}, :first, :last,
132
+ @object_name, :m, combinator_choices, :first, :last,
134
133
  objectify_options(options), @default_options.merge(html_options)
135
134
  )
136
135
  end
137
136
 
138
137
  private
139
138
 
139
+ def combinator_choices
140
+ if Nodes::Condition === object
141
+ [['or', Translate.word(:any)], ['and', Translate.word(:all)]]
142
+ else
143
+ [['and', Translate.word(:all)], ['or', Translate.word(:any)]]
144
+ end
145
+ end
146
+
140
147
  def association_array(obj, prefix = nil)
141
148
  ([prefix] + case obj
142
149
  when Array
@@ -4,6 +4,8 @@ en:
4
4
  predicate: "predicate"
5
5
  and: "and"
6
6
  or: "or"
7
+ any: "any"
8
+ all: "all"
7
9
  combinator: "combinator"
8
10
  attribute: "attribute"
9
11
  value: "value"
@@ -1,3 +1,3 @@
1
1
  module Ransack
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ransack
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.0
5
+ version: 0.4.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ernie Miller