ransack 2.6.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/deploy.yml +35 -0
  3. data/.github/workflows/test-deploy.yml +29 -0
  4. data/.github/workflows/test.yml +10 -22
  5. data/.nojekyll +0 -0
  6. data/CHANGELOG.md +114 -13
  7. data/README.md +45 -1039
  8. data/docs/.gitignore +19 -0
  9. data/docs/.nojekyll +0 -0
  10. data/docs/babel.config.js +3 -0
  11. data/docs/blog/2022-03-27-ransack-3.0.0.md +20 -0
  12. data/docs/docs/getting-started/_category_.json +4 -0
  13. data/docs/docs/getting-started/advanced-mode.md +46 -0
  14. data/docs/docs/getting-started/configuration.md +47 -0
  15. data/docs/docs/getting-started/search-matches.md +67 -0
  16. data/docs/docs/getting-started/simple-mode.md +284 -0
  17. data/docs/docs/getting-started/sorting.md +79 -0
  18. data/docs/docs/getting-started/using-predicates.md +282 -0
  19. data/docs/docs/going-further/_category_.json +4 -0
  20. data/docs/docs/going-further/acts-as-taggable-on.md +114 -0
  21. data/docs/docs/going-further/associations.md +70 -0
  22. data/docs/docs/going-further/custom-predicates.md +52 -0
  23. data/docs/docs/going-further/documentation.md +43 -0
  24. data/docs/docs/going-further/exporting-to-csv.md +49 -0
  25. data/docs/docs/going-further/external-guides.md +57 -0
  26. data/docs/docs/going-further/form-customisation.md +63 -0
  27. data/docs/docs/going-further/i18n.md +53 -0
  28. data/docs/{img → docs/going-further/img}/create_release.png +0 -0
  29. data/docs/docs/going-further/merging-searches.md +41 -0
  30. data/docs/docs/going-further/other-notes.md +428 -0
  31. data/docs/docs/going-further/polymorphic-search.md +40 -0
  32. data/docs/docs/going-further/ransackers.md +331 -0
  33. data/docs/docs/going-further/release_process.md +36 -0
  34. data/docs/docs/going-further/saving-queries.md +82 -0
  35. data/docs/docs/going-further/searching-postgres.md +57 -0
  36. data/docs/docs/going-further/wiki-contributors.md +82 -0
  37. data/docs/docs/intro.md +99 -0
  38. data/docs/docusaurus.config.js +107 -0
  39. data/docs/package.json +37 -0
  40. data/docs/sidebars.js +31 -0
  41. data/docs/src/components/HomepageFeatures/index.js +64 -0
  42. data/docs/src/components/HomepageFeatures/styles.module.css +11 -0
  43. data/docs/src/css/custom.css +39 -0
  44. data/docs/src/pages/index.module.css +23 -0
  45. data/docs/src/pages/markdown-page.md +7 -0
  46. data/docs/static/.nojekyll +0 -0
  47. data/docs/static/img/docusaurus.png +0 -0
  48. data/docs/static/img/favicon.ico +0 -0
  49. data/docs/static/img/logo.svg +1 -0
  50. data/docs/static/img/tutorial/docsVersionDropdown.png +0 -0
  51. data/docs/static/img/tutorial/localeDropdown.png +0 -0
  52. data/docs/static/img/undraw_docusaurus_mountain.svg +171 -0
  53. data/docs/static/img/undraw_docusaurus_react.svg +170 -0
  54. data/docs/static/img/undraw_docusaurus_tree.svg +40 -0
  55. data/{logo → docs/static/logo}/ransack-h.png +0 -0
  56. data/{logo → docs/static/logo}/ransack-h.svg +0 -0
  57. data/{logo → docs/static/logo}/ransack-v.png +0 -0
  58. data/{logo → docs/static/logo}/ransack-v.svg +0 -0
  59. data/{logo → docs/static/logo}/ransack.png +0 -0
  60. data/{logo → docs/static/logo}/ransack.svg +0 -0
  61. data/docs/yarn.lock +7671 -0
  62. data/lib/polyamorous/activerecord_7.1_ruby_2/join_association.rb +1 -0
  63. data/lib/polyamorous/activerecord_7.1_ruby_2/join_dependency.rb +1 -0
  64. data/lib/polyamorous/activerecord_7.1_ruby_2/reflection.rb +1 -0
  65. data/lib/ransack/adapters/active_record/base.rb +0 -2
  66. data/lib/ransack/adapters/active_record/context.rb +1 -0
  67. data/lib/ransack/helpers/form_helper.rb +10 -2
  68. data/lib/ransack/search.rb +2 -2
  69. data/lib/ransack/version.rb +1 -1
  70. data/ransack.gemspec +3 -3
  71. data/spec/ransack/adapters/active_record/base_spec.rb +10 -1
  72. data/spec/ransack/helpers/form_helper_spec.rb +44 -0
  73. data/spec/ransack/search_spec.rb +23 -0
  74. data/spec/support/schema.rb +16 -0
  75. metadata +66 -13
  76. data/docs/release_process.md +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 613abc9bb025f01243aa427878dec0cb7e990e3a9deb3e1436b7f0f3b124bf44
