ransack 2.6.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) 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/.nojekyll +0 -0
  5. data/CHANGELOG.md +93 -13
  6. data/README.md +45 -1039
  7. data/docs/.gitignore +19 -0
  8. data/docs/.nojekyll +0 -0
  9. data/docs/babel.config.js +3 -0
  10. data/docs/blog/2022-03-27-ransack-3.0.0.md +20 -0
  11. data/docs/docs/getting-started/_category_.json +4 -0
  12. data/docs/docs/getting-started/advanced-mode.md +46 -0
  13. data/docs/docs/getting-started/configuration.md +47 -0
  14. data/docs/docs/getting-started/search-matches.md +67 -0
  15. data/docs/docs/getting-started/simple-mode.md +284 -0
  16. data/docs/docs/getting-started/sorting.md +79 -0
  17. data/docs/docs/getting-started/using-predicates.md +282 -0
  18. data/docs/docs/going-further/_category_.json +4 -0
  19. data/docs/docs/going-further/associations.md +70 -0
  20. data/docs/docs/going-further/custom-predicates.md +52 -0
  21. data/docs/docs/going-further/documentation.md +43 -0
  22. data/docs/docs/going-further/exporting-to-csv.md +49 -0
  23. data/docs/docs/going-further/external-guides.md +57 -0
  24. data/docs/docs/going-further/form-customisation.md +63 -0
  25. data/docs/docs/going-further/i18n.md +53 -0
  26. data/docs/{img → docs/going-further/img}/create_release.png +0 -0
  27. data/docs/docs/going-further/merging-searches.md +41 -0
  28. data/docs/docs/going-further/other-notes.md +428 -0
  29. data/docs/docs/going-further/ransackers.md +331 -0
  30. data/docs/docs/going-further/release_process.md +36 -0
  31. data/docs/docs/going-further/saving-queries.md +82 -0
  32. data/docs/docs/going-further/searching-postgres.md +57 -0
  33. data/docs/docs/going-further/wiki-contributors.md +82 -0
  34. data/docs/docs/intro.md +99 -0
  35. data/docs/docusaurus.config.js +107 -0
  36. data/docs/package.json +37 -0
  37. data/docs/sidebars.js +31 -0
  38. data/docs/src/components/HomepageFeatures/index.js +64 -0
  39. data/docs/src/components/HomepageFeatures/styles.module.css +11 -0
  40. data/docs/src/css/custom.css +39 -0
  41. data/docs/src/pages/index.module.css +23 -0
  42. data/docs/src/pages/markdown-page.md +7 -0
  43. data/docs/static/.nojekyll +0 -0
  44. data/docs/static/img/docusaurus.png +0 -0
  45. data/docs/static/img/favicon.ico +0 -0
  46. data/docs/static/img/logo.svg +1 -0
  47. data/docs/static/img/tutorial/docsVersionDropdown.png +0 -0
  48. data/docs/static/img/tutorial/localeDropdown.png +0 -0
  49. data/docs/static/img/undraw_docusaurus_mountain.svg +171 -0
  50. data/docs/static/img/undraw_docusaurus_react.svg +170 -0
  51. data/docs/static/img/undraw_docusaurus_tree.svg +40 -0
  52. data/{logo → docs/static/logo}/ransack-h.png +0 -0
  53. data/{logo → docs/static/logo}/ransack-h.svg +0 -0
  54. data/{logo → docs/static/logo}/ransack-v.png +0 -0
  55. data/{logo → docs/static/logo}/ransack-v.svg +0 -0
  56. data/{logo → docs/static/logo}/ransack.png +0 -0
  57. data/{logo → docs/static/logo}/ransack.svg +0 -0
  58. data/docs/yarn.lock +7671 -0
  59. data/lib/ransack/adapters/active_record/base.rb +0 -2
  60. data/lib/ransack/adapters/active_record/context.rb +1 -0
  61. data/lib/ransack/helpers/form_helper.rb +10 -2
  62. data/lib/ransack/search.rb +2 -2
  63. data/lib/ransack/version.rb +1 -1
  64. data/ransack.gemspec +2 -2
  65. data/spec/ransack/adapters/active_record/base_spec.rb +10 -1
  66. data/spec/ransack/helpers/form_helper_spec.rb +44 -0
  67. data/spec/ransack/search_spec.rb +23 -0
  68. data/spec/support/schema.rb +16 -0
  69. metadata +60 -12
  70. 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: 2599d5bd405561f9dd3c9b1b585baef6132a23653ebaf079f65aa7a326b20998
