ransack 1.8.4 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. checksums.yaml +5 -5
  2. data/.github/FUNDING.yml +3 -0
  3. data/.github/SECURITY.md +12 -0
  4. data/.github/workflows/cronjob.yml +102 -0
  5. data/.github/workflows/deploy.yml +35 -0
  6. data/.github/workflows/rubocop.yml +20 -0
  7. data/.github/workflows/test-deploy.yml +29 -0
  8. data/.github/workflows/test.yml +130 -0
  9. data/.gitignore +3 -0
  10. data/{lib/ransack/adapters/mongoid/3.2/.gitkeep → .nojekyll} +0 -0
  11. data/.rubocop.yml +44 -0
  12. data/CHANGELOG.md +352 -0
  13. data/CONTRIBUTING.md +25 -13
  14. data/Gemfile +26 -27
  15. data/README.md +65 -815
  16. data/Rakefile +1 -22
  17. data/bug_report_templates/test-ransack-scope-and-column-same-name.rb +78 -0
  18. data/bug_report_templates/test-ransacker-arel-present-predicate.rb +71 -0
  19. data/docs/.gitignore +19 -0
  20. data/docs/.nojekyll +0 -0
  21. data/docs/babel.config.js +3 -0
  22. data/docs/blog/2022-03-27-ransack-3.0.0.md +20 -0
  23. data/docs/docs/getting-started/_category_.json +4 -0
  24. data/docs/docs/getting-started/advanced-mode.md +46 -0
  25. data/docs/docs/getting-started/configuration.md +47 -0
  26. data/docs/docs/getting-started/search-matches.md +67 -0
  27. data/docs/docs/getting-started/simple-mode.md +284 -0
  28. data/docs/docs/getting-started/sorting.md +79 -0
  29. data/docs/docs/getting-started/using-predicates.md +282 -0
  30. data/docs/docs/going-further/_category_.json +4 -0
  31. data/docs/docs/going-further/acts-as-taggable-on.md +114 -0
  32. data/docs/docs/going-further/associations.md +70 -0
  33. data/docs/docs/going-further/custom-predicates.md +52 -0
  34. data/docs/docs/going-further/documentation.md +43 -0
  35. data/docs/docs/going-further/exporting-to-csv.md +49 -0
  36. data/docs/docs/going-further/external-guides.md +57 -0
  37. data/docs/docs/going-further/form-customisation.md +63 -0
  38. data/docs/docs/going-further/i18n.md +53 -0
  39. data/docs/docs/going-further/img/create_release.png +0 -0
  40. data/docs/docs/going-further/merging-searches.md +41 -0
  41. data/docs/docs/going-further/other-notes.md +428 -0
  42. data/docs/docs/going-further/polymorphic-search.md +40 -0
  43. data/docs/docs/going-further/ransackers.md +331 -0
  44. data/docs/docs/going-further/release_process.md +36 -0
  45. data/docs/docs/going-further/saving-queries.md +82 -0
  46. data/docs/docs/going-further/searching-postgres.md +57 -0
  47. data/docs/docs/going-further/wiki-contributors.md +82 -0
  48. data/docs/docs/intro.md +99 -0
  49. data/docs/docusaurus.config.js +120 -0
  50. data/docs/package.json +38 -0
  51. data/docs/sidebars.js +31 -0
  52. data/docs/src/components/HomepageFeatures/index.js +64 -0
  53. data/docs/src/components/HomepageFeatures/styles.module.css +11 -0
  54. data/docs/src/css/custom.css +39 -0
  55. data/docs/src/pages/index.module.css +23 -0
  56. data/docs/src/pages/markdown-page.md +7 -0
  57. data/docs/static/.nojekyll +0 -0
  58. data/docs/static/img/docusaurus.png +0 -0
  59. data/docs/static/img/favicon.ico +0 -0
  60. data/docs/static/img/logo.svg +1 -0
  61. data/docs/static/img/tutorial/docsVersionDropdown.png +0 -0
  62. data/docs/static/img/tutorial/localeDropdown.png +0 -0
  63. data/docs/static/img/undraw_docusaurus_mountain.svg +171 -0
  64. data/docs/static/img/undraw_docusaurus_react.svg +170 -0
  65. data/docs/static/img/undraw_docusaurus_tree.svg +40 -0
  66. data/docs/static/logo/ransack-h.png +0 -0
  67. data/docs/static/logo/ransack-h.svg +34 -0
  68. data/docs/static/logo/ransack-v.png +0 -0
  69. data/docs/static/logo/ransack-v.svg +34 -0
  70. data/docs/static/logo/ransack.png +0 -0
  71. data/docs/static/logo/ransack.svg +21 -0
  72. data/docs/yarn.lock +8436 -0
  73. data/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +70 -0
  74. data/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +92 -0
  75. data/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +11 -0
  76. data/lib/polyamorous/activerecord_7.0_ruby_2/join_association.rb +1 -0
  77. data/lib/polyamorous/activerecord_7.0_ruby_2/join_dependency.rb +1 -0
  78. data/lib/polyamorous/activerecord_7.0_ruby_2/reflection.rb +1 -0
  79. data/lib/polyamorous/activerecord_7.1_ruby_2/join_association.rb +1 -0
  80. data/lib/polyamorous/activerecord_7.1_ruby_2/join_dependency.rb +1 -0
  81. data/lib/polyamorous/activerecord_7.1_ruby_2/reflection.rb +1 -0
  82. data/lib/polyamorous/join.rb +70 -0
  83. data/lib/polyamorous/polyamorous.rb +24 -0
  84. data/lib/polyamorous/swapping_reflection_class.rb +11 -0
  85. data/lib/polyamorous/tree_node.rb +7 -0
  86. data/lib/polyamorous.rb +1 -0
  87. data/lib/ransack/adapters/active_record/base.rb +14 -3
  88. data/lib/ransack/adapters/active_record/context.rb +140 -196
  89. data/lib/ransack/adapters/active_record/ransack/constants.rb +19 -4
  90. data/lib/ransack/adapters/active_record/ransack/context.rb +9 -19
  91. data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +7 -7
  92. data/lib/ransack/adapters/active_record/ransack/translate.rb +1 -5
  93. data/lib/ransack/adapters/active_record/ransack/visitor.rb +23 -0
  94. data/lib/ransack/adapters/active_record.rb +0 -9
  95. data/lib/ransack/adapters.rb +2 -0
  96. data/lib/ransack/configuration.rb +52 -2
  97. data/lib/ransack/constants.rb +1 -5
  98. data/lib/ransack/context.rb +29 -24
  99. data/lib/ransack/helpers/form_builder.rb +12 -6
  100. data/lib/ransack/helpers/form_helper.rb +11 -3
  101. data/lib/ransack/helpers.rb +1 -1
  102. data/lib/ransack/locale/ar.yml +70 -0
  103. data/lib/ransack/locale/az.yml +70 -0
  104. data/lib/ransack/locale/bg.yml +70 -0
  105. data/lib/ransack/locale/ca.yml +70 -0
  106. data/lib/ransack/locale/el.yml +70 -0
  107. data/lib/ransack/locale/es.yml +22 -22
  108. data/lib/ransack/locale/fa.yml +70 -0
  109. data/lib/ransack/locale/fi.yml +71 -0
  110. data/lib/ransack/locale/nl.yml +4 -4
  111. data/lib/ransack/locale/ru.yml +70 -0
  112. data/lib/ransack/locale/sk.yml +70 -0
  113. data/lib/ransack/locale/sv.yml +70 -0
  114. data/lib/ransack/locale/tr.yml +70 -0
  115. data/lib/ransack/locale/zh-CN.yml +12 -12
  116. data/lib/ransack/nodes/attribute.rb +2 -2
  117. data/lib/ransack/nodes/condition.rb +7 -1
  118. data/lib/ransack/nodes/grouping.rb +3 -8
  119. data/lib/ransack/nodes/sort.rb +3 -3
  120. data/lib/ransack/nodes/value.rb +3 -3
  121. data/lib/ransack/predicate.rb +13 -20
  122. data/lib/ransack/search.rb +7 -4
  123. data/lib/ransack/translate.rb +115 -115
  124. data/lib/ransack/version.rb +1 -1
  125. data/lib/ransack/visitor.rb +1 -12
  126. data/lib/ransack.rb +7 -5
  127. data/ransack.gemspec +9 -25
  128. data/spec/blueprints/articles.rb +1 -1
  129. data/spec/blueprints/comments.rb +1 -1
  130. data/spec/blueprints/notes.rb +1 -1
  131. data/spec/blueprints/tags.rb +1 -1
  132. data/spec/console.rb +5 -5
  133. data/spec/helpers/polyamorous_helper.rb +13 -0
  134. data/spec/helpers/ransack_helper.rb +1 -1
  135. data/spec/polyamorous/activerecord_compatibility_spec.rb +15 -0
  136. data/spec/polyamorous/join_association_spec.rb +30 -0
  137. data/spec/polyamorous/join_dependency_spec.rb +81 -0
  138. data/spec/polyamorous/join_spec.rb +19 -0
  139. data/spec/ransack/adapters/active_record/base_spec.rb +105 -11
  140. data/spec/ransack/adapters/active_record/context_spec.rb +63 -24
  141. data/spec/ransack/configuration_spec.rb +24 -0
  142. data/spec/ransack/helpers/form_builder_spec.rb +3 -15
  143. data/spec/ransack/helpers/form_helper_spec.rb +135 -168
  144. data/spec/ransack/nodes/condition_spec.rb +13 -0
  145. data/spec/ransack/nodes/grouping_spec.rb +2 -2
  146. data/spec/ransack/nodes/value_spec.rb +115 -0
  147. data/spec/ransack/predicate_spec.rb +54 -2
  148. data/spec/ransack/search_spec.rb +266 -36
  149. data/spec/spec_helper.rb +14 -5
  150. data/spec/support/schema.rb +99 -21
  151. metadata +117 -187
  152. data/.travis.yml +0 -86
  153. data/lib/ransack/adapters/active_record/3.0/compat.rb +0 -179
  154. data/lib/ransack/adapters/active_record/3.0/context.rb +0 -203
  155. data/lib/ransack/adapters/active_record/3.1/context.rb +0 -212
  156. data/lib/ransack/adapters/active_record/3.2/context.rb +0 -44
  157. data/lib/ransack/adapters/active_record/compat.rb +0 -14
  158. data/lib/ransack/adapters/mongoid/attributes/attribute.rb +0 -37
  159. data/lib/ransack/adapters/mongoid/attributes/order_predications.rb +0 -17
  160. data/lib/ransack/adapters/mongoid/attributes/predications.rb +0 -141
  161. data/lib/ransack/adapters/mongoid/base.rb +0 -134
  162. data/lib/ransack/adapters/mongoid/context.rb +0 -212
  163. data/lib/ransack/adapters/mongoid/inquiry_hash.rb +0 -23
  164. data/lib/ransack/adapters/mongoid/ransack/constants.rb +0 -88
  165. data/lib/ransack/adapters/mongoid/ransack/context.rb +0 -60
  166. data/lib/ransack/adapters/mongoid/ransack/nodes/condition.rb +0 -27
  167. data/lib/ransack/adapters/mongoid/ransack/translate.rb +0 -13
  168. data/lib/ransack/adapters/mongoid/ransack/visitor.rb +0 -24
  169. data/lib/ransack/adapters/mongoid/table.rb +0 -35
  170. data/lib/ransack/adapters/mongoid.rb +0 -15
  171. data/spec/mongoid/adapters/mongoid/base_spec.rb +0 -314
  172. data/spec/mongoid/adapters/mongoid/context_spec.rb +0 -56
  173. data/spec/mongoid/configuration_spec.rb +0 -162
  174. data/spec/mongoid/dependencies_spec.rb +0 -8
  175. data/spec/mongoid/helpers/ransack_helper.rb +0 -11
  176. data/spec/mongoid/nodes/condition_spec.rb +0 -49
  177. data/spec/mongoid/nodes/grouping_spec.rb +0 -13
  178. data/spec/mongoid/predicate_spec.rb +0 -155
  179. data/spec/mongoid/search_spec.rb +0 -445
  180. data/spec/mongoid/support/mongoid.yml +0 -11
  181. data/spec/mongoid/support/schema.rb +0 -135
  182. data/spec/mongoid/translate_spec.rb +0 -14
  183. data/spec/mongoid_spec_helper.rb +0 -63
  184. data/spec/ransack/dependencies_spec.rb +0 -12