4
- data.tar.gz: 1466899c236bc6c9d1e95fc5262b5b3d6cde18f51929273168ff3286ead4be34
3
+ metadata.gz: 9db4893295fd342185cf668f2b3edbc59f1e649945024147778bdc52978e53fa
4
+ data.tar.gz: 9f57ba51a61d63f1f4023735d8a2ef9384e7840461af65169f4c0214f4b619a8
5
5
  SHA512:
6
- metadata.gz: 2d8f6c96d9b0d4af4d5d64c3aa24cbe79abefe78388ff35637577a46b99b99decf25e51433368634ae557a72707470a9291c62ca33cae15b7ce0edb51b682712
7
- data.tar.gz: 66bcf53be5d9f201f0e51db95140a56b29e3d61c0b9d79fbd3238e3e67a2b0bb5463dc08ebf445155d502f1b8bfb87b0be38040521219733a852471f32385e0b
6
+ metadata.gz: 625d61491c96bd319e95d65d0d704f3906b8087e21f8fd2f8f2d1515ac4debdd3e39b678bbea8f0d39d6a5e58d5b46ba66919cb8b4770c8bb7fc4a77421c743e
7
+ data.tar.gz: cec0aa2875df4b9b8d5e8ae222fba9970ec0aaaf66de05ae21110a981828704a294f8f16fb55037ea0db39429611d7ea0e5f5d4ff51dbcd01cd66fca171b4ecf
@@ -0,0 +1,35 @@
1
+ name: Deploy to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ deploy:
10
+ name: Deploy to GitHub Pages
11
+
12
+ runs-on: ubuntu-20.04
13
+
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+
17
+ - uses: actions/setup-node@v3
18
+ with:
19
+ node-version: 16
20
+ cache: yarn
21
+ cache-dependency-path: docs/yarn.lock
22
+
23
+ - name: Install dependencies
24
+ run: yarn install --frozen-lockfile
25
+ working-directory: docs
26
+
27
+ - name: Build website
28
+ run: yarn build
29
+ working-directory: docs
30
+
31
+ - name: Deploy to GitHub Pages
32
+ uses: peaceiris/actions-gh-pages@v3
33
+ with:
34
+ github_token: ${{ secrets.GITHUB_TOKEN }}
35
+ publish_dir: docs/build
@@ -0,0 +1,29 @@
1
+ name: Test deploy to GitHub Pages
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ test-deploy:
10
+ name: Test deploy to GitHub Pages
11
+
12
+ runs-on: ubuntu-20.04
13
+
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+
17
+ - uses: actions/setup-node@v3
18
+ with:
19
+ node-version: 16
20
+ cache: yarn
21
+ cache-dependency-path: docs/yarn.lock
22
+
23
+ - name: Install dependencies
24
+ run: yarn install --frozen-lockfile
25
+ working-directory: docs
26
+
27
+ - name: Test build website
28
+ run: yarn build
29
+ working-directory: docs
@@ -11,17 +11,13 @@ jobs:
11
11
  fail-fast: false