4
+ data.tar.gz: '0899eeb3faebe29e31c6ec2ec248d1b106f6fdb5175532fdb55b82abce928d19'
5
5
  SHA512:
6
- metadata.gz: 2d8f6c96d9b0d4af4d5d64c3aa24cbe79abefe78388ff35637577a46b99b99decf25e51433368634ae557a72707470a9291c62ca33cae15b7ce0edb51b682712
7
- data.tar.gz: 66bcf53be5d9f201f0e51db95140a56b29e3d61c0b9d79fbd3238e3e67a2b0bb5463dc08ebf445155d502f1b8bfb87b0be38040521219733a852471f32385e0b
6
+ metadata.gz: 0cd85c2c70494e50e4ce67351a3abb7822424372fbe5e3062415b7c3471094883f955cf6c6c57f1f783442b68d18593c0d8a220e4f1f1e68c9e1e48d80b2d9be
7
+ data.tar.gz: 24c878aceb15a2a914f4c99743df78af82aef65fda072301678bde8307ed0dfafc5506366929babf19524a221d2a57d191d7d3e4ebb2bf73760f5b4b6928d082
@@ -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
data/.nojekyll ADDED
File without changes
data/CHANGELOG.md CHANGED
@@ -2,6 +2,59 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 3.0.1 - 2022-04-08
6
+
7
+ * Fix `:data` option to `sort_link` being incorrectly appended to the generated
8
+ link query parameters.
9
+ PR [1301](https://github.com/activerecord-hackery/ransack/pull/1301)
10
+
11
+ * Fix "Edit this page" links in documentation site
12
+ PR [1303](https://github.com/activerecord-hackery/ransack/pull/1303)
13
+
14
+ * Auto deploy documentation site after merging PRs
15
+ PR [1302](https://github.com/activerecord-hackery/ransack/pull/1302)
16
+
17
+ * Add list of former wiki contributors to documentation site
18
+ PR [1300](https://github.com/activerecord-hackery/ransack/pull/1300)
19
+
20
+ * Reduce gem package size
21
+ PR [1297](https://github.com/activerecord-hackery/ransack/pull/1297)
22
+
23
+ ## 3.0.0 - 2022-03-30
24
+
25
+ * Move documentation into Docusaurus.
26
+ PR [1291](https://github.com/activerecord-hackery/ransack/pull/1291)
27
+
28
+ * [BREAKING CHANGE] Remove deprecated `#search` method.
29
+ PR [1147](https://github.com/activerecord-hackery/ransack/pull/1147)
30
+
31
+ * Allow scopes that define string SQL joins.
32
+ PR [1225](https://github.com/activerecord-hackery/ransack/pull/1225)
33
+
34
+ * Improve `sort_link` documentation.
35
+ PR [1290](https://github.com/activerecord-hackery/ransack/pull/1290)
36
+
37
+ * Deprecate passing two trailing hashes to `sort_link`, for example:
38
+
39
+ ```ruby
40
+ sort_link(@q, :bussiness_name, "bussines_name", {}, class: "foo")
41
+ ```
42
+
43
+ Pass a single hash with all options instead.
44
+ PR [1289](https://github.com/activerecord-hackery/ransack/pull/1289)
45
+
46
+ * Fix `:class` option to `sort_link` not being passed to the generated link
47
+ correctly when no additional options are passed. For example:
48
+
49
+ ```ruby
50
+ sort_link(@q, :bussiness_name, class: "foo")
51
+ ```
52
+
53
+ PR [1288](https://github.com/activerecord-hackery/ransack/pull/1288)
54
+
55
+ * Evaluate `ransackable_scopes` before attributes when building the query.
56
+ PR [759](https://github.com/activerecord-hackery/ransack/pull/759)
57
+
5
58
  ## 2.6.0 - 2022-03-08
6
59
 
7
60
  * Fix regression when joining a table with itself.
@@ -12,28 +65,55 @@
12
65
 
13
66
  ## 2.5.0 - 2021-12-26
14
67
 
68
+ * Document release process by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1199, https://github.com/activerecord-hackery/ransack/pull/1200.
69
+ * 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
70
+ * Fix for `ActiveRecord::UnknownAttributeReference` in ransack by @TechnologyHypofriend in https://github.com/activerecord-hackery/ransack/pull/1207
71
+ * Make gem compatible with old polyamorous require by @rtweeks in https://github.com/activerecord-hackery/ransack/pull/1145
72
+ * Adding swedish translations by @johanandre in https://github.com/activerecord-hackery/ransack/pull/1208
73
+ * Document how to do case insensitive searches by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1213
74
+ * Add the ability to disable whitespace stripping for string searches by @DCrow in https://github.com/activerecord-hackery/ransack/pull/1214
75
+ * Fix `:default` option in `Translate.attribute` method by @coreyaus in https://github.com/activerecord-hackery/ransack/pull/1218
76
+ * Fix typo in README.md by @d-m-u in https://github.com/activerecord-hackery/ransack/pull/1220
77
+ * Fix another typo in README.md by @plan-do-break-fix in https://github.com/activerecord-hackery/ransack/pull/1221
78
+ * Fix several documentation typos @wonda-tea-coffee in https://github.com/activerecord-hackery/ransack/pull/1233
79
+ * Allow ransack to treat nulls as always first or last by @mollerhoj in https://github.com/activerecord-hackery/ransack/pull/1226
80
+ * Consider ransack aliases when sorting by @faragorn and @waldyr in https://github.com/activerecord-hackery/ransack/pull/1223
81
+ * Fix non-casted array predicates by @danielpclark in https://github.com/activerecord-hackery/ransack/pull/1246
82
+ * Remove Squeel references from README by @Schwad in https://github.com/activerecord-hackery/ransack/pull/1249
83
+ * Remove part of the README that might lead to incorrect results by @RadekMolenda in https://github.com/activerecord-hackery/ransack/pull/1258
15
84
  * ActiveRecord 7.0 support
16
85
 
17
- * Drop support for rubies under 2.5. PR #1189
86
+ ## 2.4.2 - 2021-01-23
18
87
 
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)
88
+ * Enable RuboCop and configure GitHub Actions to run RuboCop by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1185
89
+ * Add Ruby 3.0.0 support by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1190
90
+ * Drop Ruby 2.5 or older versions of Ruby by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1189
91
+ * Move bug report templates into ransack repository and run templates at CI by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1191
92
+ * Allow Ransack to be tested with Rails main branch by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1192
21
93
 
22
94
  ## 2.4.1 - 2020-12-21
23
95
 
24
- * Add `ActiveRecord::Base.ransack!` which raises error if passed unknown condition
25
-
26
- *Aaron Lipman*
96
+ * Links to Tidelift subscription by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1178
97
+ * Enable GitHub Actions by @yahonda in https://github.com/activerecord-hackery/ransack/pull/1180
98
+ * Move security contact information to SECURITY.md by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1179
99
+ * Add `ActiveRecord::Base.ransack!` which raises error if passed unknown condition by @alipman88 in https://github.com/activerecord-hackery/ransack/pull/1132
100
+ * Add ability to config PostgreSQL ORDER BY ... NULLS FIRST or NULLS LAST by @itsalongstory in https://github.com/activerecord-hackery/ransack/pull/1184
27
101
 
28
102
  ## 2.4.0 - 2020-11-27
29
103
 
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)
104
+ * Specify actual version of polyamorous, so we can release that separately by @gregmolnar in https://github.com/activerecord-hackery/ransack/pull/1101
105
+ * Only include necessary files in gem package by @tvdeyen in https://github.com/activerecord-hackery/ransack/pull/1104
106
+ * Test/Fix for subquery in Rails 5.2.4 by @stevenjonescgm in https://github.com/activerecord-hackery/ransack/pull/1112
107
+ * Polyamorous module by @varyonic in https://github.com/activerecord-hackery/ransack/pull/1113
108
+ * Remove duplicated rows by @sasharevzin in https://github.com/activerecord-hackery/ransack/pull/1116
109
+ * Fix Ruby 2.7 deprecation warnings by @terracatta in https://github.com/activerecord-hackery/ransack/pull/1121
110
+ * Fixes polymorphic joins. by @PhilCoggins in https://github.com/activerecord-hackery/ransack/pull/1122
111
+ * Drop support for activerecord older than 5.2.4 by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1166
112
+ * Adapt to quoting change in Rails by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1165
113
+ * Typo in docs by @brett-anderson in https://github.com/activerecord-hackery/ransack/pull/1155
114
+ * Add Rails 6.1 support by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1172
115
+ * Strip Leading & Trailing Whitespace Before Searching by @itsalongstory in https://github.com/activerecord-hackery/ransack/pull/1126
116
+ * Use unfrozen version of symbol to string by @fauno in https://github.com/activerecord-hackery/ransack/pull/1149
37
117
 
38
118
  ## 2.3.2 - 2020-01-11
39
119