@@ -6,11 +6,11 @@ es:
6
6
  or: "o"
7
7
  any: "cualquier"
8
8
  all: "todos"
9
- combinator: "combinado"
9
+ combinator: "combinador"
10
10
  attribute: "atributo"
11
11
  value: "valor"
12
12
  condition: "condición"
13
- sort: "ordernar"
13
+ sort: "ordenar"
14
14
  asc: "ascendente"
15
15
  desc: "descendente"
16
16
  predicates:
@@ -19,12 +19,12 @@ es:
19
19
  eq_all: "es igual a todos"
20
20
  not_eq: "no es igual a"
21
21
  not_eq_any: "no es igual a cualquier"
22
- not_eq_all: "no es iguala todos"
23
- matches: "coincidir"
24
- matches_any: "coincidir a cualquier"
25
- matches_all: "coincidir a todos"
26
- does_not_match: "no coincide"
27
- does_not_match_any: "no coincide con ninguna"
22
+ not_eq_all: "no es igual a todos"
23
+ matches: "coincide con"
24
+ matches_any: "coincide con cualquier"
25
+ matches_all: "coincide con todos"
26
+ does_not_match: "no coincide con"
27
+ does_not_match_any: "no coincide con ninguno"
28
28
  does_not_match_all: "no coincide con todos"
