ransack 2.3.2 → 2.5.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/cronjob.yml +102 -0
- data/.github/workflows/rubocop.yml +20 -0
- data/.github/workflows/test.yml +163 -0
- data/.rubocop.yml +44 -0
- data/CHANGELOG.md +28 -1
- data/CONTRIBUTING.md +16 -11
- data/Gemfile +5 -3
- data/README.md +167 -30
- data/bug_report_templates/test-ransack-scope-and-column-same-name.rb +78 -0
- data/bug_report_templates/test-ransacker-arel-present-predicate.rb +71 -0
- data/docs/img/create_release.png +0 -0
- data/docs/release_process.md +17 -0
- data/{polyamorous/lib → lib}/polyamorous/activerecord_5.2_ruby_2/join_association.rb +4 -0
- data/{polyamorous/lib → lib}/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb +0 -0
- data/lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb +11 -0
- data/{polyamorous/lib → lib}/polyamorous/activerecord_6.0_ruby_2/join_association.rb +0 -1
- data/{polyamorous/lib → lib}/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb +0 -1
- data/{polyamorous/lib → lib}/polyamorous/activerecord_6.0_ruby_2/reflection.rb +0 -1
- data/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +74 -0
- data/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +93 -0
- data/{polyamorous/lib → lib}/polyamorous/activerecord_6.1_ruby_2/reflection.rb +0 -1
- 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/{polyamorous/lib → lib}/polyamorous/join.rb +0 -0
- data/{polyamorous/lib → lib/polyamorous}/polyamorous.rb +1 -1
- data/{polyamorous/lib → lib}/polyamorous/swapping_reflection_class.rb +0 -0
- data/{polyamorous/lib → lib}/polyamorous/tree_node.rb +0 -0
- data/lib/polyamorous.rb +1 -0
- data/lib/ransack/adapters/active_record/base.rb +5 -1
- data/lib/ransack/adapters/active_record/context.rb +55 -13
- data/lib/ransack/adapters/active_record/ransack/constants.rb +1 -1
- data/lib/ransack/adapters/active_record/ransack/context.rb +1 -0
- data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +11 -3
- data/lib/ransack/configuration.rb +31 -1
- data/lib/ransack/constants.rb +2 -2
- data/lib/ransack/helpers/form_builder.rb +3 -3
- data/lib/ransack/helpers.rb +1 -1
- data/lib/ransack/locale/sv.yml +70 -0
- data/lib/ransack/nodes/attribute.rb +1 -1
- data/lib/ransack/nodes/condition.rb +0 -2
- data/lib/ransack/nodes/grouping.rb +1 -1
- data/lib/ransack/nodes/sort.rb +3 -3
- data/lib/ransack/nodes/value.rb +1 -1
- data/lib/ransack/search.rb +4 -1
- data/lib/ransack/translate.rb +4 -4
- data/lib/ransack/version.rb +1 -1
- data/lib/ransack.rb +2 -2
- data/ransack.gemspec +8 -14
- 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/ransack_helper.rb +1 -1
- data/spec/{ransack → polyamorous}/join_association_spec.rb +8 -1
- data/spec/{ransack → polyamorous}/join_dependency_spec.rb +0 -0
- data/spec/{ransack → polyamorous}/join_spec.rb +0 -0
- data/spec/ransack/adapters/active_record/base_spec.rb +26 -15
- data/spec/ransack/adapters/active_record/context_spec.rb +19 -18
- data/spec/ransack/configuration_spec.rb +24 -0
- data/spec/ransack/helpers/form_helper_spec.rb +16 -16
- data/spec/ransack/nodes/condition_spec.rb +13 -0
- data/spec/ransack/nodes/grouping_spec.rb +2 -2
- data/spec/ransack/predicate_spec.rb +1 -1
- data/spec/ransack/search_spec.rb +215 -30
- data/spec/spec_helper.rb +7 -5
- data/spec/support/schema.rb +28 -2
- metadata +45 -47
- data/.travis.yml +0 -47
- data/polyamorous/lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb +0 -12
- 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/version.rb +0 -3
- data/polyamorous/polyamorous.gemspec +0 -27
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ransack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.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
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2021-12-25 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activerecord
|
@@ -19,28 +19,28 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 5.2.
|
22
|
+
version: 5.2.4
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 5.2.
|
29
|
+
version: 5.2.4
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: activesupport
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
34
|
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 5.2.
|
36
|
+
version: 5.2.4
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 5.2.
|
43
|
+
version: 5.2.4
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
45
|
name: i18n
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
@@ -55,20 +55,6 @@ dependencies:
|
|
55
55
|
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
|
-
- !ruby/object:Gem::Dependency
|
59
|
-
name: polyamorous
|
60
|
-
requirement: !ruby/object:Gem::Requirement
|
61
|
-
requirements:
|
62
|
-
- - '='
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: 2.3.2
|
65
|
-
type: :runtime
|
66
|
-
prerelease: false
|
67
|
-
version_requirements: !ruby/object:Gem::Requirement
|
68
|
-
requirements:
|
69
|
-
- - '='
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
version: 2.3.2
|
72
58
|
description: Ransack is the successor to the MetaSearch gem. It improves and expands
|
73
59
|
upon MetaSearch's functionality, but does not have a 100%-compatible API.
|
74
60
|
email:
|
@@ -80,14 +66,40 @@ executables: []
|
|
80
66
|
extensions: []
|
81
67
|
extra_rdoc_files: []
|
82
68
|
files:
|
69
|
+
- ".github/FUNDING.yml"
|
70
|
+
- ".github/SECURITY.md"
|
71
|
+
- ".github/workflows/cronjob.yml"
|
72
|
+
- ".github/workflows/rubocop.yml"
|
73
|
+
- ".github/workflows/test.yml"
|
83
74
|
- ".gitignore"
|
84
|
-
- ".
|
75
|
+
- ".rubocop.yml"
|
85
76
|
- CHANGELOG.md
|
86
77
|
- CONTRIBUTING.md
|
87
78
|
- Gemfile
|
88
79
|
- LICENSE
|
89
80
|
- README.md
|
90
81
|
- Rakefile
|
82
|
+
- bug_report_templates/test-ransack-scope-and-column-same-name.rb
|
83
|
+
- bug_report_templates/test-ransacker-arel-present-predicate.rb
|
84
|
+
- docs/img/create_release.png
|
85
|
+
- docs/release_process.md
|
86
|
+
- lib/polyamorous.rb
|
87
|
+
- lib/polyamorous/activerecord_5.2_ruby_2/join_association.rb
|
88
|
+
- lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb
|
89
|
+
- lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb
|
90
|
+
- lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb
|
91
|
+
- lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb
|
92
|
+
- lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb
|
93
|
+
- lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb
|
94
|
+
- lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb
|
95
|
+
- lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb
|
96
|
+
- lib/polyamorous/activerecord_7.0_ruby_2/join_association.rb
|
97
|
+
- lib/polyamorous/activerecord_7.0_ruby_2/join_dependency.rb
|
98
|
+
- lib/polyamorous/activerecord_7.0_ruby_2/reflection.rb
|
99
|
+
- lib/polyamorous/join.rb
|
100
|
+
- lib/polyamorous/polyamorous.rb
|
101
|
+
- lib/polyamorous/swapping_reflection_class.rb
|
102
|
+
- lib/polyamorous/tree_node.rb
|
91
103
|
- lib/ransack.rb
|
92
104
|
- lib/ransack/adapters.rb
|
93
105
|
- lib/ransack/adapters/active_record.rb
|
@@ -126,6 +138,7 @@ files:
|
|
126
138
|
- lib/ransack/locale/ro.yml
|
127
139
|
- lib/ransack/locale/ru.yml
|
128
140
|
- lib/ransack/locale/sk.yml
|
141
|
+
- lib/ransack/locale/sv.yml
|
129
142
|
- lib/ransack/locale/tr.yml
|
130
143
|
- lib/ransack/locale/zh-CN.yml
|
131
144
|
- lib/ransack/locale/zh-TW.yml
|
@@ -150,21 +163,6 @@ files:
|
|
150
163
|
- logo/ransack-v.svg
|
151
164
|
- logo/ransack.png
|
152
165
|
- logo/ransack.svg
|
153
|
-
- polyamorous/lib/polyamorous.rb
|
154
|
-
- polyamorous/lib/polyamorous/activerecord_5.2_ruby_2/join_association.rb
|
155
|
-
- polyamorous/lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb
|
156
|
-
- polyamorous/lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb
|
157
|
-
- polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb
|
158
|
-
- polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb
|
159
|
-
- polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb
|
160
|
-
- polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb
|
161
|
-
- polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb
|
162
|
-
- polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb
|
163
|
-
- polyamorous/lib/polyamorous/join.rb
|
164
|
-
- polyamorous/lib/polyamorous/swapping_reflection_class.rb
|
165
|
-
- polyamorous/lib/polyamorous/tree_node.rb
|
166
|
-
- polyamorous/lib/polyamorous/version.rb
|
167
|
-
- polyamorous/polyamorous.gemspec
|
168
166
|
- ransack.gemspec
|
169
167
|
- spec/blueprints/articles.rb
|
170
168
|
- spec/blueprints/comments.rb
|
@@ -174,14 +172,14 @@ files:
|
|
174
172
|
- spec/console.rb
|
175
173
|
- spec/helpers/polyamorous_helper.rb
|
176
174
|
- spec/helpers/ransack_helper.rb
|
175
|
+
- spec/polyamorous/join_association_spec.rb
|
176
|
+
- spec/polyamorous/join_dependency_spec.rb
|
177
|
+
- spec/polyamorous/join_spec.rb
|
177
178
|
- spec/ransack/adapters/active_record/base_spec.rb
|
178
179
|
- spec/ransack/adapters/active_record/context_spec.rb
|
179
180
|
- spec/ransack/configuration_spec.rb
|
180
181
|
- spec/ransack/helpers/form_builder_spec.rb
|
181
182
|
- spec/ransack/helpers/form_helper_spec.rb
|
182
|
-
- spec/ransack/join_association_spec.rb
|
183
|
-
- spec/ransack/join_dependency_spec.rb
|
184
|
-
- spec/ransack/join_spec.rb
|
185
183
|
- spec/ransack/nodes/condition_spec.rb
|
186
184
|
- spec/ransack/nodes/grouping_spec.rb
|
187
185
|
- spec/ransack/predicate_spec.rb
|
@@ -194,7 +192,7 @@ homepage: https://github.com/activerecord-hackery/ransack
|
|
194
192
|
licenses:
|
195
193
|
- MIT
|
196
194
|
metadata: {}
|
197
|
-
post_install_message:
|
195
|
+
post_install_message:
|
198
196
|
rdoc_options: []
|
199
197
|
require_paths:
|
200
198
|
- lib
|
@@ -202,15 +200,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
200
|
requirements:
|
203
201
|
- - ">="
|
204
202
|
- !ruby/object:Gem::Version
|
205
|
-
version: '2.
|
203
|
+
version: '2.6'
|
206
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
205
|
requirements:
|
208
206
|
- - ">="
|
209
207
|
- !ruby/object:Gem::Version
|
210
208
|
version: '0'
|
211
209
|
requirements: []
|
212
|
-
rubygems_version: 3.
|
213
|
-
signing_key:
|
210
|
+
rubygems_version: 3.1.4
|
211
|
+
signing_key:
|
214
212
|
specification_version: 4
|
215
213
|
summary: Object-based searching for Active Record and Mongoid (currently).
|
216
214
|
test_files:
|
@@ -222,14 +220,14 @@ test_files:
|
|
222
220
|
- spec/console.rb
|
223
221
|
- spec/helpers/polyamorous_helper.rb
|
224
222
|
- spec/helpers/ransack_helper.rb
|
223
|
+
- spec/polyamorous/join_association_spec.rb
|
224
|
+
- spec/polyamorous/join_dependency_spec.rb
|
225
|
+
- spec/polyamorous/join_spec.rb
|
225
226
|
- spec/ransack/adapters/active_record/base_spec.rb
|
226
227
|
- spec/ransack/adapters/active_record/context_spec.rb
|
227
228
|
- spec/ransack/configuration_spec.rb
|
228
229
|
- spec/ransack/helpers/form_builder_spec.rb
|
229
230
|
- spec/ransack/helpers/form_helper_spec.rb
|
230
|
-
- spec/ransack/join_association_spec.rb
|
231
|
-
- spec/ransack/join_dependency_spec.rb
|
232
|
-
- spec/ransack/join_spec.rb
|
233
231
|
- spec/ransack/nodes/condition_spec.rb
|
234
232
|
- spec/ransack/nodes/grouping_spec.rb
|
235
233
|
- spec/ransack/predicate_spec.rb
|
data/.travis.yml
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
rvm:
|
4
|
-
- 2.6.5
|
5
|
-
|
6
|
-
services:
|
7
|
-
- mysql
|
8
|
-
|
9
|
-
env:
|
10
|
-
- RAILS=6-0-stable DB=sqlite3
|
11
|
-
- RAILS=6-0-stable DB=mysql
|
12
|
-
- RAILS=6-0-stable DB=postgres
|
13
|
-
|
14
|
-
- RAILS=v6.0.0 DB=sqlite3
|
15
|
-
- RAILS=v6.0.0 DB=mysql
|
16
|
-
- RAILS=v6.0.0 DB=postgres
|
17
|
-
|
18
|
-
- RAILS=5-2-stable DB=sqlite3
|
19
|
-
- RAILS=5-2-stable DB=mysql
|
20
|
-
- RAILS=5-2-stable DB=postgres
|
21
|
-
|
22
|
-
- RAILS=v5.2.3 DB=sqlite3
|
23
|
-
- RAILS=v5.2.3 DB=mysql
|
24
|
-
- RAILS=v5.2.3 DB=postgres
|
25
|
-
|
26
|
-
matrix:
|
27
|
-
allow_failures:
|
28
|
-
- env: RAILS=6-0-stable DB=sqlite3
|
29
|
-
- env: RAILS=6-0-stable DB=mysql
|
30
|
-
- env: RAILS=6-0-stable DB=postgres
|
31
|
-
|
32
|
-
before_script:
|
33
|
-
- if [ "$DB" = "mysql" ];
|
34
|
-
then
|
35
|
-
mysql -e 'create database ransack collate utf8_general_ci;';
|
36
|
-
mysql -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
|
37
|
-
fi
|
38
|
-
|
39
|
-
- if [ "$DB" = "postgres" ];
|
40
|
-
then
|
41
|
-
psql -c 'create database ransack;' -U postgres;
|
42
|
-
fi
|
43
|
-
|
44
|
-
addons:
|
45
|
-
code_climate:
|
46
|
-
repo_token: 8b701c4364d51a0217105e08c06922d600cec3d9e60d546a89e3ddfe46e0664e
|
47
|
-
postgresql: "9.6"
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module Polyamorous
|
2
|
-
module ReflectionExtensions
|
3
|
-
def build_join_constraint(table, foreign_table)
|
4
|
-
if polymorphic?
|
5
|
-
super(table, foreign_table)
|
6
|
-
.and(foreign_table[foreign_type].eq(klass.name))
|
7
|
-
else
|
8
|
-
super(table, foreign_table)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "polyamorous/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = "polyamorous"
|
7
|
-
s.version = Polyamorous::VERSION
|
8
|
-
s.authors = ["Ernie Miller", "Ryan Bigg", "Jon Atack", "Xiang Li"]
|
9
|
-
s.email = ["ernie@erniemiller.org", "radarlistener@gmail.com", "jonnyatack@gmail.com", "bigxiang@gmail.com"]
|
10
|
-
s.homepage = "https://github.com/activerecord-hackery/ransack/tree/master/polyamorous"
|
11
|
-
s.license = "MIT"
|
12
|
-
s.summary = %q{
|
13
|
-
Loves/is loved by polymorphic belongs_to associations, Ransack, Squeel, MetaSearch...
|
14
|
-
}
|
15
|
-
s.description = %q{
|
16
|
-
This is just an extraction from Ransack/Squeel. You probably don't want to use this
|
17
|
-
directly. It extends ActiveRecord's associations to support polymorphic belongs_to
|
18
|
-
associations.
|
19
|
-
}
|
20
|
-
|
21
|
-
s.add_dependency 'activerecord', '>= 5.2.1'
|
22
|
-
|
23
|
-
s.files = `git ls-files`.split("\n")
|
24
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
25
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
26
|
-
s.require_paths = ["lib"]
|
27
|
-
end
|