ransack 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/ransack/helpers/form_builder.rb +9 -2
- data/lib/ransack/locale/en.yml +2 -0
- data/lib/ransack/version.rb +1 -1
- metadata +1 -1
@@ -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,
|
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
|
data/lib/ransack/locale/en.yml
CHANGED
data/lib/ransack/version.rb
CHANGED