29
29
  lt: "menor que"
30
30
  lt_any: "menor que cualquier"
@@ -48,23 +48,23 @@ es:
48
48
  cont_any: "contiene cualquier"
49
49
  cont_all: "contiene todos"
50
50
  not_cont: "no contiene"
51
- not_cont_any: "no contiene ninguna"
52
- not_cont_all: "no contiene toda"
51
+ not_cont_any: "no contiene ninguno"
52
+ not_cont_all: "no contiene todos"
53
53
  start: "comienza con"
54
54
  start_any: "comienza con cualquier"
55
- start_all: "comienza con toda"
56
- not_start: "no inicia con"
55
+ start_all: "comienza con todos"
56
+ not_start: "no comienza con"
57
57
  not_start_any: "no comienza con cualquier"
58
- not_start_all: "no inicia con toda"
59
- end: "termina con"
60
- end_any: "termina con cualquier"
61
- end_all: "termina con todo"
62
- not_end: "no termina con"
63
- not_end_any: "no termina con cualquier"
64
- not_end_all: "no termina con todo"
58
+ not_start_all: "no comienza con todos"
59
+ end: "termina en"
60
+ end_any: "termina en cualquier"
61
+ end_all: "termina en todos"
62
+ not_end: "no termina en"
63
+ not_end_any: "no termina en cualquier"
64
+ not_end_all: "no termina en todos"
65
65
  'true': "es verdadero"
