ransack 2.3.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +3 -0
- data/.github/SECURITY.md +12 -0
- data/.github/workflows/codeql.yml +72 -0
- data/.github/workflows/cronjob.yml +102 -0
- data/.github/workflows/deploy.yml +35 -0
- data/.github/workflows/rubocop.yml +20 -0
- data/.github/workflows/test-deploy.yml +29 -0
- data/.github/workflows/test.yml +128 -0
- data/.nojekyll +0 -0
- data/.rubocop.yml +47 -0
- data/CHANGELOG.md +228 -1
- data/CONTRIBUTING.md +47 -22
- data/Gemfile +24 -10
- data/README.md +49 -917
- data/bug_report_templates/test-ransack-scope-and-column-same-name.rb +78 -0
- data/bug_report_templates/test-ransacker-arel-present-predicate.rb +75 -0
- data/docs/.gitignore +19 -0
- data/docs/.nojekyll +0 -0
- data/docs/babel.config.js +3 -0
- data/docs/blog/2022-03-27-ransack-3.0.0.md +20 -0
- data/docs/docs/getting-started/_category_.json +4 -0
- data/docs/docs/getting-started/advanced-mode.md +46 -0
- data/docs/docs/getting-started/configuration.md +47 -0
- data/docs/docs/getting-started/search-matches.md +67 -0
- data/docs/docs/getting-started/simple-mode.md +288 -0
- data/docs/docs/getting-started/sorting.md +79 -0
- data/docs/docs/getting-started/using-predicates.md +282 -0
- data/docs/docs/going-further/_category_.json +4 -0
- data/docs/docs/going-further/acts-as-taggable-on.md +114 -0
- data/docs/docs/going-further/associations.md +70 -0
- data/docs/docs/going-further/custom-predicates.md +52 -0
- data/docs/docs/going-further/documentation.md +43 -0
- data/docs/docs/going-further/exporting-to-csv.md +49 -0
- data/docs/docs/going-further/external-guides.md +57 -0
- data/docs/docs/going-further/form-customisation.md +63 -0
- data/docs/docs/going-further/i18n.md +53 -0
- data/docs/docs/going-further/img/create_release.png +0 -0
- data/docs/docs/going-further/merging-searches.md +41 -0
- data/docs/docs/going-further/other-notes.md +428 -0
- data/docs/docs/going-further/polymorphic-search.md +40 -0
- data/docs/docs/going-further/ransackers.md +331 -0
- data/docs/docs/going-further/release_process.md +36 -0
- data/docs/docs/going-further/saving-queries.md +82 -0
- data/docs/docs/going-further/searching-postgres.md +57 -0
- data/docs/docs/going-further/wiki-contributors.md +82 -0
- data/docs/docs/intro.md +99 -0
- data/docs/docusaurus.config.js +120 -0
- data/docs/package.json +42 -0
- data/docs/sidebars.js +31 -0
- data/docs/src/components/HomepageFeatures/index.js +64 -0
- data/docs/src/components/HomepageFeatures/styles.module.css +11 -0
- data/docs/src/css/custom.css +39 -0
- data/docs/src/pages/index.module.css +23 -0
- data/docs/src/pages/markdown-page.md +7 -0
- data/docs/static/.nojekyll +0 -0
- data/docs/static/img/docusaurus.png +0 -0
- data/docs/static/img/favicon.ico +0 -0
- data/docs/static/img/logo.svg +1 -0
- data/docs/static/img/tutorial/docsVersionDropdown.png +0 -0
- data/docs/static/img/tutorial/localeDropdown.png +0 -0
- data/docs/static/img/undraw_docusaurus_mountain.svg +171 -0
- data/docs/static/img/undraw_docusaurus_react.svg +170 -0
- data/docs/static/img/undraw_docusaurus_tree.svg +40 -0
- data/docs/yarn.lock +8790 -0
- data/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +70 -0
- data/{polyamorous/lib/polyamorous/activerecord_6.0_ruby_2 → lib/polyamorous/activerecord_6.1_ruby_2}/join_dependency.rb +23 -12
- data/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +11 -0
- data/lib/polyamorous/activerecord_7.0_ruby_2/join_association.rb +1 -0
- data/lib/polyamorous/activerecord_7.0_ruby_2/join_dependency.rb +1 -0
- data/lib/polyamorous/activerecord_7.0_ruby_2/reflection.rb +1 -0
- data/lib/polyamorous/activerecord_7.1_ruby_2/join_association.rb +1 -0
- data/lib/polyamorous/activerecord_7.1_ruby_2/join_dependency.rb +1 -0
- data/lib/polyamorous/activerecord_7.1_ruby_2/reflection.rb +1 -0
- data/{polyamorous/lib → lib/polyamorous}/polyamorous.rb +3 -8
- data/lib/ransack/adapters/active_record/base.rb +83 -10
- data/lib/ransack/adapters/active_record/context.rb +59 -115
- data/lib/ransack/configuration.rb +53 -10
- data/lib/ransack/constants.rb +126 -7
- data/lib/ransack/context.rb +34 -5
- data/lib/ransack/helpers/form_builder.rb +11 -17
- data/lib/ransack/helpers/form_helper.rb +14 -5
- data/lib/ransack/helpers.rb +1 -1
- data/lib/ransack/locale/sk.yml +70 -0
- data/lib/ransack/locale/sv.yml +70 -0
- data/lib/ransack/nodes/attribute.rb +3 -3
- data/lib/ransack/nodes/condition.rb +87 -8
- data/lib/ransack/nodes/grouping.rb +4 -4
- data/lib/ransack/nodes/node.rb +1 -1
- data/lib/ransack/nodes/sort.rb +3 -3
- data/lib/ransack/nodes/value.rb +3 -3
- data/lib/ransack/predicate.rb +3 -2
- data/lib/ransack/ransacker.rb +1 -1
- data/lib/ransack/search.rb +15 -7
- data/lib/ransack/translate.rb +6 -6
- data/lib/ransack/version.rb +1 -1
- data/lib/ransack/visitor.rb +38 -2
- data/lib/ransack.rb +6 -10
- data/ransack.gemspec +9 -24
- data/spec/blueprints/articles.rb +1 -1
- data/spec/blueprints/comments.rb +1 -1
- data/spec/blueprints/notes.rb +1 -1
- data/spec/blueprints/tags.rb +1 -1
- data/spec/console.rb +5 -5
- data/spec/helpers/polyamorous_helper.rb +2 -17
- data/spec/helpers/ransack_helper.rb +1 -1
- data/spec/polyamorous/activerecord_compatibility_spec.rb +15 -0
- data/spec/{ransack → polyamorous}/join_association_spec.rb +3 -1
- data/spec/{ransack → polyamorous}/join_dependency_spec.rb +0 -16
- data/spec/ransack/adapters/active_record/base_spec.rb +109 -16
- data/spec/ransack/adapters/active_record/context_spec.rb +19 -18
- data/spec/ransack/configuration_spec.rb +33 -9
- data/spec/ransack/helpers/form_builder_spec.rb +8 -8
- data/spec/ransack/helpers/form_helper_spec.rb +109 -20
- data/spec/ransack/nodes/condition_spec.rb +37 -0
- data/spec/ransack/nodes/grouping_spec.rb +2 -2
- data/spec/ransack/nodes/value_spec.rb +115 -0
- data/spec/ransack/predicate_spec.rb +75 -2
- data/spec/ransack/search_spec.rb +239 -38
- data/spec/ransack/translate_spec.rb +1 -1
- data/spec/spec_helper.rb +9 -5
- data/spec/support/schema.rb +83 -12
- metadata +105 -195
- data/.travis.yml +0 -49
- data/lib/ransack/adapters/active_record/ransack/constants.rb +0 -116
- data/lib/ransack/adapters/active_record/ransack/context.rb +0 -60
- data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +0 -61
- data/lib/ransack/adapters/active_record/ransack/translate.rb +0 -8
- data/lib/ransack/adapters/active_record/ransack/visitor.rb +0 -47
- data/lib/ransack/adapters.rb +0 -64
- data/lib/ransack/nodes.rb +0 -8
- data/polyamorous/lib/polyamorous/activerecord_5.0_ruby_2/join_association.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_5.0_ruby_2/join_dependency.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_5.1_ruby_2/join_association.rb +0 -31
- data/polyamorous/lib/polyamorous/activerecord_5.1_ruby_2/join_dependency.rb +0 -112
- data/polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_association.rb +0 -31
- data/polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_dependency.rb +0 -112
- data/polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/reflection.rb +0 -12
- data/polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/join_association.rb +0 -22
- data/polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/join_dependency.rb +0 -81
- data/polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/reflection.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +0 -2
- data/polyamorous/lib/polyamorous/version.rb +0 -3
- data/polyamorous/polyamorous.gemspec +0 -35
- /data/{logo → docs/static/logo}/ransack-h.png +0 -0
- /data/{logo → docs/static/logo}/ransack-h.svg +0 -0
- /data/{logo → docs/static/logo}/ransack-v.png +0 -0
- /data/{logo → docs/static/logo}/ransack-v.svg +0 -0
- /data/{logo → docs/static/logo}/ransack.png +0 -0
- /data/{logo → docs/static/logo}/ransack.svg +0 -0
- /data/{polyamorous/lib → lib}/polyamorous/join.rb +0 -0
- /data/{polyamorous/lib → lib}/polyamorous/swapping_reflection_class.rb +0 -0
- /data/{polyamorous/lib → lib}/polyamorous/tree_node.rb +0 -0
- /data/lib/ransack/{adapters/active_record.rb → active_record.rb} +0 -0
- /data/spec/{ransack → polyamorous}/join_spec.rb +0 -0
metadata
CHANGED
@@ -1,60 +1,47 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ransack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernie Miller
|
8
8
|
- Ryan Bigg
|
9
9
|
- Jon Atack
|
10
10
|
- Sean Carroll
|
11
|
-
|
11
|
+
- David Rodríguez
|
12
|
+
autorequire:
|
12
13
|
bindir: bin
|
13
14
|
cert_chain: []
|
14
|
-
date:
|
15
|
+
date: 2023-02-09 00:00:00.000000000 Z
|
15
16
|
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
17
|
-
name: actionpack
|
18
|
-
requirement: !ruby/object:Gem::Requirement
|
19
|
-
requirements:
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '5.0'
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '5.0'
|
30
17
|
- !ruby/object:Gem::Dependency
|
31
18
|
name: activerecord
|
32
19
|
requirement: !ruby/object:Gem::Requirement
|
33
20
|
requirements:
|
34
21
|
- - ">="
|
35
22
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
23
|
+
version: 6.1.5
|
37
24
|
type: :runtime
|
38
25
|
prerelease: false
|
39
26
|
version_requirements: !ruby/object:Gem::Requirement
|
40
27
|
requirements:
|
41
28
|
- - ">="
|
42
29
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
30
|
+
version: 6.1.5
|
44
31
|
- !ruby/object:Gem::Dependency
|
45
32
|
name: activesupport
|
46
33
|
requirement: !ruby/object:Gem::Requirement
|
47
34
|
requirements:
|
48
35
|
- - ">="
|
49
36
|
- !ruby/object:Gem::Version
|
50
|
-
version:
|
37
|
+
version: 6.1.5
|
51
38
|
type: :runtime
|
52
39
|
prerelease: false
|
53
40
|
version_requirements: !ruby/object:Gem::Requirement
|
54
41
|
requirements:
|
55
42
|
- - ">="
|
56
43
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
44
|
+
version: 6.1.5
|
58
45
|
- !ruby/object:Gem::Dependency
|
59
46
|
name: i18n
|
60
47
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,132 +56,6 @@ dependencies:
|
|
69
56
|
- - ">="
|
70
57
|
- !ruby/object:Gem::Version
|
71
58
|
version: '0'
|
72
|
-
- !ruby/object:Gem::Dependency
|
73
|
-
name: polyamorous
|
74
|
-
requirement: !ruby/object:Gem::Requirement
|
75
|
-
requirements:
|
76
|
-
- - '='
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: 2.3.0
|
79
|
-
type: :runtime
|
80
|
-
prerelease: false
|
81
|
-
version_requirements: !ruby/object:Gem::Requirement
|
82
|
-
requirements:
|
83
|
-
- - '='
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: 2.3.0
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
|
-
name: rspec
|
88
|
-
requirement: !ruby/object:Gem::Requirement
|
89
|
-
requirements:
|
90
|
-
- - "~>"
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: '3'
|
93
|
-
type: :development
|
94
|
-
prerelease: false
|
95
|
-
version_requirements: !ruby/object:Gem::Requirement
|
96
|
-
requirements:
|
97
|
-
- - "~>"
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: '3'
|
100
|
-
- !ruby/object:Gem::Dependency
|
101
|
-
name: machinist
|
102
|
-
requirement: !ruby/object:Gem::Requirement
|
103
|
-
requirements:
|
104
|
-
- - "~>"
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version: 1.0.6
|
107
|
-
type: :development
|
108
|
-
prerelease: false
|
109
|
-
version_requirements: !ruby/object:Gem::Requirement
|
110
|
-
requirements:
|
111
|
-
- - "~>"
|
112
|
-
- !ruby/object:Gem::Version
|
113
|
-
version: 1.0.6
|
114
|
-
- !ruby/object:Gem::Dependency
|
115
|
-
name: faker
|
116
|
-
requirement: !ruby/object:Gem::Requirement
|
117
|
-
requirements:
|
118
|
-
- - "~>"
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
version: 0.9.5
|
121
|
-
type: :development
|
122
|
-
prerelease: false
|
123
|
-
version_requirements: !ruby/object:Gem::Requirement
|
124
|
-
requirements:
|
125
|
-
- - "~>"
|
126
|
-
- !ruby/object:Gem::Version
|
127
|
-
version: 0.9.5
|
128
|
-
- !ruby/object:Gem::Dependency
|
129
|
-
name: sqlite3
|
130
|
-
requirement: !ruby/object:Gem::Requirement
|
131
|
-
requirements:
|
132
|
-
- - "~>"
|
133
|
-
- !ruby/object:Gem::Version
|
134
|
-
version: 1.4.1
|
135
|
-
type: :development
|
136
|
-
prerelease: false
|
137
|
-
version_requirements: !ruby/object:Gem::Requirement
|
138
|
-
requirements:
|
139
|
-
- - "~>"
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
version: 1.4.1
|
142
|
-
- !ruby/object:Gem::Dependency
|
143
|
-
name: pg
|
144
|
-
requirement: !ruby/object:Gem::Requirement
|
145
|
-
requirements:
|
146
|
-
- - "~>"
|
147
|
-
- !ruby/object:Gem::Version
|
148
|
-
version: '0.21'
|
149
|
-
type: :development
|
150
|
-
prerelease: false
|
151
|
-
version_requirements: !ruby/object:Gem::Requirement
|
152
|
-
requirements:
|
153
|
-
- - "~>"
|
154
|
-
- !ruby/object:Gem::Version
|
155
|
-
version: '0.21'
|
156
|
-
- !ruby/object:Gem::Dependency
|
157
|
-
name: mysql2
|
158
|
-
requirement: !ruby/object:Gem::Requirement
|
159
|
-
requirements:
|
160
|
-
- - '='
|
161
|
-
- !ruby/object:Gem::Version
|
162
|
-
version: 0.3.20
|
163
|
-
type: :development
|
164
|
-
prerelease: false
|
165
|
-
version_requirements: !ruby/object:Gem::Requirement
|
166
|
-
requirements:
|
167
|
-
- - '='
|
168
|
-
- !ruby/object:Gem::Version
|
169
|
-
version: 0.3.20
|
170
|
-
- !ruby/object:Gem::Dependency
|
171
|
-
name: pry
|
172
|
-
requirement: !ruby/object:Gem::Requirement
|
173
|
-
requirements:
|
174
|
-
- - '='
|
175
|
-
- !ruby/object:Gem::Version
|
176
|
-
version: '0.10'
|
177
|
-
type: :development
|
178
|
-
prerelease: false
|
179
|
-
version_requirements: !ruby/object:Gem::Requirement
|
180
|
-
requirements:
|
181
|
-
- - '='
|
182
|
-
- !ruby/object:Gem::Version
|
183
|
-
version: '0.10'
|
184
|
-
- !ruby/object:Gem::Dependency
|
185
|
-
name: byebug
|
186
|
-
requirement: !ruby/object:Gem::Requirement
|
187
|
-
requirements:
|
188
|
-
- - ">="
|
189
|
-
- !ruby/object:Gem::Version
|
190
|
-
version: '0'
|
191
|
-
type: :development
|
192
|
-
prerelease: false
|
193
|
-
version_requirements: !ruby/object:Gem::Requirement
|
194
|
-
requirements:
|
195
|
-
- - ">="
|
196
|
-
- !ruby/object:Gem::Version
|
197
|
-
version: '0'
|
198
59
|
description: Ransack is the successor to the MetaSearch gem. It improves and expands
|
199
60
|
upon MetaSearch's functionality, but does not have a 100%-compatible API.
|
200
61
|
email:
|
@@ -206,24 +67,96 @@ executables: []
|
|
206
67
|
extensions: []
|
207
68
|
extra_rdoc_files: []
|
208
69
|
files:
|
70
|
+
- ".github/FUNDING.yml"
|
71
|
+
- ".github/SECURITY.md"
|
72
|
+
- ".github/workflows/codeql.yml"
|
73
|
+
- ".github/workflows/cronjob.yml"
|
74
|
+
- ".github/workflows/deploy.yml"
|
75
|
+
- ".github/workflows/rubocop.yml"
|
76
|
+
- ".github/workflows/test-deploy.yml"
|
77
|
+
- ".github/workflows/test.yml"
|
209
78
|
- ".gitignore"
|
210
|
-
- ".
|
79
|
+
- ".nojekyll"
|
80
|
+
- ".rubocop.yml"
|
211
81
|
- CHANGELOG.md
|
212
82
|
- CONTRIBUTING.md
|
213
83
|
- Gemfile
|
214
84
|
- LICENSE
|
215
85
|
- README.md
|
216
86
|
- Rakefile
|
87
|
+
- bug_report_templates/test-ransack-scope-and-column-same-name.rb
|
88
|
+
- bug_report_templates/test-ransacker-arel-present-predicate.rb
|
89
|
+
- docs/.gitignore
|
90
|
+
- docs/.nojekyll
|
91
|
+
- docs/babel.config.js
|
92
|
+
- docs/blog/2022-03-27-ransack-3.0.0.md
|
93
|
+
- docs/docs/getting-started/_category_.json
|
94
|
+
- docs/docs/getting-started/advanced-mode.md
|
95
|
+
- docs/docs/getting-started/configuration.md
|
96
|
+
- docs/docs/getting-started/search-matches.md
|
97
|
+
- docs/docs/getting-started/simple-mode.md
|
98
|
+
- docs/docs/getting-started/sorting.md
|
99
|
+
- docs/docs/getting-started/using-predicates.md
|
100
|
+
- docs/docs/going-further/_category_.json
|
101
|
+
- docs/docs/going-further/acts-as-taggable-on.md
|
102
|
+
- docs/docs/going-further/associations.md
|
103
|
+
- docs/docs/going-further/custom-predicates.md
|
104
|
+
- docs/docs/going-further/documentation.md
|
105
|
+
- docs/docs/going-further/exporting-to-csv.md
|
106
|
+
- docs/docs/going-further/external-guides.md
|
107
|
+
- docs/docs/going-further/form-customisation.md
|
108
|
+
- docs/docs/going-further/i18n.md
|
109
|
+
- docs/docs/going-further/img/create_release.png
|
110
|
+
- docs/docs/going-further/merging-searches.md
|
111
|
+
- docs/docs/going-further/other-notes.md
|
112
|
+
- docs/docs/going-further/polymorphic-search.md
|
113
|
+
- docs/docs/going-further/ransackers.md
|
114
|
+
- docs/docs/going-further/release_process.md
|
115
|
+
- docs/docs/going-further/saving-queries.md
|
116
|
+
- docs/docs/going-further/searching-postgres.md
|
117
|
+
- docs/docs/going-further/wiki-contributors.md
|
118
|
+
- docs/docs/intro.md
|
119
|
+
- docs/docusaurus.config.js
|
120
|
+
- docs/package.json
|
121
|
+
- docs/sidebars.js
|
122
|
+
- docs/src/components/HomepageFeatures/index.js
|
123
|
+
- docs/src/components/HomepageFeatures/styles.module.css
|
124
|
+
- docs/src/css/custom.css
|
125
|
+
- docs/src/pages/index.module.css
|
126
|
+
- docs/src/pages/markdown-page.md
|
127
|
+
- docs/static/.nojekyll
|
128
|
+
- docs/static/img/docusaurus.png
|
129
|
+
- docs/static/img/favicon.ico
|
130
|
+
- docs/static/img/logo.svg
|
131
|
+
- docs/static/img/tutorial/docsVersionDropdown.png
|
132
|
+
- docs/static/img/tutorial/localeDropdown.png
|
133
|
+
- docs/static/img/undraw_docusaurus_mountain.svg
|
134
|
+
- docs/static/img/undraw_docusaurus_react.svg
|
135
|
+
- docs/static/img/undraw_docusaurus_tree.svg
|
136
|
+
- docs/static/logo/ransack-h.png
|
137
|
+
- docs/static/logo/ransack-h.svg
|
138
|
+
- docs/static/logo/ransack-v.png
|
139
|
+
- docs/static/logo/ransack-v.svg
|
140
|
+
- docs/static/logo/ransack.png
|
141
|
+
- docs/static/logo/ransack.svg
|
142
|
+
- docs/yarn.lock
|
143
|
+
- lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb
|
144
|
+
- lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb
|
145
|
+
- lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb
|
146
|
+
- lib/polyamorous/activerecord_7.0_ruby_2/join_association.rb
|
147
|
+
- lib/polyamorous/activerecord_7.0_ruby_2/join_dependency.rb
|
148
|
+
- lib/polyamorous/activerecord_7.0_ruby_2/reflection.rb
|
149
|
+
- lib/polyamorous/activerecord_7.1_ruby_2/join_association.rb
|
150
|
+
- lib/polyamorous/activerecord_7.1_ruby_2/join_dependency.rb
|
151
|
+
- lib/polyamorous/activerecord_7.1_ruby_2/reflection.rb
|
152
|
+
- lib/polyamorous/join.rb
|
153
|
+
- lib/polyamorous/polyamorous.rb
|
154
|
+
- lib/polyamorous/swapping_reflection_class.rb
|
155
|
+
- lib/polyamorous/tree_node.rb
|
217
156
|
- lib/ransack.rb
|
218
|
-
- lib/ransack/
|
219
|
-
- lib/ransack/adapters/active_record.rb
|
157
|
+
- lib/ransack/active_record.rb
|
220
158
|
- lib/ransack/adapters/active_record/base.rb
|
221
159
|
- lib/ransack/adapters/active_record/context.rb
|
222
|
-
- lib/ransack/adapters/active_record/ransack/constants.rb
|
223
|
-
- lib/ransack/adapters/active_record/ransack/context.rb
|
224
|
-
- lib/ransack/adapters/active_record/ransack/nodes/condition.rb
|
225
|
-
- lib/ransack/adapters/active_record/ransack/translate.rb
|
226
|
-
- lib/ransack/adapters/active_record/ransack/visitor.rb
|
227
160
|
- lib/ransack/configuration.rb
|
228
161
|
- lib/ransack/constants.rb
|
229
162
|
- lib/ransack/context.rb
|
@@ -251,11 +184,12 @@ files:
|
|
251
184
|
- lib/ransack/locale/pt-BR.yml
|
252
185
|
- lib/ransack/locale/ro.yml
|
253
186
|
- lib/ransack/locale/ru.yml
|
187
|
+
- lib/ransack/locale/sk.yml
|
188
|
+
- lib/ransack/locale/sv.yml
|
254
189
|
- lib/ransack/locale/tr.yml
|
255
190
|
- lib/ransack/locale/zh-CN.yml
|
256
191
|
- lib/ransack/locale/zh-TW.yml
|
257
192
|
- lib/ransack/naming.rb
|
258
|
-
- lib/ransack/nodes.rb
|
259
193
|
- lib/ransack/nodes/attribute.rb
|
260
194
|
- lib/ransack/nodes/bindable.rb
|
261
195
|
- lib/ransack/nodes/condition.rb
|
@@ -269,34 +203,6 @@ files:
|
|
269
203
|
- lib/ransack/translate.rb
|
270
204
|
- lib/ransack/version.rb
|
271
205
|
- lib/ransack/visitor.rb
|
272
|
-
- logo/ransack-h.png
|
273
|
-
- logo/ransack-h.svg
|
274
|
-
- logo/ransack-v.png
|
275
|
-
- logo/ransack-v.svg
|
276
|
-
- logo/ransack.png
|
277
|
-
- logo/ransack.svg
|
278
|
-
- polyamorous/lib/polyamorous.rb
|
279
|
-
- polyamorous/lib/polyamorous/activerecord_5.0_ruby_2/join_association.rb
|
280
|
-
- polyamorous/lib/polyamorous/activerecord_5.0_ruby_2/join_dependency.rb
|
281
|
-
- polyamorous/lib/polyamorous/activerecord_5.1_ruby_2/join_association.rb
|
282
|
-
- polyamorous/lib/polyamorous/activerecord_5.1_ruby_2/join_dependency.rb
|
283
|
-
- polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_association.rb
|
284
|
-
- polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_dependency.rb
|
285
|
-
- polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/reflection.rb
|
286
|
-
- polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/join_association.rb
|
287
|
-
- polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/join_dependency.rb
|
288
|
-
- polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/reflection.rb
|
289
|
-
- polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb
|
290
|
-
- polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb
|
291
|
-
- polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb
|
292
|
-
- polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb
|
293
|
-
- polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb
|
294
|
-
- polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb
|
295
|
-
- polyamorous/lib/polyamorous/join.rb
|
296
|
-
- polyamorous/lib/polyamorous/swapping_reflection_class.rb
|
297
|
-
- polyamorous/lib/polyamorous/tree_node.rb
|
298
|
-
- polyamorous/lib/polyamorous/version.rb
|
299
|
-
- polyamorous/polyamorous.gemspec
|
300
206
|
- ransack.gemspec
|
301
207
|
- spec/blueprints/articles.rb
|
302
208
|
- spec/blueprints/comments.rb
|
@@ -306,16 +212,18 @@ files:
|
|
306
212
|
- spec/console.rb
|
307
213
|
- spec/helpers/polyamorous_helper.rb
|
308
214
|
- spec/helpers/ransack_helper.rb
|
215
|
+
- spec/polyamorous/activerecord_compatibility_spec.rb
|
216
|
+
- spec/polyamorous/join_association_spec.rb
|
217
|
+
- spec/polyamorous/join_dependency_spec.rb
|
218
|
+
- spec/polyamorous/join_spec.rb
|
309
219
|
- spec/ransack/adapters/active_record/base_spec.rb
|
310
220
|
- spec/ransack/adapters/active_record/context_spec.rb
|
311
221
|
- spec/ransack/configuration_spec.rb
|
312
222
|
- spec/ransack/helpers/form_builder_spec.rb
|
313
223
|
- spec/ransack/helpers/form_helper_spec.rb
|
314
|
-
- spec/ransack/join_association_spec.rb
|
315
|
-
- spec/ransack/join_dependency_spec.rb
|
316
|
-
- spec/ransack/join_spec.rb
|
317
224
|
- spec/ransack/nodes/condition_spec.rb
|
318
225
|
- spec/ransack/nodes/grouping_spec.rb
|
226
|
+
- spec/ransack/nodes/value_spec.rb
|
319
227
|
- spec/ransack/predicate_spec.rb
|
320
228
|
- spec/ransack/search_spec.rb
|
321
229
|
- spec/ransack/translate_spec.rb
|
@@ -326,7 +234,7 @@ homepage: https://github.com/activerecord-hackery/ransack
|
|
326
234
|
licenses:
|
327
235
|
- MIT
|
328
236
|
metadata: {}
|
329
|
-
post_install_message:
|
237
|
+
post_install_message:
|
330
238
|
rdoc_options: []
|
331
239
|
require_paths:
|
332
240
|
- lib
|
@@ -334,17 +242,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
334
242
|
requirements:
|
335
243
|
- - ">="
|
336
244
|
- !ruby/object:Gem::Version
|
337
|
-
version: '
|
245
|
+
version: '2.7'
|
338
246
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
339
247
|
requirements:
|
340
248
|
- - ">="
|
341
249
|
- !ruby/object:Gem::Version
|
342
250
|
version: '0'
|
343
251
|
requirements: []
|
344
|
-
rubygems_version: 3.
|
345
|
-
signing_key:
|
252
|
+
rubygems_version: 3.4.6
|
253
|
+
signing_key:
|
346
254
|
specification_version: 4
|
347
|
-
summary: Object-based searching for Active Record
|
255
|
+
summary: Object-based searching for Active Record.
|
348
256
|
test_files:
|
349
257
|
- spec/blueprints/articles.rb
|
350
258
|
- spec/blueprints/comments.rb
|
@@ -354,16 +262,18 @@ test_files:
|
|
354
262
|
- spec/console.rb
|
355
263
|
- spec/helpers/polyamorous_helper.rb
|
356
264
|
- spec/helpers/ransack_helper.rb
|
265
|
+
- spec/polyamorous/activerecord_compatibility_spec.rb
|
266
|
+
- spec/polyamorous/join_association_spec.rb
|
267
|
+
- spec/polyamorous/join_dependency_spec.rb
|
268
|
+
- spec/polyamorous/join_spec.rb
|
357
269
|
- spec/ransack/adapters/active_record/base_spec.rb
|
358
270
|
- spec/ransack/adapters/active_record/context_spec.rb
|
359
271
|
- spec/ransack/configuration_spec.rb
|
360
272
|
- spec/ransack/helpers/form_builder_spec.rb
|
361
273
|
- spec/ransack/helpers/form_helper_spec.rb
|
362
|
-
- spec/ransack/join_association_spec.rb
|
363
|
-
- spec/ransack/join_dependency_spec.rb
|
364
|
-
- spec/ransack/join_spec.rb
|
365
274
|
- spec/ransack/nodes/condition_spec.rb
|
366
275
|
- spec/ransack/nodes/grouping_spec.rb
|
276
|
+
- spec/ransack/nodes/value_spec.rb
|
367
277
|
- spec/ransack/predicate_spec.rb
|
368
278
|
- spec/ransack/search_spec.rb
|
369
279
|
- spec/ransack/translate_spec.rb
|
data/.travis.yml
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
sudo: false
|
4
|
-
|
5
|
-
rvm:
|
6
|
-
- 2.6.0
|
7
|
-
|
8
|
-
services:
|
9
|
-
- mysql
|
10
|
-
|
11
|
-
env:
|
12
|
-
- RAILS=6-0-stable DB=sqlite3
|
13
|
-
- RAILS=6-0-stable DB=mysql
|
14
|
-
- RAILS=6-0-stable DB=postgres
|
15
|
-
|
16
|
-
- RAILS=v6.0.0 DB=sqlite3
|
17
|
-
- RAILS=v6.0.0 DB=mysql
|
18
|
-
- RAILS=v6.0.0 DB=postgres
|
19
|
-
|
20
|
-
- RAILS=5-2-stable DB=sqlite3
|
21
|
-
- RAILS=5-2-stable DB=mysql
|
22
|
-
- RAILS=5-2-stable DB=postgres
|
23
|
-
|
24
|
-
- RAILS=v5.2.1 DB=sqlite3
|
25
|
-
- RAILS=v5.2.1 DB=mysql
|
26
|
-
- RAILS=v5.2.1 DB=postgres
|
27
|
-
|
28
|
-
- RAILS=v5.2.0 DB=sqlite3
|
29
|
-
- RAILS=v5.2.0 DB=mysql
|
30
|
-
- RAILS=v5.2.0 DB=postgres
|
31
|
-
|
32
|
-
- RAILS=5-1-stable DB=sqlite3
|
33
|
-
- RAILS=5-1-stable DB=mysql
|
34
|
-
- RAILS=5-1-stable DB=postgres
|
35
|
-
|
36
|
-
matrix:
|
37
|
-
allow_failures:
|
38
|
-
- env: RAILS=5-2-stable DB=sqlite3
|
39
|
-
- env: RAILS=5-2-stable DB=mysql
|
40
|
-
- env: RAILS=5-2-stable DB=postgres
|
41
|
-
before_script:
|
42
|
-
- mysql -e 'create database ransack collate utf8_general_ci;'
|
43
|
-
- mysql -e 'use ransack;show variables like "%character%";show variables like "%collation%";'
|
44
|
-
- psql -c 'create database ransack;' -U postgres
|
45
|
-
|
46
|
-
addons:
|
47
|
-
code_climate:
|
48
|
-
repo_token: 8b701c4364d51a0217105e08c06922d600cec3d9e60d546a89e3ddfe46e0664e
|
49
|
-
postgresql: "9.6"
|
@@ -1,116 +0,0 @@
|
|
1
|
-
module Ransack
|
2
|
-
module Constants
|
3
|
-
DISTINCT = 'DISTINCT '.freeze
|
4
|
-
|
5
|
-
DERIVED_PREDICATES = [
|
6
|
-
[CONT, {
|
7
|
-
arel_predicate: 'matches'.freeze,
|
8
|
-
formatter: proc { |v| "%#{escape_wildcards(v)}%" }
|
9
|
-
}
|
10
|
-
],
|
11
|
-
['not_cont'.freeze, {
|
12
|
-
arel_predicate: 'does_not_match'.freeze,
|
13
|
-
formatter: proc { |v| "%#{escape_wildcards(v)}%" }
|
14
|
-
}
|
15
|
-
],
|
16
|
-
['start'.freeze, {
|
17
|
-
arel_predicate: 'matches'.freeze,
|
18
|
-
formatter: proc { |v| "#{escape_wildcards(v)}%" }
|
19
|
-
}
|
20
|
-
],
|
21
|
-
['not_start'.freeze, {
|
22
|
-
arel_predicate: 'does_not_match'.freeze,
|
23
|
-
formatter: proc { |v| "#{escape_wildcards(v)}%" }
|
24
|
-
}
|
25
|
-
],
|
26
|
-
['end'.freeze, {
|
27
|
-
arel_predicate: 'matches'.freeze,
|
28
|
-
formatter: proc { |v| "%#{escape_wildcards(v)}" }
|
29
|
-
}
|
30
|
-
],
|
31
|
-
['not_end'.freeze, {
|
32
|
-
arel_predicate: 'does_not_match'.freeze,
|
33
|
-
formatter: proc { |v| "%#{escape_wildcards(v)}" }
|
34
|
-
}
|
35
|
-
],
|
36
|
-
['true'.freeze, {
|
37
|
-
arel_predicate: proc { |v| v ? EQ : NOT_EQ },
|
38
|
-
compounds: false,
|
39
|
-
type: :boolean,
|
40
|
-
validator: proc { |v| BOOLEAN_VALUES.include?(v) },
|
41
|
-
formatter: proc { |v| true }
|
42
|
-
}
|
43
|
-
],
|
44
|
-
['not_true'.freeze, {
|
45
|
-
arel_predicate: proc { |v| v ? NOT_EQ : EQ },
|
46
|
-
compounds: false,
|
47
|
-
type: :boolean,
|
48
|
-
validator: proc { |v| BOOLEAN_VALUES.include?(v) },
|
49
|
-
formatter: proc { |v| true }
|
50
|
-
}
|
51
|
-
],
|
52
|
-
['false'.freeze, {
|
53
|
-
arel_predicate: proc { |v| v ? EQ : NOT_EQ },
|
54
|
-
compounds: false,
|
55
|
-
type: :boolean,
|
56
|
-
validator: proc { |v| BOOLEAN_VALUES.include?(v) },
|
57
|
-
formatter: proc { |v| false }
|
58
|
-
}
|
59
|
-
],
|
60
|
-
['not_false'.freeze, {
|
61
|
-
arel_predicate: proc { |v| v ? NOT_EQ : EQ },
|
62
|
-
compounds: false,
|
63
|
-
type: :boolean,
|
64
|
-
validator: proc { |v| BOOLEAN_VALUES.include?(v) },
|
65
|
-
formatter: proc { |v| false }
|
66
|
-
}
|
67
|
-
],
|
68
|
-
['present'.freeze, {
|
69
|
-
arel_predicate: proc { |v| v ? NOT_EQ_ALL : EQ_ANY },
|
70
|
-
compounds: false,
|
71
|
-
type: :boolean,
|
72
|
-
validator: proc { |v| BOOLEAN_VALUES.include?(v) },
|
73
|
-
formatter: proc { |v| [nil, ''.freeze].freeze }
|
74
|
-
}
|
75
|
-
],
|
76
|
-
['blank'.freeze, {
|
77
|
-
arel_predicate: proc { |v| v ? EQ_ANY : NOT_EQ_ALL },
|
78
|
-
compounds: false,
|
79
|
-
type: :boolean,
|
80
|
-
validator: proc { |v| BOOLEAN_VALUES.include?(v) },
|
81
|
-
formatter: proc { |v| [nil, ''.freeze].freeze }
|
82
|
-
}
|
83
|
-
],
|
84
|
-
['null'.freeze, {
|
85
|
-
arel_predicate: proc { |v| v ? EQ : NOT_EQ },
|
86
|
-
compounds: false,
|
87
|
-
type: :boolean,
|
88
|
-
validator: proc { |v| BOOLEAN_VALUES.include?(v)},
|
89
|
-
formatter: proc { |v| nil }
|
90
|
-
}
|
91
|
-
],
|
92
|
-
['not_null'.freeze, {
|
93
|
-
arel_predicate: proc { |v| v ? NOT_EQ : EQ },
|
94
|
-
compounds: false,
|
95
|
-
type: :boolean,
|
96
|
-
validator: proc { |v| BOOLEAN_VALUES.include?(v) },
|
97
|
-
formatter: proc { |v| nil } }
|
98
|
-
]
|
99
|
-
].freeze
|
100
|
-
|
101
|
-
module_function
|
102
|
-
# replace % \ to \% \\
|
103
|
-
def escape_wildcards(unescaped)
|
104
|
-
case ActiveRecord::Base.connection.adapter_name
|
105
|
-
when "Mysql2".freeze
|
106
|
-
# Necessary for MySQL
|
107
|
-
unescaped.to_s.gsub(/([\\%_])/, '\\\\\\1')
|
108
|
-
when "PostgreSQL".freeze
|
109
|
-
# Necessary for PostgreSQL
|
110
|
-
unescaped.to_s.gsub(/([\\%_.])/, '\\\\\\1')
|
111
|
-
else
|
112
|
-
unescaped
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
@@ -1,60 +0,0 @@
|
|
1
|
-
require 'ransack/visitor'
|
2
|
-
|
3
|
-
module Ransack
|
4
|
-
class Context
|
5
|
-
attr_reader :arel_visitor
|
6
|
-
|
7
|
-
class << self
|
8
|
-
|
9
|
-
def for_class(klass, options = {})
|
10
|
-
if klass < ActiveRecord::Base
|
11
|
-
Adapters::ActiveRecord::Context.new(klass, options)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def for_object(object, options = {})
|
16
|
-
case object
|
17
|
-
when ActiveRecord::Relation
|
18
|
-
Adapters::ActiveRecord::Context.new(object.klass, options)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end # << self
|
23
|
-
|
24
|
-
def initialize(object, options = {})
|
25
|
-
@object = relation_for(object)
|
26
|
-
@klass = @object.klass
|
27
|
-
@join_dependency = join_dependency(@object)
|
28
|
-
@join_type = options[:join_type] || Polyamorous::OuterJoin
|
29
|
-
@search_key = options[:search_key] || Ransack.options[:search_key]
|
30
|
-
@associations_pot = {}
|
31
|
-
@lock_associations = []
|
32
|
-
|
33
|
-
if ::ActiveRecord::VERSION::STRING >= Constants::RAILS_5_2
|
34
|
-
@base = @join_dependency.instance_variable_get(:@join_root)
|
35
|
-
else
|
36
|
-
@base = @join_dependency.join_root
|
37
|
-
@engine = @base.base_klass.arel_engine
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def bind_pair_for(key)
|
42
|
-
@bind_pairs ||= {}
|
43
|
-
|
44
|
-
@bind_pairs[key] ||= begin
|
45
|
-
parent, attr_name = get_parent_and_attribute_name(key.to_s)
|
46
|
-
[parent, attr_name] if parent && attr_name
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def klassify(obj)
|
51
|
-
if Class === obj && ::ActiveRecord::Base > obj
|
52
|
-
obj
|
53
|
-
elsif obj.respond_to? :klass
|
54
|
-
obj.klass
|
55
|
-
else
|
56
|
-
raise ArgumentError, "Don't know how to klassify #{obj.inspect}"
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|