ransack 2.4.2 → 3.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/workflows/cronjob.yml +6 -9
- data/.github/workflows/rubocop.yml +1 -1
- data/.github/workflows/test.yml +25 -34
- data/.nojekyll +0 -0
- data/CHANGELOG.md +90 -11
- data/CONTRIBUTING.md +4 -3
- data/README.md +45 -973
- data/docs/.gitignore +20 -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 +284 -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/associations.md +70 -0
- data/docs/docs/going-further/custom-predicates.md +52 -0
- data/docs/docs/going-further/documentation.md +31 -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/{img → 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/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/intro.md +99 -0
- data/docs/docusaurus.config.js +108 -0
- data/docs/package-lock.json +9207 -0
- data/docs/package.json +37 -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/{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/docs/yarn.lock +7671 -0
- data/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb +20 -1
- data/lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb +0 -1
- data/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb +11 -1
- data/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +0 -4
- data/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +0 -1
- data/lib/polyamorous/{activerecord_6.2_ruby_2 → activerecord_7.0_ruby_2}/join_association.rb +0 -0
- data/lib/polyamorous/{activerecord_6.2_ruby_2 → activerecord_7.0_ruby_2}/join_dependency.rb +0 -0
- data/lib/polyamorous/{activerecord_6.2_ruby_2 → activerecord_7.0_ruby_2}/reflection.rb +0 -0
- data/lib/polyamorous.rb +1 -0
- data/lib/ransack/adapters/active_record/base.rb +1 -3
- data/lib/ransack/adapters/active_record/context.rb +7 -2
- data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +10 -9
- data/lib/ransack/configuration.rb +16 -2
- data/lib/ransack/helpers/form_helper.rb +11 -3
- data/lib/ransack/locale/sv.yml +70 -0
- data/lib/ransack/nodes/sort.rb +2 -2
- data/lib/ransack/search.rb +4 -3
- data/lib/ransack/translate.rb +1 -1
- data/lib/ransack/version.rb +1 -1
- data/ransack.gemspec +4 -4
- data/spec/polyamorous/activerecord_compatibility_spec.rb +15 -0
- data/spec/polyamorous/join_association_spec.rb +1 -6
- data/spec/polyamorous/join_dependency_spec.rb +0 -16
- data/spec/ransack/adapters/active_record/base_spec.rb +28 -11
- data/spec/ransack/configuration_spec.rb +14 -0
- data/spec/ransack/helpers/form_helper_spec.rb +33 -2
- data/spec/ransack/nodes/condition_spec.rb +13 -0
- data/spec/ransack/search_spec.rb +140 -27
- data/spec/support/schema.rb +49 -0
- metadata +72 -25
- data/docs/release_process.md +0 -20
- data/lib/polyamorous/activerecord_5.2_ruby_2/join_association.rb +0 -24
- data/lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb +0 -79
- data/lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 400fa6bc00b27207224ee94101cd526a602076669e1824c605e9897d3fd6ba7c
|
4
|
+
data.tar.gz: df6443d69d67e1a59ab97378784c8ddbb3966d3dd6376e3362bacae0afea72c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e620b446afd597cfa16e20be2f20d762791d496cd24ec3441f8553697b81a0ac50280da1ec07a068962f06937cfb7fdbaeeab33dd17fbdb0233226cd42f95d6a
|
7
|
+
data.tar.gz: 30b74e2d17fbb7e215ff60a129f1bf4af779e0b1d6d62865e1d8dfb8b9215d6a06f0008f1704e6fb25ab83e25dafa0f2fa219c57588eafe5260b14a0f9c5f0f0
|
@@ -11,9 +11,8 @@ jobs:
|
|
11
11
|
fail-fast: false
|
12
12
|
matrix:
|
13
13
|
ruby:
|
14
|
-
- 3.0.
|
15
|
-
- 2.7.
|
16
|
-
- 2.6.6
|
14
|
+
- 3.0.2
|
15
|
+
- 2.7.4
|
17
16
|
env:
|
18
17
|
DB: sqlite3
|
19
18
|
RAILS: main
|
@@ -34,9 +33,8 @@ jobs:
|
|
34
33
|
fail-fast: false
|
35
34
|
matrix:
|
36
35
|
ruby:
|
37
|
-
- 3.0.
|
38
|
-
- 2.7.
|
39
|
-
- 2.6.6
|
36
|
+
- 3.0.2
|
37
|
+
- 2.7.4
|
40
38
|
env:
|
41
39
|
DB: mysql
|
42
40
|
RAILS: main
|
@@ -66,9 +64,8 @@ jobs:
|
|
66
64
|
fail-fast: false
|
67
65
|
matrix:
|
68
66
|
ruby:
|
69
|
-
- 3.0.
|
70
|
-
- 2.7.
|
71
|
-
- 2.6.6
|
67
|
+
- 3.0.2
|
68
|
+
- 2.7.4
|
72
69
|
env:
|
73
70
|
DB: postgres
|
74
71
|
RAILS: main
|
data/.github/workflows/test.yml
CHANGED
@@ -11,20 +11,17 @@ jobs:
|
|
11
11
|
fail-fast: false
|
12
12
|
matrix:
|
13
13
|
rails:
|
14
|
-
-
|
15
|
-
- v6.
|
14
|
+
- v7.0.0
|
15
|
+
- v6.1.4
|
16
|
+
- v6.0.4
|
16
17
|
- 6-0-stable
|
17
|
-
- 5-2-stable
|
18
|
-
- v5.2.4
|
19
18
|
ruby:
|
20
|
-
- 3.0.
|
21
|
-
- 2.7.
|
22
|
-
- 2.6.
|
19
|
+
- 3.0.2
|
20
|
+
- 2.7.4
|
21
|
+
- 2.6.7
|
23
22
|
exclude:
|
24
|
-
- rails:
|
25
|
-
ruby:
|
26
|
-
- rails: 5-2-stable
|
27
|
-
ruby: 3.0.0
|
23
|
+
- rails: v7.0.0
|
24
|
+
ruby: 2.6.7
|
28
25
|
env:
|
29
26
|
DB: sqlite3
|
30
27
|
RAILS: ${{ matrix.rails }}
|
@@ -45,20 +42,17 @@ jobs:
|
|
45
42
|
fail-fast: false
|
46
43
|
matrix:
|
47
44
|
rails:
|
48
|
-
-
|
49
|
-
- v6.
|
45
|
+
- v7.0.0
|
46
|
+
- v6.1.4
|
47
|
+
- v6.0.4
|
50
48
|
- 6-0-stable
|
51
|
-
- 5-2-stable
|
52
|
-
- v5.2.4
|
53
49
|
ruby:
|
54
|
-
- 3.0.
|
55
|
-
- 2.7.
|
56
|
-
- 2.6.
|
50
|
+
- 3.0.2
|
51
|
+
- 2.7.4
|
52
|
+
- 2.6.7
|
57
53
|
exclude:
|
58
|
-
- rails:
|
59
|
-
ruby:
|
60
|
-
- rails: 5-2-stable
|
61
|
-
ruby: 3.0.0
|
54
|
+
- rails: v7.0.0
|
55
|
+
ruby: 2.6.7
|
62
56
|
env:
|
63
57
|
DB: mysql
|
64
58
|
RAILS: ${{ matrix.rails }}
|
@@ -88,20 +82,17 @@ jobs:
|
|
88
82
|
fail-fast: false
|
89
83
|
matrix:
|
90
84
|
rails:
|
91
|
-
-
|
92
|
-
- v6.
|
85
|
+
- v7.0.0
|
86
|
+
- v6.1.4
|
87
|
+
- v6.0.4
|
93
88
|
- 6-0-stable
|
94
|
-
- 5-2-stable
|
95
|
-
- v5.2.4
|
96
89
|
ruby:
|
97
|
-
- 3.0.
|
98
|
-
- 2.7.
|
99
|
-
- 2.6.
|
90
|
+
- 3.0.2
|
91
|
+
- 2.7.4
|
92
|
+
- 2.6.7
|
100
93
|
exclude:
|
101
|
-
- rails:
|
102
|
-
ruby:
|
103
|
-
- rails: 5-2-stable
|
104
|
-
ruby: 3.0.0
|
94
|
+
- rails: v7.0.0
|
95
|
+
ruby: 2.6.7
|
105
96
|
env:
|
106
97
|
DB: postgres
|
107
98
|
RAILS: ${{ matrix.rails }}
|
@@ -144,7 +135,7 @@ jobs:
|
|
144
135
|
- name: Set up Ruby
|
145
136
|
uses: ruby/setup-ruby@v1
|
146
137
|
with:
|
147
|
-
ruby-version: 3.0.
|
138
|
+
ruby-version: 3.0.2
|
148
139
|
- name: Install dependencies
|
149
140
|
run: bundle install
|
150
141
|
- name: Run bug report templates
|
data/.nojekyll
ADDED
File without changes
|
data/CHANGELOG.md
CHANGED
@@ -1,22 +1,101 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
|
3
|
+
## Unreleased
|
4
4
|
|
5
|
-
##
|
5
|
+
## 3.0.0 - 2022-03-30
|
6
6
|
|
7
|
-
*
|
7
|
+
* Move documentation into Docusaurus.
|
8
|
+
PR [1291](https://github.com/activerecord-hackery/ransack/pull/1291)
|
8
9
|
|
9
|
-
|
10
|
+
* [BREAKING CHANGE] Remove deprecated `#search` method.
|
11
|
+
PR [1147](https://github.com/activerecord-hackery/ransack/pull/1147)
|
10
12
|
|
11
|
-
|
13
|
+
* Allow scopes that define string SQL joins.
|
14
|
+
PR [1225](https://github.com/activerecord-hackery/ransack/pull/1225)
|
15
|
+
|
16
|
+
* Improve `sort_link` documentation.
|
17
|
+
PR [1290](https://github.com/activerecord-hackery/ransack/pull/1290)
|
18
|
+
|
19
|
+
* Deprecate passing two trailing hashes to `sort_link`, for example:
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
sort_link(@q, :bussiness_name, "bussines_name", {}, class: "foo")
|
23
|
+
```
|
24
|
+
|
25
|
+
Pass a single hash with all options instead.
|
26
|
+
PR [1289](https://github.com/activerecord-hackery/ransack/pull/1289)
|
27
|
+
|
28
|
+
* Fix `:class` option to `sort_link` not being passed to the generated link
|
29
|
+
correctly when no additional options are passed. For example:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
sort_link(@q, :bussiness_name, class: "foo")
|
33
|
+
```
|
34
|
+
|
35
|
+
PR [1288](https://github.com/activerecord-hackery/ransack/pull/1288)
|
36
|
+
|
37
|
+
* Evaluate `ransackable_scopes` before attributes when building the query.
|
38
|
+
PR [759](https://github.com/activerecord-hackery/ransack/pull/759)
|
12
39
|
|
13
|
-
|
14
|
-
PR [1172](https://github.com/activerecord-hackery/ransack/pull/1172)
|
40
|
+
## 2.6.0 - 2022-03-08
|
15
41
|
|
16
|
-
* Fix
|
42
|
+
* Fix regression when joining a table with itself.
|
43
|
+
PR [1275](https://github.com/activerecord-hackery/ransack/pull/1276)
|
44
|
+
|
45
|
+
* Drop support for ActiveRecord older than 6.0.4.
|
46
|
+
PR [1276](https://github.com/activerecord-hackery/ransack/pull/1276)
|
47
|
+
|
48
|
+
## 2.5.0 - 2021-12-26
|
49
|
+
|
50
|
+
* Document release process by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1199, https://github.com/activerecord-hackery/ransack/pull/1200.
|
51
|
+
* Support Rails 7 by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1205, https://github.com/activerecord-hackery/ransack/pull/1209, https://github.com/activerecord-hackery/ransack/pull/1234, https://github.com/activerecord-hackery/ransack/pull/1230, https://github.com/activerecord-hackery/ransack/pull/1266
|
52
|
+
* Fix for `ActiveRecord::UnknownAttributeReference` in ransack by @TechnologyHypofriend in https://github.com/activerecord-hackery/ransack/pull/1207
|
53
|
+
* Make gem compatible with old polyamorous require by @rtweeks in https://github.com/activerecord-hackery/ransack/pull/1145
|
54
|
+
* Adding swedish translations by @johanandre in https://github.com/activerecord-hackery/ransack/pull/1208
|
55
|
+
* Document how to do case insensitive searches by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1213
|
56
|
+
* Add the ability to disable whitespace stripping for string searches by @DCrow in https://github.com/activerecord-hackery/ransack/pull/1214
|
57
|
+
* Fix `:default` option in `Translate.attribute` method by @coreyaus in https://github.com/activerecord-hackery/ransack/pull/1218
|
58
|
+
* Fix typo in README.md by @d-m-u in https://github.com/activerecord-hackery/ransack/pull/1220
|
59
|
+
* Fix another typo in README.md by @plan-do-break-fix in https://github.com/activerecord-hackery/ransack/pull/1221
|
60
|
+
* Fix several documentation typos @wonda-tea-coffee in https://github.com/activerecord-hackery/ransack/pull/1233
|
61
|
+
* Allow ransack to treat nulls as always first or last by @mollerhoj in https://github.com/activerecord-hackery/ransack/pull/1226
|
62
|
+
* Consider ransack aliases when sorting by @faragorn and @waldyr in https://github.com/activerecord-hackery/ransack/pull/1223
|
63
|
+
* Fix non-casted array predicates by @danielpclark in https://github.com/activerecord-hackery/ransack/pull/1246
|
64
|
+
* Remove Squeel references from README by @Schwad in https://github.com/activerecord-hackery/ransack/pull/1249
|
65
|
+
* Remove part of the README that might lead to incorrect results by @RadekMolenda in https://github.com/activerecord-hackery/ransack/pull/1258
|
66
|
+
* ActiveRecord 7.0 support
|
67
|
+
|
68
|
+
## 2.4.2 - 2021-01-23
|
69
|
+
|
70
|
+
* Enable RuboCop and configure GitHub Actions to run RuboCop by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1185
|
71
|
+
* Add Ruby 3.0.0 support by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1190
|
72
|
+
* Drop Ruby 2.5 or older versions of Ruby by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1189
|
73
|
+
* Move bug report templates into ransack repository and run templates at CI by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1191
|
74
|
+
* Allow Ransack to be tested with Rails main branch by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1192
|
75
|
+
|
76
|
+
## 2.4.1 - 2020-12-21
|
77
|
+
|
78
|
+
* Links to Tidelift subscription by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1178
|
79
|
+
* Enable GitHub Actions by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1180
|
80
|
+
* Move security contact information to SECURITY.md by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1179
|
81
|
+
* Add `ActiveRecord::Base.ransack!` which raises error if passed unknown condition by @alipman88 in https://github.com/activerecord-hackery/ransack/pull/1132
|
82
|
+
* Add ability to config PostgreSQL ORDER BY ... NULLS FIRST or NULLS LAST by @itsalongstory in https://github.com/activerecord-hackery/ransack/pull/1184
|
83
|
+
|
84
|
+
## 2.4.0 - 2020-11-27
|
17
85
|
|
18
|
-
*
|
19
|
-
|
86
|
+
* Specify actual version of polyamorous, so we can release that separately by @gregmolnar in https://github.com/activerecord-hackery/ransack/pull/1101
|
87
|
+
* Only include necessary files in gem package by @tvdeyen in https://github.com/activerecord-hackery/ransack/pull/1104
|
88
|
+
* Test/Fix for subquery in Rails 5.2.4 by @stevenjonescgm in https://github.com/activerecord-hackery/ransack/pull/1112
|
89
|
+
* Polyamorous module by @varyonic in https://github.com/activerecord-hackery/ransack/pull/1113
|
90
|
+
* Remove duplicated rows by @sasharevzin in https://github.com/activerecord-hackery/ransack/pull/1116
|
91
|
+
* Fix Ruby 2.7 deprecation warnings by @terracatta in https://github.com/activerecord-hackery/ransack/pull/1121
|
92
|
+
* Fixes polymorphic joins. by @PhilCoggins in https://github.com/activerecord-hackery/ransack/pull/1122
|
93
|
+
* Drop support for activerecord older than 5.2.4 by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1166
|
94
|
+
* Adapt to quoting change in Rails by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1165
|
95
|
+
* Typo in docs by @brett-anderson in https://github.com/activerecord-hackery/ransack/pull/1155
|
96
|
+
* Add Rails 6.1 support by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1172
|
97
|
+
* Strip Leading & Trailing Whitespace Before Searching by @itsalongstory in https://github.com/activerecord-hackery/ransack/pull/1126
|
98
|
+
* Use unfrozen version of symbol to string by @fauno in https://github.com/activerecord-hackery/ransack/pull/1149
|
20
99
|
|
21
100
|
## 2.3.2 - 2020-01-11
|
22
101
|
|
@@ -200,7 +279,7 @@
|
|
200
279
|
ignored when block parameter is specified.
|
201
280
|
PR [#818](https://github.com/activerecord-hackery/ransack/pull/818).
|
202
281
|
|
203
|
-
* No need pass some
|
282
|
+
* No need pass some arguments to JoinAssociation#join_constraints in Rails 5.1.
|
204
283
|
PR [#814](https://github.com/activerecord-hackery/ransack/pull/814).
|
205
284
|
Fixes [#807](https://github.com/activerecord-hackery/ransack/issues/807).
|
206
285
|
Reference [rails/rails#28267](https://github.com/rails/rails/pull/28267)
|
data/CONTRIBUTING.md
CHANGED
@@ -64,9 +64,7 @@ Here's a quick guide:
|
|
64
64
|
2. Create a thoughtfully-named branch for your changes (`git checkout -b my-new-feature`).
|
65
65
|
|
66
66
|
3. Install the development dependencies by running `bundle install`.
|
67
|
-
To install rails other than latest (set in Gemfile): `RAILS='
|
68
|
-
|
69
|
-
$ RAILS='5-2-stable' bundle install
|
67
|
+
To install rails other than latest (set in Gemfile): `RAILS='6-0-stable' bundle install`
|
70
68
|
|
71
69
|
4. Begin by running the tests. We only take pull requests with passing tests,
|
72
70
|
and it's great to know that you have a clean slate:
|
@@ -115,6 +113,9 @@ Here's a quick guide:
|
|
115
113
|
$ git config --global user.email "contributor@example.com"
|
116
114
|
|
117
115
|
10. Commit your changes (`git commit -am 'Add feature/fix bug/improve docs'`).
|
116
|
+
If your pull request only contains documentation changes, please remember
|
117
|
+
to add `[skip ci]` to the beginning of your commit message so the CI
|
118
|
+
test suite doesn't :runner: needlessly.
|
118
119
|
|
119
120
|
11. If necessary, rebase your commits into logical chunks, without errors. To
|
120
121
|
interactively rebase and cherry-pick from, say, the last 10 commits:
|