66
66
  'false': "es falso"
67
- present: "es presente"
67
+ present: "está presente"
68
68
  blank: "está en blanco"
69
- 'null': "es nula"
70
- not_null: "no es nula"
69
+ 'null': "es nulo"
70
+ not_null: "no es nulo"
@@ -0,0 +1,70 @@
1
+ fa:
2
+ ransack:
3
+ search: "جستجو"
4
+ predicate: "پیش فرض"
5
+ and: "و"
6
+ or: "یا"
7
+ any: "هر کدام"
8
+ all: "همه"
9
+ combinator: "ترکیب کننده"
10
+ attribute: "ویژگی"
11
+ value: "مقدار"
12
+ condition: "شرایط"
13
+ sort: "مرتب سازی"
14
+ asc: "صعودی"
15
+ desc: "نزولی"
16
+ predicates:
17
+ eq: "مساوی با"
18
+ eq_any: "مساوی با حداقل یکی"
19
+ eq_all: "مساوی با همه"
20
+ not_eq: "غیر مساوی با"
21
+ not_eq_any: "غیر مساوی با هیچ کدام"
22
+ not_eq_all: "غیر مساوی با همه"
23
+ matches: "مشابهات"
24
+ matches_any: "شبیه حداقل یکی"
25
+ matches_all: "شبیه همه"
26
+ does_not_match: "بدون شباهت"
27
+ does_not_match_any: "شبیه یکی هم نیست"
28
+ does_not_match_all: "شبیه هیچ کدام نیست"
29
+ lt: "کمتر از"
30
+ lt_any: "کمتر از حداقل یکی"
31
+ lt_all: "کمتر از همه"
32
+ lteq: "کمتر یا مساوی با"
33
+ lteq_any: "کمتر یا مساوی با حداقل یکی"
34
+ lteq_all: "کمتر یا مساوی با همه"
35
+ gt: "بیشتر از"
36
+ gt_any: "بیشتر از حداقل یکی"
37
+ gt_all: "بیشتر از همه"
38
+ gteq: "بیشتر یا مساوی با"
39
+ gteq_any: "بیشتر یا مساوی با حداقل یکی"
40
+ gteq_all: "بیشتر یا مساوی با همه"
41
+ in: "در"
42
+ in_any: "در حداقل یکی"
43
+ in_all: "در همه"
44
+ not_in: "نه در"
45
+ not_in_any: "نه حتی در یکی"
46
+ not_in_all: "در هیچ کدام"
47
+ cont: "حاوی"
48
+ cont_any: "حاوی حداقل یکی"
49
+ cont_all: "حاوی همه"
50
+ not_cont: "حاوی این نمیشود"
51
+ not_cont_any: "حاوی حتی یکی هم نمیشود"
52
+ not_cont_all: "حاوی هیچ کدام نمیشود"
53
+ start: "شروع می شود با"
54
+ start_any: "شروع می شود با حداقل یکی"
55
+ start_all: "شروع می شود با همه"
56
+ not_start: "شروع نمی شود با"
57
+ not_start_any: "شروع نمی شود با حتی یکی"
58
+ not_start_all: "شروع نمی شود با هیچ کدام"
59
+ end: "به پایان می رسد با"
60
+ end_any: "به پایان می رسد با حداقل یکی"
61
+ end_all: "به پایان می رسد با همه"
62
+ not_end: "پایان نمی یابد با"
63
+ not_end_any: "پایان نمی یابد با حتی یکی"
64
+ not_end_all: "پایان نمی یابد با هیچ کدام"
65
+ 'true': "درست است"
66
+ 'false': "نادرست است"
67
+ present: "موجود است"
68
+ blank: "خالی است"
69
+ 'null': "صفر است"
70
+ not_null: "صفر نیست"
@@ -0,0 +1,71 @@
1
+ fi:
2
+ ransack:
3
+ search: "haku"
4
+ predicate: "predikaatti"
5
+ and: "ja"
6
+ or: "tai"
7
+ any: "jokin"
8
+ all: "kaikki"
9
+ combinator: "kombinaattori"
10
+ attribute: "attribuutti"
11
+ value: "arvo"
12
+ condition: "ehto"
13
+ sort: "järjestys"
14
+ asc: "nouseva"
15
+ desc: "laskeva"
16
+ predicates:
17
+ eq: "sama kuin"
18
+ eq_any: "sama kuin jokin"
19
+ eq_all: "sama kuin kaikki"
20
+ not_eq: "eri kuin"
21
+ not_eq_any: "eri kuin jokin"
22
+ not_eq_all: "eri kuin kaikki"
23
+ matches: "täsmää"
24
+ matches_any: "täsmää jonkun kanssa"
25
+ matches_all: "täsmää kaikkien kanssa"
26
+ does_not_match: "ei täsmää"
27
+ does_not_match_any: "ei täsmää minkään kanssa"
28
+ does_not_match_all: "ei täsmää kaikkien kanssa"
29
+ lt: "vähemmän kuin"
30
+ lt_any: "vähemmän kuin jokin"
31
+ lt_all: "vähemmän kuin mikään"
32
+ lteq: "vähemmän tai sama kuin"
33
+ lteq_any: "vähemmän tai sama kuin jokin"
34
+ lteq_all: "vähemmän tai sama kuin mikään"
35
+ gt: "suurempi kuin"
36
+ gt_any: "suurempi kuin jokin"
37
+ gt_all: "suurempi kuin mikään"
38
+ gteq: "suurempi tai yhtä suuri kuin"
39
+ gteq_any: "suurempi tai yhtä suuri kuin jokin"
40
+ gteq_all: "suurempi tai yhtä suuri kuin mikään"
41
+ in: "kohteessa"
42
+ in_any: "jossakin kohteessa"
43
+ in_all: "kaikissa kohteissa"
44
+ not_in: "ei kohteessa"
45
+ not_in_any: "ei jossakin kohteista"
46
+ not_in_all: "ei missään kohteista"
47
+ cont: "sisältää"
48
+ cont_any: "sisältää jonkin"
49
+ cont_all: "sisältää kaikki"
50
+ not_cont: "ei sisällä"
51
+ not_cont_any: "ei sisällä jotakin"
52
+ not_cont_all: "ei sisällä mitään"
53
+ start: "alkaa"
54
+ start_any: "alkaa jollakin"
55
+ start_all: "alkaa kaikilla"
56
+ not_start: "ei ala"
57
+ not_start_any: "ei ala jollakin"
58
+ not_start_all: "ei ala millään"
59
+ end: "päättyy"
60
+ end_any: "päättyy jollakin"
61
+ end_all: "päättyy millään"
62
+ not_end: "ei pääty"
63
+ not_end_any: "ei pääty jollakin"
64
+ not_end_all: "ei pääty millään"
65
+ 'true': "on tosi"
66
+ 'false': "ei ole tosi"
67
+ present: "on läsnä"
68
+ blank: "on tyhjä"
69
+ 'null': "on määrittämätön"
70
+ not_null: "on määritetty"
71
+
@@ -35,9 +35,9 @@ nl:
35
35
  gt: "groter dan"