12
12
  matrix:
13
13
  rails:
14
- - v7.0.0
15
- - v6.1.4
14
+ - v7.0.2
15
+ - v6.1.5
16
16
  - v6.0.4
17
- - 6-0-stable
18
17
  ruby:
18
+ - 3.1.1
19
19
  - 3.0.2
20
20
  - 2.7.4
21
- - 2.6.7
22
- exclude:
23
- - rails: v7.0.0
24
- ruby: 2.6.7
25
21
  env:
26
22
  DB: sqlite3
27
23
  RAILS: ${{ matrix.rails }}
@@ -42,17 +38,13 @@ jobs:
42
38
  fail-fast: false
43
39
  matrix:
44
40
  rails:
45
- - v7.0.0
46
- - v6.1.4
41
+ - v7.0.2
42
+ - v6.1.5
47
43
  - v6.0.4
48
- - 6-0-stable
49
44
  ruby:
45
+ - 3.1.1
50
46
  - 3.0.2
51
47
  - 2.7.4
52
- - 2.6.7
53
- exclude:
54
- - rails: v7.0.0
55
- ruby: 2.6.7
56
48
  env:
57
49
  DB: mysql
58
50
  RAILS: ${{ matrix.rails }}
@@ -82,17 +74,13 @@ jobs:
82
74
  fail-fast: false
83
75
  matrix:
84
76
  rails:
85
- - v7.0.0
86
- - v6.1.4
77
+ - v7.0.2
78
+ - v6.1.5
87
79
  - v6.0.4
88
- - 6-0-stable
89
80
  ruby:
81
+ - 3.1.1
90
82
  - 3.0.2
91
83
  - 2.7.4
92
- - 2.6.7
93
- exclude:
94
- - rails: v7.0.0
95
- ruby: 2.6.7
96
84
  env:
97
85
  DB: postgres
98
86
  RAILS: ${{ matrix.rails }}
@@ -135,7 +123,7 @@ jobs:
135
123
  - name: Set up Ruby
136
124
  uses: ruby/setup-ruby@v1
137
125
  with:
138
- ruby-version: 3.0.2
126
+ ruby-version: 3.1.1
139
127
  - name: Install dependencies
140
128
  run: bundle install
141
129
  - name: Run bug report templates
