ransack 3.0.0 → 4.0.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.
- checksums.yaml +4 -4
- data/.github/workflows/codeql.yml +72 -0
- data/.github/workflows/deploy.yml +35 -0
- data/.github/workflows/test-deploy.yml +29 -0
- data/.github/workflows/test.yml +22 -39
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +118 -0
- data/CONTRIBUTING.md +38 -16
- data/Gemfile +10 -10
- data/README.md +9 -14
- data/bug_report_templates/test-ransacker-arel-present-predicate.rb +4 -0
- data/docs/.gitignore +0 -1
- data/docs/docs/getting-started/advanced-mode.md +1 -1
- data/docs/docs/getting-started/search-matches.md +1 -1
- data/docs/docs/getting-started/simple-mode.md +30 -26
- data/docs/docs/getting-started/sorting.md +1 -1
- data/docs/docs/getting-started/using-predicates.md +1 -1
- data/docs/docs/going-further/acts-as-taggable-on.md +114 -0
- data/docs/docs/going-further/documentation.md +14 -2
- data/docs/docs/going-further/exporting-to-csv.md +2 -2
- data/docs/docs/going-further/form-customisation.md +1 -1
- data/docs/docs/going-further/i18n.md +3 -3
- data/docs/docs/going-further/merging-searches.md +1 -1
- data/docs/docs/going-further/other-notes.md +1 -1
- data/docs/docs/going-further/polymorphic-search.md +40 -0
- data/docs/docs/going-further/saving-queries.md +1 -1
- data/docs/docs/going-further/searching-postgres.md +1 -1
- data/docs/docs/going-further/wiki-contributors.md +82 -0
- data/docs/docs/intro.md +2 -2
- data/docs/docusaurus.config.js +16 -4
- data/docs/package.json +7 -2
- data/docs/yarn.lock +3036 -1917
- data/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +11 -1
- 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/lib/ransack/adapters/active_record/base.rb +78 -7
- data/lib/ransack/adapters/active_record/context.rb +17 -49
- data/lib/ransack/configuration.rb +25 -12
- data/lib/ransack/constants.rb +125 -3
- data/lib/ransack/context.rb +34 -5
- data/lib/ransack/helpers/form_builder.rb +3 -3
- data/lib/ransack/helpers/form_helper.rb +4 -3
- data/lib/ransack/nodes/attribute.rb +2 -2
- data/lib/ransack/nodes/condition.rb +80 -7
- data/lib/ransack/nodes/grouping.rb +3 -3
- data/lib/ransack/nodes/node.rb +1 -1
- data/lib/ransack/nodes/value.rb +2 -2
- data/lib/ransack/predicate.rb +1 -1
- data/lib/ransack/ransacker.rb +1 -1
- data/lib/ransack/search.rb +9 -4
- data/lib/ransack/translate.rb +2 -2
- data/lib/ransack/version.rb +1 -1
- data/lib/ransack/visitor.rb +38 -2
- data/lib/ransack.rb +3 -6
- data/ransack.gemspec +3 -3
- data/spec/helpers/polyamorous_helper.rb +2 -8
- data/spec/ransack/adapters/active_record/base_spec.rb +73 -0
- data/spec/ransack/configuration_spec.rb +9 -9
- data/spec/ransack/helpers/form_builder_spec.rb +8 -8
- data/spec/ransack/helpers/form_helper_spec.rb +60 -2
- data/spec/ransack/nodes/condition_spec.rb +24 -0
- data/spec/ransack/nodes/value_spec.rb +115 -0
- data/spec/ransack/predicate_spec.rb +36 -1
- data/spec/ransack/translate_spec.rb +1 -1
- data/spec/support/schema.rb +27 -10
- metadata +20 -21
- data/docs/package-lock.json +0 -9207
- data/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb +0 -20
- data/lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb +0 -79
- data/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb +0 -11
- data/lib/polyamorous.rb +0 -1
- data/lib/ransack/adapters/active_record/ransack/constants.rb +0 -128
- data/lib/ransack/adapters/active_record/ransack/context.rb +0 -56
- data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +0 -69
- 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/lib/ransack/{adapters/active_record.rb → active_record.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39e79c778f9eacf124a0ae2465c586d016b8fc6dd934b889d9e7ac9ede798ea7
|
4
|
+
data.tar.gz: 45c34ad5656bd01fd03e9240cf60f7419c662ad0b9aba3a1340ae701844612db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f8b2e4b1f4adaa8d1871879364d836c8a59fbc1b7342857a4d18c7406dd074d2b000380960e1b56555548968c866a109f7600090dc93cc533bc12b7cc52b6aa
|
7
|
+
data.tar.gz: 6b7c84bccd3ba55de586bb2ff58c5a95da5062e4c2046d00065289260af32a5b1991b21d7acad28f7d1e20cb75cde526126f7bef7f0296fead10395b95849af0
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
2
|
+
# to commit it to your repository.
|
3
|
+
#
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
5
|
+
# or to provide custom queries or build logic.
|
6
|
+
#
|
7
|
+
# ******** NOTE ********
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
10
|
+
# supported CodeQL languages.
|
11
|
+
#
|
12
|
+
name: "CodeQL"
|
13
|
+
|
14
|
+
on:
|
15
|
+
push:
|
16
|
+
branches: [ main ]
|
17
|
+
pull_request:
|
18
|
+
# The branches below must be a subset of the branches above
|
19
|
+
branches: [ main ]
|
20
|
+
schedule:
|
21
|
+
- cron: '43 11 * * 3'
|
22
|
+
|
23
|
+
jobs:
|
24
|
+
analyze:
|
25
|
+
name: Analyze
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
permissions:
|
28
|
+
actions: read
|
29
|
+
contents: read
|
30
|
+
security-events: write
|
31
|
+
|
32
|
+
strategy:
|
33
|
+
fail-fast: false
|
34
|
+
matrix:
|
35
|
+
language: [ 'ruby' ]
|
36
|
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
37
|
+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
38
|
+
|
39
|
+
steps:
|
40
|
+
- name: Checkout repository
|
41
|
+
uses: actions/checkout@v3
|
42
|
+
|
43
|
+
# Initializes the CodeQL tools for scanning.
|
44
|
+
- name: Initialize CodeQL
|
45
|
+
uses: github/codeql-action/init@v2
|
46
|
+
with:
|
47
|
+
languages: ${{ matrix.language }}
|
48
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
49
|
+
# By default, queries listed here will override any specified in a config file.
|
50
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
51
|
+
|
52
|
+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
53
|
+
# queries: security-extended,security-and-quality
|
54
|
+
|
55
|
+
|
56
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
57
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
58
|
+
- name: Autobuild
|
59
|
+
uses: github/codeql-action/autobuild@v2
|
60
|
+
|
61
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
62
|
+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
63
|
+
|
64
|
+
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
65
|
+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
66
|
+
|
67
|
+
# - run: |
|
68
|
+
# echo "Run, Build Application using script"
|
69
|
+
# ./location_of_script_within_repo/buildscript.sh
|
70
|
+
|
71
|
+
- name: Perform CodeQL Analysis
|
72
|
+
uses: github/codeql-action/analyze@v2
|
@@ -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/.github/workflows/test.yml
CHANGED
@@ -2,6 +2,8 @@ name: test
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
+
branches:
|
6
|
+
- main
|
5
7
|
pull_request:
|
6
8
|
|
7
9
|
jobs:
|
@@ -11,17 +13,12 @@ jobs:
|
|
11
13
|
fail-fast: false
|
12
14
|
matrix:
|
13
15
|
rails:
|
14
|
-
- v7.0.
|
15
|
-
- v6.1.
|
16
|
-
- v6.0.4
|
17
|
-
- 6-0-stable
|
16
|
+
- v7.0.3
|
17
|
+
- v6.1.6
|
18
18
|
ruby:
|
19
|
-
- 3.
|
20
|
-
-
|
21
|
-
- 2.6
|
22
|
-
exclude:
|
23
|
-
- rails: v7.0.0
|
24
|
-
ruby: 2.6.7
|
19
|
+
- 3.1.2
|
20
|
+
- 3.0.4
|
21
|
+
- 2.7.6
|
25
22
|
env:
|
26
23
|
DB: sqlite3
|
27
24
|
RAILS: ${{ matrix.rails }}
|
@@ -31,8 +28,7 @@ jobs:
|
|
31
28
|
uses: ruby/setup-ruby@v1
|
32
29
|
with:
|
33
30
|
ruby-version: ${{ matrix.ruby }}
|
34
|
-
|
35
|
-
run: bundle install
|
31
|
+
bundler-cache: true
|
36
32
|
- name: Run tests
|
37
33
|
run: bundle exec rspec
|
38
34
|
|
@@ -42,17 +38,12 @@ jobs:
|
|
42
38
|
fail-fast: false
|
43
39
|
matrix:
|
44
40
|
rails:
|
45
|
-
- v7.0.
|
46
|
-
- v6.1.
|
47
|
-
- v6.0.4
|
48
|
-
- 6-0-stable
|
41
|
+
- v7.0.3
|
42
|
+
- v6.1.6
|
49
43
|
ruby:
|
50
|
-
- 3.
|
51
|
-
-
|
52
|
-
- 2.6
|
53
|
-
exclude:
|
54
|
-
- rails: v7.0.0
|
55
|
-
ruby: 2.6.7
|
44
|
+
- 3.1.2
|
45
|
+
- 3.0.4
|
46
|
+
- 2.7.6
|
56
47
|
env:
|
57
48
|
DB: mysql
|
58
49
|
RAILS: ${{ matrix.rails }}
|
@@ -64,6 +55,7 @@ jobs:
|
|
64
55
|
uses: ruby/setup-ruby@v1
|
65
56
|
with:
|
66
57
|
ruby-version: ${{ matrix.ruby }}
|
58
|
+
bundler-cache: true
|
67
59
|
- name: Startup MySQL
|
68
60
|
run: |
|
69
61
|
sudo systemctl start mysql.service
|
@@ -71,8 +63,6 @@ jobs:
|
|
71
63
|
run: |
|
72
64
|
mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
|
73
65
|
mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
|
74
|
-
- name: Install dependencies
|
75
|
-
run: bundle install
|
76
66
|
- name: Run tests
|
77
67
|
run: bundle exec rspec
|
78
68
|
|
@@ -82,17 +72,12 @@ jobs:
|
|
82
72
|
fail-fast: false
|
83
73
|
matrix:
|
84
74
|
rails:
|
85
|
-
- v7.0.
|
86
|
-
- v6.1.
|
87
|
-
- v6.0.4
|
88
|
-
- 6-0-stable
|
75
|
+
- v7.0.3
|
76
|
+
- v6.1.6
|
89
77
|
ruby:
|
90
|
-
- 3.
|
91
|
-
-
|
92
|
-
- 2.6
|
93
|
-
exclude:
|
94
|
-
- rails: v7.0.0
|
95
|
-
ruby: 2.6.7
|
78
|
+
- 3.1.2
|
79
|
+
- 3.0.4
|
80
|
+
- 2.7.6
|
96
81
|
env:
|
97
82
|
DB: postgres
|
98
83
|
RAILS: ${{ matrix.rails }}
|
@@ -120,11 +105,10 @@ jobs:
|
|
120
105
|
uses: ruby/setup-ruby@v1
|
121
106
|
with:
|
122
107
|
ruby-version: ${{ matrix.ruby }}
|
108
|
+
bundler-cache: true
|
123
109
|
- name: Setup databases
|
124
110
|
run: |
|
125
111
|
psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
|
126
|
-
- name: Install dependencies
|
127
|
-
run: bundle install
|
128
112
|
- name: Run tests
|
129
113
|
run: bundle exec rspec
|
130
114
|
|
@@ -135,9 +119,8 @@ jobs:
|
|
135
119
|
- name: Set up Ruby
|
136
120
|
uses: ruby/setup-ruby@v1
|
137
121
|
with:
|
138
|
-
ruby-version: 3.
|
139
|
-
|
140
|
-
run: bundle install
|
122
|
+
ruby-version: 3.1.2
|
123
|
+
bundler-cache: true
|
141
124
|
- name: Run bug report templates
|
142
125
|
run: |
|
143
126
|
ruby bug_report_templates/test-ransacker-arel-present-predicate.rb
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,124 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 4.0.0 - 2023-02-09
|
6
|
+
|
7
|
+
### 💥 Breaking Changes
|
8
|
+
|
9
|
+
* **[SECURITY]** Require explict allowlisting of attributes and associations by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1400
|
10
|
+
* Remove Polyamorous entrypoint by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1370
|
11
|
+
* Remove dead MongoDB code by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1345
|
12
|
+
|
13
|
+
### 🚀 Features
|
14
|
+
|
15
|
+
* Add support for default predicates by @p8 in https://github.com/activerecord-hackery/ransack/pull/1384
|
16
|
+
|
17
|
+
### 🐛 Bug Fixes
|
18
|
+
|
19
|
+
* Ignore `ActiveModel::RangeError` in Ransack conditions by @JunichiIto in https://github.com/activerecord-hackery/ransack/pull/1340
|
20
|
+
* Fix crash when using `q=string` as parameter by @stereobooster in https://github.com/activerecord-hackery/ransack/pull/1374
|
21
|
+
* Prevent changing host through params by @AndersGM in https://github.com/activerecord-hackery/ransack/pull/1391
|
22
|
+
|
23
|
+
### 📝 Documentation
|
24
|
+
|
25
|
+
* Fix broken documentation link by @cpgo in https://github.com/activerecord-hackery/ransack/pull/1332
|
26
|
+
* Remove more old wiki references by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1333
|
27
|
+
* Improve some wording and correct some typos by @ydah in https://github.com/activerecord-hackery/ransack/pull/1336
|
28
|
+
* Add warning about necessary authorization by @AmShaegar13 in https://github.com/activerecord-hackery/ransack/pull/1367
|
29
|
+
* Fix required Ruby and Rails version in README by @tagliala in https://github.com/activerecord-hackery/ransack/pull/1389
|
30
|
+
|
31
|
+
### 💅 Polish
|
32
|
+
|
33
|
+
* Implement CodeQL by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1334
|
34
|
+
* Code quality improvements by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1371
|
35
|
+
* Refactor adapters by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1348
|
36
|
+
* Fix typo: teh -> the by @jdufresne in https://github.com/activerecord-hackery/ransack/pull/1387
|
37
|
+
* Fix broken link by @maful in https://github.com/activerecord-hackery/ransack/pull/1394
|
38
|
+
|
39
|
+
### 🏠 Internal
|
40
|
+
|
41
|
+
* Bump docusaurus by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1338
|
42
|
+
* Update dependencies by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1342
|
43
|
+
* Improve CI by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1351
|
44
|
+
* Improve CONTRIBUTING.md by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1347
|
45
|
+
* Add links to GitHub Discussions by @scarroll32 in https://github.com/activerecord-hackery/ransack/pull/1353
|
46
|
+
* Bump terser from 5.14.0 to 5.14.2 in /docs by @dependabot in https://github.com/activerecord-hackery/ransack/pull/1355
|
47
|
+
* Bump loader-utils from 2.0.2 to 2.0.3 in /docs by @dependabot in https://github.com/activerecord-hackery/ransack/pull/1372
|
48
|
+
* Bump loader-utils from 2.0.3 to 2.0.4 in /docs by @dependabot in https://github.com/activerecord-hackery/ransack/pull/1378
|
49
|
+
* Upgrade some documentation dependencies by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1379
|
50
|
+
* Upgrade local search plugin too by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1380
|
51
|
+
* Bump json5 from 2.2.1 to 2.2.3 in /docs by @dependabot in https://github.com/activerecord-hackery/ransack/pull/1390
|
52
|
+
* Bump ua-parser-js from 0.7.31 to 0.7.33 in /docs by @dependabot in https://github.com/activerecord-hackery/ransack/pull/1397
|
53
|
+
* Bump some doc deps by @deivid-rodriguez in https://github.com/activerecord-hackery/ransack/pull/1398
|
54
|
+
* Bump http-cache-semantics from 4.1.0 to 4.1.1 in /docs by @dependabot in https://github.com/activerecord-hackery/ransack/pull/1401
|
55
|
+
|
56
|
+
## 3.2.1 - 2022-05-24
|
57
|
+
|
58
|
+
* Add search functionality to documentation site.
|
59
|
+
PR [1329](https://github.com/activerecord-hackery/ransack/pull/1329)
|
60
|
+
|
61
|
+
* Fix contributing URLs and syntax highlight in `README.md`.
|
62
|
+
PR [1326](https://github.com/activerecord-hackery/ransack/pull/1326)
|
63
|
+
|
64
|
+
* Cast PostgreSQL's `timestamptz` columns to time.
|
65
|
+
PR [1325](https://github.com/activerecord-hackery/ransack/pull/1325)
|
66
|
+
|
67
|
+
* Add Ruby and ERB syntax highlighting support to documentation site.
|
68
|
+
PR [1324](https://github.com/activerecord-hackery/ransack/pull/1324)
|
69
|
+
|
70
|
+
* Fix a wrong link in `CHANGELOG.md`.
|
71
|
+
PR [1323](https://github.com/activerecord-hackery/ransack/pull/1323)
|
72
|
+
|
73
|
+
* Fix links to bug report templates in `CONTRIBUTING.md`.
|
74
|
+
PR [1321](https://github.com/activerecord-hackery/ransack/pull/1321)
|
75
|
+
|
76
|
+
## 3.2.0 - 2022-05-08
|
77
|
+
|
78
|
+
* Drop Rails 6.0 support.
|
79
|
+
PR [1318](https://github.com/activerecord-hackery/ransack/pull/1318)
|
80
|
+
|
81
|
+
* Exclude "host" from params sent to url generator.
|
82
|
+
PR [1317](https://github.com/activerecord-hackery/ransack/pull/1317)
|
83
|
+
|
84
|
+
## 3.1.0 - 2022-04-21
|
85
|
+
|
86
|
+
* Fix predicate name in "Using Predicates" documentation page.
|
87
|
+
PR [1313](https://github.com/activerecord-hackery/ransack/pull/1313)
|
88
|
+
|
89
|
+
* Drop Ruby 2.6 support.
|
90
|
+
PR [1311](https://github.com/activerecord-hackery/ransack/pull/1311)
|
91
|
+
|
92
|
+
* Allow Ransack to be used with Rails 7.1.0.alpha.
|
93
|
+
PR [1309](https://github.com/activerecord-hackery/ransack/pull/1309)
|
94
|
+
|
95
|
+
* Put contributor list last in documentation site.
|
96
|
+
PR [1308](https://github.com/activerecord-hackery/ransack/pull/1308)
|
97
|
+
|
98
|
+
* Add `acts-as-taggable-on` and polymorphic searches to documentation.
|
99
|
+
PR [1306](https://github.com/activerecord-hackery/ransack/pull/1306)
|
100
|
+
PR [1312](https://github.com/activerecord-hackery/ransack/pull/1312)
|
101
|
+
|
102
|
+
* Add full link to issue about merging searches to documentation.
|
103
|
+
PR [1305](https://github.com/activerecord-hackery/ransack/pull/1305)
|
104
|
+
|
105
|
+
## 3.0.1 - 2022-04-08
|
106
|
+
|
107
|
+
* Fix `:data` option to `sort_link` being incorrectly appended to the generated
|
108
|
+
link query parameters.
|
109
|
+
PR [1301](https://github.com/activerecord-hackery/ransack/pull/1301)
|
110
|
+
|
111
|
+
* Fix "Edit this page" links in documentation site
|
112
|
+
PR [1303](https://github.com/activerecord-hackery/ransack/pull/1303)
|
113
|
+
|
114
|
+
* Auto deploy documentation site after merging PRs
|
115
|
+
PR [1302](https://github.com/activerecord-hackery/ransack/pull/1302)
|
116
|
+
|
117
|
+
* Add list of former wiki contributors to documentation site
|
118
|
+
PR [1300](https://github.com/activerecord-hackery/ransack/pull/1300)
|
119
|
+
|
120
|
+
* Reduce gem package size
|
121
|
+
PR [1297](https://github.com/activerecord-hackery/ransack/pull/1297)
|
122
|
+
|
5
123
|
## 3.0.0 - 2022-03-30
|
6
124
|
|
7
125
|
* Move documentation into Docusaurus.
|
data/CONTRIBUTING.md
CHANGED
@@ -20,14 +20,14 @@ Steps:
|
|
20
20
|
reported.
|
21
21
|
|
22
22
|
2. **Check if the issue has been fixed** — try to reproduce it using the
|
23
|
-
`
|
23
|
+
`main` branch in the repository.
|
24
24
|
|
25
25
|
3. **Isolate the real problem** — make sure the issue is really a bug in
|
26
26
|
Ransack and not in your code or another gem.
|
27
27
|
|
28
28
|
4. **Report the issue** by providing the link to a self-contained
|
29
|
-
gist like [this](https://github.com/activerecord-hackery/ransack/blob/
|
30
|
-
[this](https://github.com/activerecord-hackery/ransack/blob/
|
29
|
+
gist like [this](https://github.com/activerecord-hackery/ransack/blob/main/bug_report_templates/test-ransack-scope-and-column-same-name.rb) or
|
30
|
+
[this](https://github.com/activerecord-hackery/ransack/blob/main/bug_report_templates/test-ransacker-arel-present-predicate.rb). Please use
|
31
31
|
these code examples as a bug-report template for your Ransack issue!
|
32
32
|
|
33
33
|
If you do not provide a self-contained gist and would like your issue to be reviewed, do provide at a minimum:
|
@@ -64,36 +64,56 @@ 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='6-
|
67
|
+
To install rails other than latest (set in Gemfile): `RAILS='6-1-stable' bundle install`
|
68
68
|
|
69
69
|
4. Begin by running the tests. We only take pull requests with passing tests,
|
70
70
|
and it's great to know that you have a clean slate:
|
71
71
|
|
72
|
-
|
72
|
+
```sh
|
73
|
+
bundle exec rake spec
|
74
|
+
```
|
73
75
|
|
74
76
|
The test suite runs by default with SQLite3. To run the test suite with PostgreSQL or MySQL, use:
|
75
77
|
|
76
|
-
|
77
|
-
|
78
|
+
```sh
|
79
|
+
DB=pg bundle exec rake spec
|
80
|
+
DB=mysql bundle exec rake spec
|
81
|
+
```
|
82
|
+
|
83
|
+
A one-liner to run all three
|
84
|
+
|
85
|
+
```sh
|
86
|
+
bundle exec rake spec && DB=pg bundle exec rake spec && DB=mysql bundle exec rake spec
|
87
|
+
```
|
78
88
|
|
79
89
|
For Postgres and MySQL, databases are expected to exist, called 'ransack'. To create use these commands (assuming OS X and Homebrew):
|
80
90
|
|
81
91
|
### Postgres
|
82
|
-
|
92
|
+
|
93
|
+
```sh
|
94
|
+
createdb ransack
|
95
|
+
```
|
83
96
|
|
84
97
|
### MySQL
|
85
|
-
|
86
|
-
|
98
|
+
|
99
|
+
```sh
|
100
|
+
mysql -u root
|
101
|
+
mysql> create database ransack;
|
102
|
+
```
|
87
103
|
|
88
104
|
The test suite runs by default
|
89
105
|
|
90
106
|
To run only the tests in a particular file: `bundle exec rspec <path/to/filename>`
|
91
107
|
|
92
|
-
|
108
|
+
```sh
|
109
|
+
bundle exec rspec spec/ransack/search_spec.rb
|
110
|
+
```
|
93
111
|
|
94
112
|
To run a single test in that file: `bundle exec rspec <path/to/filename> -e "test name"`
|
95
113
|
|
96
|
-
|
114
|
+
```sh
|
115
|
+
bundle exec rspec spec/ransack/search_spec.rb -e "accepts a context option"
|
116
|
+
```
|
97
117
|
|
98
118
|
5. Hack away! Please use Ruby features that are compatible down to Ruby 2.3.
|
99
119
|
Since version 2.3.1, Ransack no longer maintains Ruby 2.2 compatibility.
|
@@ -109,8 +129,10 @@ Here's a quick guide:
|
|
109
129
|
|
110
130
|
9. Make sure git knows your name and email address in your `~/.gitconfig` file:
|
111
131
|
|
112
|
-
|
113
|
-
|
132
|
+
```sh
|
133
|
+
git config --global user.name "Your Name"
|
134
|
+
git config --global user.email "contributor@example.com"
|
135
|
+
```
|
114
136
|
|
115
137
|
10. Commit your changes (`git commit -am 'Add feature/fix bug/improve docs'`).
|
116
138
|
If your pull request only contains documentation changes, please remember
|
@@ -123,7 +145,7 @@ Here's a quick guide:
|
|
123
145
|
|
124
146
|
12. Push the branch up to your fork on GitHub
|
125
147
|
(`git push origin my-new-feature`) and from GitHub submit a pull request to
|
126
|
-
Ransack's `
|
148
|
+
Ransack's `main` branch.
|
127
149
|
|
128
150
|
At this point you're waiting on us. We like to at least comment on, if not
|
129
151
|
accept, pull requests within three business days (and, typically, one business
|
@@ -132,7 +154,7 @@ day). We may suggest some changes or improvements or alternatives.
|
|
132
154
|
Some things that will increase the chance that your pull request is accepted:
|
133
155
|
|
134
156
|
* Include tests that fail without your code, and pass with it.
|
135
|
-
* Update the README, the change log, the
|
157
|
+
* Update the README, the change log, the documentation... anything that is
|
136
158
|
affected by your contribution.
|
137
159
|
* Use idiomatic Ruby and follow the syntax conventions below.
|
138
160
|
|
data/Gemfile
CHANGED
@@ -3,7 +3,7 @@ gemspec
|
|
3
3
|
|
4
4
|
gem 'rake'
|
5
5
|
|
6
|
-
rails = ENV['RAILS'] || '6-
|
6
|
+
rails = ENV['RAILS'] || '6-1-stable'
|
7
7
|
|
8
8
|
rails_version = case rails
|
9
9
|
when /\// # A path
|
@@ -14,10 +14,10 @@ rails_version = case rails
|
|
14
14
|
rails
|
15
15
|
end
|
16
16
|
|
17
|
-
gem 'faker'
|
18
|
-
gem 'sqlite3'
|
19
|
-
gem 'pg'
|
20
|
-
gem 'pry'
|
17
|
+
gem 'faker'
|
18
|
+
gem 'sqlite3'
|
19
|
+
gem 'pg'
|
20
|
+
gem 'pry'
|
21
21
|
gem 'byebug'
|
22
22
|
|
23
23
|
case rails
|
@@ -28,26 +28,26 @@ when /\// # A path
|
|
28
28
|
gem 'actionpack', path: "#{rails}/actionpack"
|
29
29
|
gem 'actionview', path: "#{rails}/actionview"
|
30
30
|
when /^v/ # A tagged version
|
31
|
-
git 'https://github.com/rails/rails.git', :
|
31
|
+
git 'https://github.com/rails/rails.git', tag: rails do
|
32
32
|
gem 'activesupport'
|
33
33
|
gem 'activemodel'
|
34
34
|
gem 'activerecord', require: false
|
35
35
|
gem 'actionpack'
|
36
36
|
end
|
37
37
|
else
|
38
|
-
git 'https://github.com/rails/rails.git', :
|
38
|
+
git 'https://github.com/rails/rails.git', branch: rails do
|
39
39
|
gem 'activesupport'
|
40
40
|
gem 'activemodel'
|
41
41
|
gem 'activerecord', require: false
|
42
42
|
gem 'actionpack'
|
43
43
|
end
|
44
44
|
end
|
45
|
-
gem 'mysql2'
|
45
|
+
gem 'mysql2'
|
46
46
|
|
47
47
|
group :test do
|
48
48
|
gem 'machinist', '~> 1.0.6'
|
49
|
-
gem 'rspec'
|
50
|
-
gem 'simplecov', :
|
49
|
+
gem 'rspec'
|
50
|
+
gem 'simplecov', require: false
|
51
51
|
end
|
52
52
|
|
53
53
|
gem 'rubocop', require: false
|
data/README.md
CHANGED
@@ -5,11 +5,6 @@
|
|
5
5
|
[](https://codeclimate.com/github/activerecord-hackery/ransack)
|
6
6
|
[](#backers) [](#sponsors)
|
7
7
|
|
8
|
-
# SPECIAL ANNOUNCEMENT
|
9
|
-
|
10
|
-
Please see the [Ransack Blog](https://activerecord-hackery.github.io/ransack/blog) for a special announcement from the Ransack maintainers and Ernie Miller, the original author of Ransack.
|
11
|
-
|
12
|
-
|
13
8
|
# Introduction
|
14
9
|
|
15
10
|
Ransack will help you easily add **searching to your Rails application**, without any additional dependencies.
|
@@ -18,13 +13,13 @@ There are advanced searching solutions around, like ElasticSearch or Algolia. **
|
|
18
13
|
|
19
14
|
Ready to move beyond the basics? Use **advanced features** like i18n and extensive configuration options.
|
20
15
|
|
21
|
-
Ransack is supported for Rails 7.0, 6.
|
16
|
+
Ransack is supported for Rails 7.0, 6.1 on Ruby 2.7 and later.
|
22
17
|
|
23
18
|
## Installation
|
24
19
|
|
25
20
|
To install `ransack` and add it to your Gemfile, run
|
26
21
|
|
27
|
-
```
|
22
|
+
```ruby title='Gemfile'
|
28
23
|
gem 'ransack'
|
29
24
|
```
|
30
25
|
|
@@ -32,7 +27,7 @@ gem 'ransack'
|
|
32
27
|
|
33
28
|
If you would like to use the latest updates not yet published to RubyGems, use the `main` branch:
|
34
29
|
|
35
|
-
```
|
30
|
+
```ruby title='Gemfile'
|
36
31
|
gem 'ransack', :github => 'activerecord-hackery/ransack', :branch => 'main'
|
37
32
|
```
|
38
33
|
|
@@ -42,11 +37,11 @@ There is [extensive documentation on Ransack](https://activerecord-hackery.githu
|
|
42
37
|
|
43
38
|
## Issues tracker
|
44
39
|
|
45
|
-
* Before filing an issue, please read the [Contributing Guide](
|
40
|
+
* Before filing an issue, please read the [Contributing Guide](CONTRIBUTING.md).
|
46
41
|
* File an issue if a bug is caused by Ransack, is new (has not already been reported), and _can be reproduced from the information you provide_.
|
47
42
|
* Please consider adding a branch with a failing spec describing the problem.
|
48
43
|
* Contributions are welcome. :smiley:
|
49
|
-
* Please do not use the issue tracker for personal support requests. Stack Overflow is a better place for that where a wider community can help you!
|
44
|
+
* Please do not use the issue tracker for personal support requests. Stack Overflow or [GitHub Discussions](https://github.com/activerecord-hackery/ransack/discussions) is a better place for that where a wider community can help you!
|
50
45
|
|
51
46
|
|
52
47
|
## Contributions
|
@@ -58,10 +53,10 @@ To support the project:
|
|
58
53
|
broken or missing. A failing spec to demonstrate the issue is awesome. A pull
|
59
54
|
request with passing tests is even better!
|
60
55
|
* Before filing an issue or pull request, be sure to read and follow the
|
61
|
-
[Contributing Guide](
|
62
|
-
* Please use Stack Overflow or
|
56
|
+
[Contributing Guide](CONTRIBUTING.md).
|
57
|
+
* Please use Stack Overflow or [GitHub Discussions](https://github.com/activerecord-hackery/ransack/discussions) for questions or discussion not
|
63
58
|
directly related to bug reports, pull requests, or documentation improvements.
|
64
|
-
* Spread the word on
|
59
|
+
* Spread the word on social media if Ransack's been useful
|
65
60
|
to you. The more people who are using the project, the quicker we can find and
|
66
61
|
fix bugs!
|
67
62
|
|
@@ -96,7 +91,7 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
|
|
96
91
|
<a href="https://opencollective.com/ransack/sponsor/1/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/1/avatar.svg" /></a>
|
97
92
|
<a href="https://opencollective.com/ransack/sponsor/2/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/2/avatar.svg" /></a>
|
98
93
|
<a href="https://opencollective.com/ransack/sponsor/3/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/3/avatar.svg" /></a>
|
99
|
-
<a href="https://opencollective.com/ransack/sponsor/4/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/4/avatar.svg"
|
94
|
+
<a href="https://opencollective.com/ransack/sponsor/4/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/4/avatar.svg" /></a>
|
100
95
|
<a href="https://opencollective.com/ransack/sponsor/5/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/5/avatar.svg" /></a>
|
101
96
|
<a href="https://opencollective.com/ransack/sponsor/6/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/6/avatar.svg" /></a>
|
102
97
|
<a href="https://opencollective.com/ransack/sponsor/7/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/7/avatar.svg" /></a>
|