36
36
  gt_any: "groter dan enig"
37
37
  gt_all: "groter dan alle"
38
- gteq: "groter dan or equal to"
39
- gteq_any: "groter dan or equal to enig"
40
- gteq_all: "groter dan or equal to alle"
38
+ gteq: "groter dan of gelijk aan"
39
+ gteq_any: "groter dan of gelijk aan enig"
40
+ gteq_all: "groter dan of gelijk aan alle"
41
41
  in: "in"
42
42
  in_any: "in enig"
43
43
  in_all: "in alle"
@@ -64,7 +64,7 @@ nl:
64
64
  not_end_all: "eindigt niet met alle"
65
65
  'true': "is waar"
66
66
  'false': "is niet waar"
67
- present: "is present"
67
+ present: "is aanwezig"
68
68
  blank: "is afwezig"
69
69
  'null': "is null"
70
70
  not_null: "is niet null"
@@ -0,0 +1,70 @@
1
+ ru:
2
+ ransack:
3
+ search: "Поиск"
4
+ predicate: "predicate"
5
+ and: "и"
6
+ or: "или"
7
+ any: "любое"
8
+ all: "все"
9
+ combinator: "combinator"
10
+ attribute: "аттрибут"
11
+ value: "значение"
12
+ condition: "условие"
13
+ sort: "сортировка"
14
+ asc: "по возрастанию"
15
+ desc: "по убыванию"
16
+ predicates:
17
+ eq: "равный"
18
+ eq_any: "равный любому"
19
+ eq_all: "равный всем"
20
+ not_eq: "не равный любому"
21
+ not_eq_any: "не равный любому"
22
+ not_eq_all: "не равный всем"
23
+ matches: "совпадение"
24
+ matches_any: "совпадение любому"
25
+ matches_all: "совпадение всем"
26
+ does_not_match: "не совпадение"
27
+ does_not_match_any: "не совпадение любому"
28
+ does_not_match_all: "не совпадение всем"
29
+ lt: "меньше чем"
30
+ lt_any: "меньше чем любое"
31
+ lt_all: "меньше чем все"
32
+ lteq: "меньше чем или равен"
33
+ lteq_any: "меньше чем или равен любому"
34
+ lteq_all: "меньше чем или равен всем"
35
+ gt: "больше чем"
36
+ gt_any: "больше чем любое"
37
+ gt_all: "больше чем все"
38
+ gteq: "больше чем или равен"
39
+ gteq_any: "больше чем или равен любому"
40
+ gteq_all: "больше чем или равен всем"
41
+ in: "в"
42
+ in_any: "в любом из"
43
+ in_all: "во всех"
44
+ not_in: "нет в"
45
+ not_in_any: "не в каком из"
46
+ not_in_all: "нет во всех"
47
+ cont: "содержит"
48
+ cont_any: "содержит любое"
49
+ cont_all: "содержит все"
50
+ not_cont: "не содержит"
51
+ not_cont_any: "не содержит любое"
52
+ not_cont_all: "не содержит все"
53
+ start: "начинается с"
54
+ start_any: "начинается с любого"
55
+ start_all: "начинается с всего"
56
+ not_start: "не начинается с"
57
+ not_start_any: "не начинается с любого"
58
+ not_start_all: "не начинается со всего"
59
+ end: "кончается с"
60
+ end_any: "кончается с любого"
61
+ end_all: "кончается со всего"
62
+ not_end: "не кончается с"
63
+ not_end_any: "не кончается с любого"
64
+ not_end_all: "не кончается со всего"
65
+ 'true': "верно"
66
+ 'false': "не верно"
67
+ present: "настоящее"
68
+ blank: "пусто"
69
+ 'null': "нулевой"
70
+ not_null: "не нулевой"
@@ -0,0 +1,70 @@
1
+ sk:
2
+ ransack:
3
+ search: "vyhľadávanie"
4
+ predicate: "predikát"
5
+ and: "a"
6
+ or: "alebo"
7
+ any: "akýkoľvek"
8
+ all: "každý"
9
+ combinator: "kombinátor"
10
+ attribute: "atribút"
11
+ value: "hodnota"
12
+ condition: "podmienka"
13
+ sort: "poradie"
14
+ asc: "vzostupne"
15
+ desc: "zostupne"
16
+ predicates:
17
+ eq: "sa rovná"
18
+ eq_any: "sa rovná akémukoľvek"
19
+ eq_all: "sa rovná všetkým"
20
+ not_eq: "sa nerovná"
21
+ not_eq_any: "sa nerovná akémukoľvek"
22
+ not_eq_all: "sa nerovná všetkým"
23
+ matches: "zodpovedá"
24
+ matches_any: "zodpovedá akémukoľvek"
25
+ matches_all: "zodpovedá všetkým"
26
+ does_not_match: "nezodpovedá"
27
+ does_not_match_any: "nezodpovedá akémukoľvek"
28
+ does_not_match_all: "nezodpovedá všetkým"
29
+ lt: "menší ako"
30
+ lt_any: "menší ako akýkoľvek"
31
+ lt_all: "menší ako všetky"
32
+ lteq: "menší alebo rovný"
33
+ lteq_any: "menší alebo rovný akémukoľvek"
34
+ lteq_all: "menší alebo rovný všetkým"
35
+ gt: "väčší ako"
36
+ gt_any: "väčší ako akýkoľvek"
37
+ gt_all: "väčší ako všetky"
38
+ gteq: "väčší alebo rovný"
39
+ gteq_any: "väčší alebo rovný akémukoľvek"
40
+ gteq_all: "väčší alebo rovný všetkým"
41
+ in: "v"
42
+ in_any: "v akejkoľvek"
43
+ in_all: "vo všetkých"
44
+ not_in: "nie je v"
45
+ not_in_any: "nie je v akejkoľvek"
46
+ not_in_all: "nie je vo všetkých"
47
+ cont: "obsahuje"
48
+ cont_any: "obsahuje akúkoľvek"
49
+ cont_all: "obsahuje všetky"
50
+ not_cont: "neobsahuje"
51
+ not_cont_any: "neobsahuje akúkoľvek"
52
+ not_cont_all: "neobsahuje všetky"
53
+ start: "začína na"
54
+ start_any: "začína s akoukoľvek"
55
+ start_all: "začína so všetkými"
56
+ not_start: "nezačíná s"
57
+ not_start_any: "nezačíná s akoukoľvek"
58
+ not_start_all: "nezačíná so všetkými"
59
+ end: "končí s"
60
+ end_any: "končí s akoukoľvek"
61
+ end_all: "končí so všetkými"
62
+ not_end: "nekončí s"
63
+ not_end_any: "nekončí s akoukoľvek"
64
+ not_end_all: "nekončí so všetkými"
65
+ 'true': "je pravdivé"
66
+ 'false': "nie je pravdivé"
67
+ present: "je vyplnené"
68
+ blank: "je prázdne"
69
+ 'null': "je null"
70
+ not_null: "nie je null"
@@ -0,0 +1,70 @@
1
+ sv:
2
+ ransack:
3
+ search: "sök"
4
+ predicate: "predikat"
5
+ and: "och"
6
+ or: "eller"
7
+ any: "vilken som"
8
+ all: "alla"
9
+ combinator: "kombinator"
10
+ attribute: "attribut"
11
+ value: "värde"
12
+ condition: "villkor"
13
+ sort: "sortera"
14
+ asc: "stigande"
15
+ desc: "fallande"
16
+ predicates:
17
+ eq: "lika med"
18
+ eq_any: "lika med vilket som"
19
+ eq_all: "lika med alla"
20
+ not_eq: "inte lika med"
21
+ not_eq_any: "inte lika med någon"
22
+ not_eq_all: "inte lika med alla"
23
+ matches: "matchar"
24
+ matches_any: "matchar någon"
25
+ matches_all: "matchar alla"
26
+ does_not_match: "matchar inte"
27
+ does_not_match_any: "matchar inte någon"
28
+ does_not_match_all: "matchar inte alla"
29
+ lt: "mindre än"
30
+ lt_any: "mindre än någon"
31
+ lt_all: "mindre än alla"
32
+ lteq: "mindre än eller lika med"
33
+ lteq_any: "mindre än eller lika med någon"
34
+ lteq_all: "mindre än eller lika med alla"
35
+ gt: "större än"
36
+ gt_any: "större än någon"
37
+ gt_all: "större än alla"
38
+ gteq: "större än eller lika med"
39
+ gteq_any: "större än eller lika med någon"
40
+ gteq_all: "större än eller lika med alla"
41
+ in: "i"
42
+ in_any: "i någon"
43
+ in_all: "i alla"
44
+ not_in: "inte i"
45
+ not_in_any: "inte i någon"
46
+ not_in_all: "inte i alla"
47
+ cont: "innehåller"
48
+ cont_any: "innehåller någon"
49
+ cont_all: "innehåller alla"
50
+ not_cont: "innehåller inte"
51
+ not_cont_any: "innehåller inte någon"
52
+ not_cont_all: "innehåller inte alla"
53
+ start: "börjar med"
54
+ start_any: "börjar med någon"
55
+ start_all: "börjar med alla"
56
+ not_start: "börjar inte med"
57
+ not_start_any: "börjar inte med någon"
58
+ not_start_all: "börjar inte med alla"
59
+ end: "slutar med"
60
+ end_any: "slutar med någon"
61
+ end_all: "slutar med alla"
62
+ not_end: "slutar inte med"
63
+ not_end_any: "slutar inte med någon"
64
+ not_end_all: "slutar inte med alla"
65
+ 'true': "är sant"
66
+ 'false': "är falskt"
67
+ present: "existerar"
68
+ blank: "är tom"
69
+ 'null': "är null"
70
+ not_null: "är inte null"
@@ -0,0 +1,70 @@
1
+ tr:
2
+ ransack:
3
+ search: "ara"
4
+ predicate: "doğrula"
5
+ and: "ve"
6
+ or: "veya"
7
+ any: "herhangi"
8
+ all: "hepsi"
9
+ combinator: "birleştirici"
10
+ attribute: "nitelik"
11
+ value: "değer"
12
+ condition: "şart"
13
+ sort: "sırala"
14
+ asc: "artan"
15
+ desc: "azalan"
16
+ predicates:
17
+ eq: "eşit"
18
+ eq_any: "herhangi birine eşit"
19
+ eq_all: "hepsine eşit"
20
+ not_eq: "eşit değil"
21
+ not_eq_any: "herhangi birine eşit değil"
22
+ not_eq_all: "hiçbirine eşit değil"
23
+ matches: "eşleşen"
24
+ matches_any: "herhangi biri ile eşleşen"
25
+ matches_all: "hepsi ile eşleşen"
26
+ does_not_match: "eşleşmeyen"
27
+ does_not_match_any: "herhangi biri ile eşleşmeyen"
28
+ does_not_match_all: "hiçbiri ile eşleşmeyen"
29
+ lt: "daha küçük"
30
+ lt_any: "herhangi birinden küçük"
31
+ lt_all: "hepsinden küçük"
32
+ lteq: "daha küçük veya eşit"
33
+ lteq_any: "daha küçük veya herhangi birine eşit"
34
+ lteq_all: "daha küçük veya hepsine eşit"
35
+ gt: "daha büyük "
36
+ gt_any: "herhangi birinden daha büyük"
37
+ gt_all: "hepsinden daha büyük"
38
+ gteq: "daha büyük veya eşit"
39
+ gteq_any: "daha büyük veya herhangi birine eşit"
40
+ gteq_all: "daha büyük veya hepsine eşit"
41
+ in: "içinde"
42
+ in_any: "herhangi birinde"
43
+ in_all: "hepsinde"
44
+ not_in: "içinde değil"
45
+ not_in_any: "herhangi birinde değil"
46
+ not_in_all: "hiçbirinde değil"
47
+ cont: "içeren"
48
+ cont_any: "herhangi birini içeren"
49
+ cont_all: "hepsini içeren"
50
+ not_cont: "içermeyen"
51
+ not_cont_any: "herhangi birini içermeyen"
52
+ not_cont_all: "hiçbirini birini içermeyen"
53
+ start: "ile başlayan"
54
+ start_any: "herhangi biriyle başlayan"
55
+ start_all: "hepsiyle başlayan"
56
+ not_start: "ile başlamayan"
57
+ not_start_any: "herhangi biriyle başlamayan"
58
+ not_start_all: "hiçbiriyle başlamayan"
59
+ end: "ile biten"
60
+ end_any: "herhangi biriyle biten"
61
+ end_all: "hepsi ile biten"
62
+ not_end: "ile bitmeyen"
63
+ not_end_any: "herhangi biriyle bitmeyen"
64
+ not_end_all: "hiçbiriyle bitmeyen"
65
+ 'true': "doğru"
66
+ 'false': "yanlış"
67
+ present: "mevcut"
68
+ blank: "boş"
69
+ 'null': "geçersiz"
70
+ not_null: "geçerli"
@@ -50,18 +50,18 @@ zh-CN:
50
50
  not_cont: "不包含"