data/.nojekyll ADDED
File without changes
data/CHANGELOG.md CHANGED
@@ -2,6 +2,80 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 3.1.0 - 2022-04-21
6
+
7
+ * Fix predicate name in "Using Predicates" documentation page.
8
+ PR [1313](https://github.com/activerecord-hackery/ransack/pull/1313)
9
+
10
+ * Drop Ruby 2.6 support.
11
+ PR [1311](https://github.com/activerecord-hackery/ransack/pull/1311)
12
+
13
+ * Allow Ransack to be used with Rails 7.1.0.alpha.
14
+ PR [1309](https://github.com/activerecord-hackery/ransack/pull/1309)
15
+
16
+ * Put contributor list last in documentation site.
17
+ PR [1308](https://github.com/activerecord-hackery/ransack/pull/1308)
18
+
19
+ * Add `acts-as-taggable-on` and polymorphic searches to documentation.
20
+ PR [1306](https://github.com/activerecord-hackery/ransack/pull/1306)
21
+ PR [1312](https://github.com/activerecord-hackery/ransack/pull/1312)
22
+
23
+ * Add full link to issue about merging searches to documentation.
24
+ PR [1305](https://github.com/activerecord-hackery/ransack/pull/1305)
25
+
26
+ ## 3.0.1 - 2022-04-08
27
+
28
+ * Fix `:data` option to `sort_link` being incorrectly appended to the generated
29
+ link query parameters.
30
+ PR [1301](https://github.com/activerecord-hackery/ransack/pull/1301)
31
+
32
+ * Fix "Edit this page" links in documentation site
33
+ PR [1303](https://github.com/activerecord-hackery/ransack/pull/1303)
34
+
35
+ * Auto deploy documentation site after merging PRs
36
+ PR [1302](https://github.com/activerecord-hackery/ransack/pull/1302)
37
+
38
+ * Add list of former wiki contributors to documentation site
39
+ PR [1300](https://github.com/activerecord-hackery/ransack/pull/1300)
40
+
41
+ * Reduce gem package size
42
+ PR [1297](https://github.com/activerecord-hackery/ransack/pull/1297)
43
+
44
+ ## 3.0.0 - 2022-03-30
45
+
46
+ * Move documentation into Docusaurus.
47
+ PR [1291](https://github.com/activerecord-hackery/ransack/pull/1291)
48
+
49
+ * [BREAKING CHANGE] Remove deprecated `#search` method.
50
+ PR [1147](https://github.com/activerecord-hackery/ransack/pull/1147)
51
+
52
+ * Allow scopes that define string SQL joins.
53
+ PR [1225](https://github.com/activerecord-hackery/ransack/pull/1225)
54
+
55
+ * Improve `sort_link` documentation.
56
+ PR [1290](https://github.com/activerecord-hackery/ransack/pull/1290)
57
+
58
+ * Deprecate passing two trailing hashes to `sort_link`, for example:
59
+
60
+ ```ruby
61
+ sort_link(@q, :bussiness_name, "bussines_name", {}, class: "foo")
62
+ ```
63
+
64
+ Pass a single hash with all options instead.
65
+ PR [1289](https://github.com/activerecord-hackery/ransack/pull/1289)
66
+
67
+ * Fix `:class` option to `sort_link` not being passed to the generated link
68
+ correctly when no additional options are passed. For example:
69
+
70
+ ```ruby
71
+ sort_link(@q, :bussiness_name, class: "foo")
72
+ ```
73
+
74
+ PR [1288](https://github.com/activerecord-hackery/ransack/pull/1288)
75
+
76
+ * Evaluate `ransackable_scopes` before attributes when building the query.
77
+ PR [759](https://github.com/activerecord-hackery/ransack/pull/759)
78
+
5
79
  ## 2.6.0 - 2022-03-08
6
80
 
7
81
  * Fix regression when joining a table with itself.
@@ -12,28 +86,55 @@
12
86
 
13
87
  ## 2.5.0 - 2021-12-26
14
88
 
89
+ * Document release process by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1199, https://github.com/activerecord-hackery/ransack/pull/1200.
90
+ * 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
91
+ * Fix for `ActiveRecord::UnknownAttributeReference` in ransack by @TechnologyHypofriend in https://github.com/activerecord-hackery/ransack/pull/1207
92
+ * Make gem compatible with old polyamorous require by @rtweeks in https://github.com/activerecord-hackery/ransack/pull/1145
93
+ * Adding swedish translations by @johanandre in https://github.com/activerecord-hackery/ransack/pull/1208
94
+ * Document how to do case insensitive searches by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1213
95
+ * Add the ability to disable whitespace stripping for string searches by @DCrow in https://github.com/activerecord-hackery/ransack/pull/1214
96
+ * Fix `:default` option in `Translate.attribute` method by @coreyaus in https://github.com/activerecord-hackery/ransack/pull/1218
97
+ * Fix typo in README.md by @d-m-u in https://github.com/activerecord-hackery/ransack/pull/1220
98
+ * Fix another typo in README.md by @plan-do-break-fix in https://github.com/activerecord-hackery/ransack/pull/1221
99
+ * Fix several documentation typos @wonda-tea-coffee in https://github.com/activerecord-hackery/ransack/pull/1233
100
+ * Allow ransack to treat nulls as always first or last by @mollerhoj in https://github.com/activerecord-hackery/ransack/pull/1226
101
+ * Consider ransack aliases when sorting by @faragorn and @waldyr in https://github.com/activerecord-hackery/ransack/pull/1223
102
+ * Fix non-casted array predicates by @danielpclark in https://github.com/activerecord-hackery/ransack/pull/1246
103
+ * Remove Squeel references from README by @Schwad in https://github.com/activerecord-hackery/ransack/pull/1249
104
+ * Remove part of the README that might lead to incorrect results by @RadekMolenda in https://github.com/activerecord-hackery/ransack/pull/1258
15
105
  * ActiveRecord 7.0 support
16
106
 
17
- * Drop support for rubies under 2.5. PR #1189
107
+ ## 2.4.2 - 2021-01-23
18
108
 
19
- * Have casted array predicates type checked to Arel::Nodes::Casted fixing non-casted array predicates.
20
- PR [1246](https://github.com/activerecord-hackery/ransack/pull/1246)
109
+ * Enable RuboCop and configure GitHub Actions to run RuboCop by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1185
110
+ * Add Ruby 3.0.0 support by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1190
111
+ * Drop Ruby 2.5 or older versions of Ruby by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1189
112
+ * Move bug report templates into ransack repository and run templates at CI by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1191
113
+ * Allow Ransack to be tested with Rails main branch by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1192
21
114
 
22
115
  ## 2.4.1 - 2020-12-21
23
116
 
24
- * Add `ActiveRecord::Base.ransack!` which raises error if passed unknown condition
25
-
26
- *Aaron Lipman*
117
+ * Links to Tidelift subscription by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1178
118
+ * Enable GitHub Actions by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1180
119
+ * Move security contact information to SECURITY.md by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1179
120
+ * Add `ActiveRecord::Base.ransack!` which raises error if passed unknown condition by @alipman88 in https://github.com/activerecord-hackery/ransack/pull/1132
121
+ * Add ability to config PostgreSQL ORDER BY ... NULLS FIRST or NULLS LAST by @itsalongstory in https://github.com/activerecord-hackery/ransack/pull/1184
27
122
 
28
123
  ## 2.4.0 - 2020-11-27
29
124
 
30
- * Support ActiveRecord 6.1.0.rc1.
31
- PR [1172](https://github.com/activerecord-hackery/ransack/pull/1172)
32
-
33
- * Fix for ActiveRecord 5.2.4 (note security fix in 5.2.4.2 for ActiveView's escape_javascript CVE-2020-5267 for all earlier versions)
34
-
35
- * Drop support for ActiveRecord older than 5.2.4.
36
- PR [1166](https://github.com/activerecord-hackery/ransack/pull/1166)
125
+ * Specify actual version of polyamorous, so we can release that separately by @gregmolnar in https://github.com/activerecord-hackery/ransack/pull/1101
126
+ * Only include necessary files in gem package by @tvdeyen in https://github.com/activerecord-hackery/ransack/pull/1104
127
+ * Test/Fix for subquery in Rails 5.2.4 by @stevenjonescgm in https://github.com/activerecord-hackery/ransack/pull/1112
128
+ * Polyamorous module by @varyonic in https://github.com/activerecord-hackery/ransack/pull/1113
129
+ * Remove duplicated rows by @sasharevzin in https://github.com/activerecord-hackery/ransack/pull/1116
130
+ * Fix Ruby 2.7 deprecation warnings by @terracatta in https://github.com/activerecord-hackery/ransack/pull/1121
131
+ * Fixes polymorphic joins. by @PhilCoggins in https://github.com/activerecord-hackery/ransack/pull/1122
132
+ * Drop support for activerecord older than 5.2.4 by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1166
133
+ * Adapt to quoting change in Rails by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1165
134
+ * Typo in docs by @brett-anderson in https://github.com/activerecord-hackery/ransack/pull/1155
135
+ * Add Rails 6.1 support by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1172
136
+ * Strip Leading & Trailing Whitespace Before Searching by @itsalongstory in https://github.com/activerecord-hackery/ransack/pull/1126
137
+ * Use unfrozen version of symbol to string by @fauno in https://github.com/activerecord-hackery/ransack/pull/1149
37
138
 
38
139
  ## 2.3.2 - 2020-01-11
39
140