51
51
  not_cont_any: "不包含任意一个值"
52
52
  not_cont_all: "不包含所有值"
53
- start: "以改值开始"
54
- start_any: "以任意一个值开始"
55
- start_all: "以所有值开始"
56
- not_start: "不以改值开始"
57
- not_start_any: "不以任意一个值开始"
58
- not_start_all: "不以所有值开始"
59
- end: "以改值结尾"
60
- end_any: "以任意一个值结尾"
61
- end_all: "以所有值结尾"
62
- not_end: "不以改值结尾"
63
- not_end_any: "不以任意一个值结尾"
64
- not_end_all: "不以所有值结尾"
53
+ start: "始于"
54
+ start_any: "始于任一值"
55
+ start_all: "始于任意值"
56
+ not_start: "非始于"
57
+ not_start_any: "非始于任一值"
58
+ not_start_all: "非始于任意值"
59
+ end: "止于"
60
+ end_any: "止于任一值"
61
+ end_all: "止于任意值"
62
+ not_end: "非止于"
63
+ not_end_any: "非止于任一值"
64
+ not_end_all: "非止于任意值"
65
65
  'true': "等于true"
66
66
  'false': "等于false"
67
67
  present: "有值"
@@ -5,7 +5,7 @@ module Ransack
5
5
 
6
6
  attr_reader :name, :ransacker_args
7
7
 
8
- delegate :blank?, :present?, :==, :to => :name
8
+ delegate :blank?, :present?, :to => :name
9
9
  delegate :engine, :to => :context
10
10
 
11
11
  def initialize(context, name = nil, ransacker_args = [])
@@ -30,7 +30,7 @@ module Ransack
30
30
 
31
31
  def type
32
32
  if ransacker
33
- return ransacker.type
33
+ ransacker.type
34
34
  else
35
35
  context.type_for(self)
36
36
  end
@@ -127,7 +127,6 @@ module Ransack
127
127
  alias :m= :combinator=
128
128
  alias :m :combinator
129
129
 
130
-
131
130
  # == build_attribute
132
131
  #
133
132
  # This method was originally called from Nodes::Grouping#new_condition
@@ -255,6 +254,13 @@ module Ransack
255
254
  end
256
255
  end
257
256
 
257
+ def attr_value_for_attribute(attr)
258
+ return attr.attr if ActiveRecord::Base.connection.adapter_name == "PostgreSQL"
259
+
260
+ predicate.case_insensitive ? attr.attr.lower : attr.attr
261
+ rescue
262
+ attr.attr
263
+ end
258
264
 
259
265
  def default_type
260
266
  predicate.type || (attributes.first && attributes.first.type)
@@ -49,11 +49,7 @@ module Ransack
49
49
  alias :c= :conditions=
50
50
 
51
51
  def [](key)
52
- if condition = conditions.detect { |c| c.key == key.to_s }
53
- condition
54
- else
55
- nil
56
- end
52
+ conditions.detect { |c| c.key == key.to_s }
57
53
  end
58
54
 
59
55
  def []=(key, value)
@@ -68,7 +64,6 @@ module Ransack
68
64
  def respond_to?(method_id)
69
65
  super or begin
70
66
  method_name = method_id.to_s
71
- writer = method_name.sub!(/\=$/, ''.freeze)
72
67
  attribute_method?(method_name) ? true : false
73
68
  end
74
69
  end
@@ -113,7 +108,7 @@ module Ransack
113
108
  alias :g= :groupings=
114
109
 
115
110
  def method_missing(method_id, *args)
116
- method_name = method_id.to_s
111
+ method_name = method_id.to_s.dup
117
112
  writer = method_name.sub!(/\=$/, ''.freeze)
118
113
  if attribute_method?(method_name)
119
114
  if writer
@@ -191,7 +186,7 @@ module Ransack
191
186
  end
192
187
 
193
188
  def strip_predicate_and_index(str)
194
- string = str.split(/\(/).first
189
+ string = str[/(.+?)\(/, 1] || str.dup
195
190
  Predicate.detect_and_strip_from_string!(string)
196
191
  string
197
192
  end
@@ -9,7 +9,7 @@ module Ransack
9
9
  class << self
10
10
  def extract(context, str)
11
11
  return unless str
12
- attr, direction = str.split(/\s+/,2)
12
+ attr, direction = str.split(/\s+/, 2)
13
13
  self.new(context).build(name: attr, dir: direction)
14
14
  end
15
15
  end
@@ -31,8 +31,8 @@ module Ransack
31
31
  end
32
32
 
33
33
  def name=(name)
34
- @name = name
35
- context.bind(self, name)
34
+ @name = context.ransackable_alias(name) || name
35
+ context.bind(self, @name)
36
36
  end
37
37
 
38
38
  def dir=(dir)