ransack 1.8.4 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/FUNDING.yml +3 -0
- data/.github/SECURITY.md +12 -0
- data/.github/workflows/cronjob.yml +102 -0
- data/.github/workflows/deploy.yml +35 -0
- data/.github/workflows/rubocop.yml +20 -0
- data/.github/workflows/test-deploy.yml +29 -0
- data/.github/workflows/test.yml +130 -0
- data/.gitignore +3 -0
- data/{lib/ransack/adapters/mongoid/3.2/.gitkeep → .nojekyll} +0 -0
- data/.rubocop.yml +44 -0
- data/CHANGELOG.md +352 -0
- data/CONTRIBUTING.md +25 -13
- data/Gemfile +26 -27
- data/README.md +65 -815
- data/Rakefile +1 -22
- 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/.gitignore +19 -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/acts-as-taggable-on.md +114 -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 +43 -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/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/polymorphic-search.md +40 -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/going-further/wiki-contributors.md +82 -0
- data/docs/docs/intro.md +99 -0
- data/docs/docusaurus.config.js +120 -0
- data/docs/package.json +38 -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/docs/static/logo/ransack-h.png +0 -0
- data/docs/static/logo/ransack-h.svg +34 -0
- data/docs/static/logo/ransack-v.png +0 -0
- data/docs/static/logo/ransack-v.svg +34 -0
- data/docs/static/logo/ransack.png +0 -0
- data/docs/static/logo/ransack.svg +21 -0
- data/docs/yarn.lock +8436 -0
- data/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +70 -0
- data/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +92 -0
- data/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +11 -0
- 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/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/polyamorous/join.rb +70 -0
- data/lib/polyamorous/polyamorous.rb +24 -0
- data/lib/polyamorous/swapping_reflection_class.rb +11 -0
- data/lib/polyamorous/tree_node.rb +7 -0
- data/lib/polyamorous.rb +1 -0
- data/lib/ransack/adapters/active_record/base.rb +14 -3
- data/lib/ransack/adapters/active_record/context.rb +140 -196
- data/lib/ransack/adapters/active_record/ransack/constants.rb +19 -4
- data/lib/ransack/adapters/active_record/ransack/context.rb +9 -19
- data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +7 -7
- data/lib/ransack/adapters/active_record/ransack/translate.rb +1 -5
- data/lib/ransack/adapters/active_record/ransack/visitor.rb +23 -0
- data/lib/ransack/adapters/active_record.rb +0 -9
- data/lib/ransack/adapters.rb +2 -0
- data/lib/ransack/configuration.rb +52 -2
- data/lib/ransack/constants.rb +1 -5
- data/lib/ransack/context.rb +29 -24
- data/lib/ransack/helpers/form_builder.rb +12 -6
- data/lib/ransack/helpers/form_helper.rb +11 -3
- data/lib/ransack/helpers.rb +1 -1
- data/lib/ransack/locale/ar.yml +70 -0
- data/lib/ransack/locale/az.yml +70 -0
- data/lib/ransack/locale/bg.yml +70 -0
- data/lib/ransack/locale/ca.yml +70 -0
- data/lib/ransack/locale/el.yml +70 -0
- data/lib/ransack/locale/es.yml +22 -22
- data/lib/ransack/locale/fa.yml +70 -0
- data/lib/ransack/locale/fi.yml +71 -0
- data/lib/ransack/locale/nl.yml +4 -4
- data/lib/ransack/locale/ru.yml +70 -0
- data/lib/ransack/locale/sk.yml +70 -0
- data/lib/ransack/locale/sv.yml +70 -0
- data/lib/ransack/locale/tr.yml +70 -0
- data/lib/ransack/locale/zh-CN.yml +12 -12
- data/lib/ransack/nodes/attribute.rb +2 -2
- data/lib/ransack/nodes/condition.rb +7 -1
- data/lib/ransack/nodes/grouping.rb +3 -8
- data/lib/ransack/nodes/sort.rb +3 -3
- data/lib/ransack/nodes/value.rb +3 -3
- data/lib/ransack/predicate.rb +13 -20
- data/lib/ransack/search.rb +7 -4
- data/lib/ransack/translate.rb +115 -115
- data/lib/ransack/version.rb +1 -1
- data/lib/ransack/visitor.rb +1 -12
- data/lib/ransack.rb +7 -5
- data/ransack.gemspec +9 -25
- 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/polyamorous_helper.rb +13 -0
- data/spec/helpers/ransack_helper.rb +1 -1
- data/spec/polyamorous/activerecord_compatibility_spec.rb +15 -0
- data/spec/polyamorous/join_association_spec.rb +30 -0
- data/spec/polyamorous/join_dependency_spec.rb +81 -0
- data/spec/polyamorous/join_spec.rb +19 -0
- data/spec/ransack/adapters/active_record/base_spec.rb +105 -11
- data/spec/ransack/adapters/active_record/context_spec.rb +63 -24
- data/spec/ransack/configuration_spec.rb +24 -0
- data/spec/ransack/helpers/form_builder_spec.rb +3 -15
- data/spec/ransack/helpers/form_helper_spec.rb +135 -168
- data/spec/ransack/nodes/condition_spec.rb +13 -0
- data/spec/ransack/nodes/grouping_spec.rb +2 -2
- data/spec/ransack/nodes/value_spec.rb +115 -0
- data/spec/ransack/predicate_spec.rb +54 -2
- data/spec/ransack/search_spec.rb +266 -36
- data/spec/spec_helper.rb +14 -5
- data/spec/support/schema.rb +99 -21
- metadata +117 -187
- data/.travis.yml +0 -86
- data/lib/ransack/adapters/active_record/3.0/compat.rb +0 -179
- data/lib/ransack/adapters/active_record/3.0/context.rb +0 -203
- data/lib/ransack/adapters/active_record/3.1/context.rb +0 -212
- data/lib/ransack/adapters/active_record/3.2/context.rb +0 -44
- data/lib/ransack/adapters/active_record/compat.rb +0 -14
- data/lib/ransack/adapters/mongoid/attributes/attribute.rb +0 -37
- data/lib/ransack/adapters/mongoid/attributes/order_predications.rb +0 -17
- data/lib/ransack/adapters/mongoid/attributes/predications.rb +0 -141
- data/lib/ransack/adapters/mongoid/base.rb +0 -134
- data/lib/ransack/adapters/mongoid/context.rb +0 -212
- data/lib/ransack/adapters/mongoid/inquiry_hash.rb +0 -23
- data/lib/ransack/adapters/mongoid/ransack/constants.rb +0 -88
- data/lib/ransack/adapters/mongoid/ransack/context.rb +0 -60
- data/lib/ransack/adapters/mongoid/ransack/nodes/condition.rb +0 -27
- data/lib/ransack/adapters/mongoid/ransack/translate.rb +0 -13
- data/lib/ransack/adapters/mongoid/ransack/visitor.rb +0 -24
- data/lib/ransack/adapters/mongoid/table.rb +0 -35
- data/lib/ransack/adapters/mongoid.rb +0 -15
- data/spec/mongoid/adapters/mongoid/base_spec.rb +0 -314
- data/spec/mongoid/adapters/mongoid/context_spec.rb +0 -56
- data/spec/mongoid/configuration_spec.rb +0 -162
- data/spec/mongoid/dependencies_spec.rb +0 -8
- data/spec/mongoid/helpers/ransack_helper.rb +0 -11
- data/spec/mongoid/nodes/condition_spec.rb +0 -49
- data/spec/mongoid/nodes/grouping_spec.rb +0 -13
- data/spec/mongoid/predicate_spec.rb +0 -155
- data/spec/mongoid/search_spec.rb +0 -445
- data/spec/mongoid/support/mongoid.yml +0 -11
- data/spec/mongoid/support/schema.rb +0 -135
- data/spec/mongoid/translate_spec.rb +0 -14
- data/spec/mongoid_spec_helper.rb +0 -63
- data/spec/ransack/dependencies_spec.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f4ce966153aee54a3e24eb4ec775569926813ed7273839e5d042dbbc6b3addf8
|
4
|
+
data.tar.gz: 4d96b0ecae077f0096494a99f90e8cfb3555140fe194c79ed691b2760319e51c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d23fb2ddc8ef40489c40e02202b3d051305252c21b5f6c2823478442ce326990b22a26ee46861212b690ada0632328ce6c5065cba238bd185eecc46fd5555c5
|
7
|
+
data.tar.gz: 5dffd2910eefdfe2633d13a4b7d36838340f45fb484f025fed264e5df5b69c730df16257f11e7425a0852f99255b1f22e970c6407a9f5f4c59c2ca027f6e8804
|
data/.github/FUNDING.yml
ADDED
data/.github/SECURITY.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Security Policy
|
2
|
+
|
3
|
+
## Supported Versions
|
4
|
+
|
5
|
+
At the moment, only the latest major.minor release stream is supported with
|
6
|
+
security updates.
|
7
|
+
|
8
|
+
## Reporting a Vulnerability
|
9
|
+
|
10
|
+
Please use the Tidelift security contact to [report a security
|
11
|
+
vulnerability](https://tidelift.com/security). Tidelift will coordinate the fix
|
12
|
+
and disclosure.
|
@@ -0,0 +1,102 @@
|
|
1
|
+
name: cronjob
|
2
|
+
|
3
|
+
on:
|
4
|
+
schedule:
|
5
|
+
- cron: "0 0 * * *"
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
sqlite3:
|
9
|
+
runs-on: ubuntu-20.04
|
10
|
+
strategy:
|
11
|
+
fail-fast: false
|
12
|
+
matrix:
|
13
|
+
ruby:
|
14
|
+
- 3.0.2
|
15
|
+
- 2.7.4
|
16
|
+
env:
|
17
|
+
DB: sqlite3
|
18
|
+
RAILS: main
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v2
|
21
|
+
- name: Set up Ruby
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
25
|
+
- name: Install dependencies
|
26
|
+
run: bundle install
|
27
|
+
- name: Run tests
|
28
|
+
run: bundle exec rspec
|
29
|
+
|
30
|
+
mysql:
|
31
|
+
runs-on: ubuntu-20.04
|
32
|
+
strategy:
|
33
|
+
fail-fast: false
|
34
|
+
matrix:
|
35
|
+
ruby:
|
36
|
+
- 3.0.2
|
37
|
+
- 2.7.4
|
38
|
+
env:
|
39
|
+
DB: mysql
|
40
|
+
RAILS: main
|
41
|
+
MYSQL_USERNAME: root
|
42
|
+
MYSQL_PASSWORD: root
|
43
|
+
steps:
|
44
|
+
- uses: actions/checkout@v2
|
45
|
+
- name: Set up Ruby
|
46
|
+
uses: ruby/setup-ruby@v1
|
47
|
+
with:
|
48
|
+
ruby-version: ${{ matrix.ruby }}
|
49
|
+
- name: Startup MySQL
|
50
|
+
run: |
|
51
|
+
sudo systemctl start mysql.service
|
52
|
+
- name: Setup databases
|
53
|
+
run: |
|
54
|
+
mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
|
55
|
+
mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
|
56
|
+
- name: Install dependencies
|
57
|
+
run: bundle install
|
58
|
+
- name: Run tests
|
59
|
+
run: bundle exec rspec
|
60
|
+
|
61
|
+
postgres:
|
62
|
+
runs-on: ubuntu-20.04
|
63
|
+
strategy:
|
64
|
+
fail-fast: false
|
65
|
+
matrix:
|
66
|
+
ruby:
|
67
|
+
- 3.0.2
|
68
|
+
- 2.7.4
|
69
|
+
env:
|
70
|
+
DB: postgres
|
71
|
+
RAILS: main
|
72
|
+
DATABASE_USERNAME: postgres
|
73
|
+
DATABASE_PASSWORD: postgres
|
74
|
+
DATABASE_HOST: 127.0.0.1
|
75
|
+
services:
|
76
|
+
postgres:
|
77
|
+
image: postgres
|
78
|
+
ports:
|
79
|
+
- 5432:5432
|
80
|
+
env:
|
81
|
+
POSTGRES_PASSWORD: postgres
|
82
|
+
POSTGRES_HOST_AUTH_METHOD: trust
|
83
|
+
# Set health checks to wait until postgres has started
|
84
|
+
options: >-
|
85
|
+
--health-cmd pg_isready
|
86
|
+
--health-interval 10s
|
87
|
+
--health-timeout 5s
|
88
|
+
--health-retries 5
|
89
|
+
|
90
|
+
steps:
|
91
|
+
- uses: actions/checkout@v2
|
92
|
+
- name: Set up Ruby
|
93
|
+
uses: ruby/setup-ruby@v1
|
94
|
+
with:
|
95
|
+
ruby-version: ${{ matrix.ruby }}
|
96
|
+
- name: Setup databases
|
97
|
+
run: |
|
98
|
+
psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
|
99
|
+
- name: Install dependencies
|
100
|
+
run: bundle install
|
101
|
+
- name: Run tests
|
102
|
+
run: bundle exec rspec
|
@@ -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,20 @@
|
|
1
|
+
name: rubocop
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
pull_request:
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
runs-on: ubuntu-20.04
|
10
|
+
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- name: Set up Ruby
|
14
|
+
uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: 3.0.1
|
17
|
+
- name: Install gems
|
18
|
+
run: bundle install --jobs 4 --retry 3
|
19
|
+
- name: Run RuboCop
|
20
|
+
run: bundle exec rubocop --parallel
|
@@ -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
|
@@ -0,0 +1,130 @@
|
|
1
|
+
name: test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
pull_request:
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
sqlite3:
|
9
|
+
runs-on: ubuntu-20.04
|
10
|
+
strategy:
|
11
|
+
fail-fast: false
|
12
|
+
matrix:
|
13
|
+
rails:
|
14
|
+
- v7.0.3
|
15
|
+
- v6.1.6
|
16
|
+
ruby:
|
17
|
+
- 3.1.2
|
18
|
+
- 3.0.4
|
19
|
+
- 2.7.6
|
20
|
+
env:
|
21
|
+
DB: sqlite3
|
22
|
+
RAILS: ${{ matrix.rails }}
|
23
|
+
steps:
|
24
|
+
- uses: actions/checkout@v2
|
25
|
+
- name: Set up Ruby
|
26
|
+
uses: ruby/setup-ruby@v1
|
27
|
+
with:
|
28
|
+
ruby-version: ${{ matrix.ruby }}
|
29
|
+
- name: Install dependencies
|
30
|
+
run: bundle install
|
31
|
+
- name: Run tests
|
32
|
+
run: bundle exec rspec
|
33
|
+
|
34
|
+
mysql:
|
35
|
+
runs-on: ubuntu-20.04
|
36
|
+
strategy:
|
37
|
+
fail-fast: false
|
38
|
+
matrix:
|
39
|
+
rails:
|
40
|
+
- v7.0.3
|
41
|
+
- v6.1.6
|
42
|
+
ruby:
|
43
|
+
- 3.1.2
|
44
|
+
- 3.0.4
|
45
|
+
- 2.7.6
|
46
|
+
env:
|
47
|
+
DB: mysql
|
48
|
+
RAILS: ${{ matrix.rails }}
|
49
|
+
MYSQL_USERNAME: root
|
50
|
+
MYSQL_PASSWORD: root
|
51
|
+
steps:
|
52
|
+
- uses: actions/checkout@v2
|
53
|
+
- name: Set up Ruby
|
54
|
+
uses: ruby/setup-ruby@v1
|
55
|
+
with:
|
56
|
+
ruby-version: ${{ matrix.ruby }}
|
57
|
+
- name: Startup MySQL
|
58
|
+
run: |
|
59
|
+
sudo systemctl start mysql.service
|
60
|
+
- name: Setup databases
|
61
|
+
run: |
|
62
|
+
mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
|
63
|
+
mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
|
64
|
+
- name: Install dependencies
|
65
|
+
run: bundle install
|
66
|
+
- name: Run tests
|
67
|
+
run: bundle exec rspec
|
68
|
+
|
69
|
+
postgres:
|
70
|
+
runs-on: ubuntu-20.04
|
71
|
+
strategy:
|
72
|
+
fail-fast: false
|
73
|
+
matrix:
|
74
|
+
rails:
|
75
|
+
- v7.0.3
|
76
|
+
- v6.1.6
|
77
|
+
ruby:
|
78
|
+
- 3.1.2
|
79
|
+
- 3.0.4
|
80
|
+
- 2.7.6
|
81
|
+
env:
|
82
|
+
DB: postgres
|
83
|
+
RAILS: ${{ matrix.rails }}
|
84
|
+
DATABASE_USERNAME: postgres
|
85
|
+
DATABASE_PASSWORD: postgres
|
86
|
+
DATABASE_HOST: 127.0.0.1
|
87
|
+
services:
|
88
|
+
postgres:
|
89
|
+
image: postgres
|
90
|
+
ports:
|
91
|
+
- 5432:5432
|
92
|
+
env:
|
93
|
+
POSTGRES_PASSWORD: postgres
|
94
|
+
POSTGRES_HOST_AUTH_METHOD: trust
|
95
|
+
# Set health checks to wait until postgres has started
|
96
|
+
options: >-
|
97
|
+
--health-cmd pg_isready
|
98
|
+
--health-interval 10s
|
99
|
+
--health-timeout 5s
|
100
|
+
--health-retries 5
|
101
|
+
|
102
|
+
steps:
|
103
|
+
- uses: actions/checkout@v2
|
104
|
+
- name: Set up Ruby
|
105
|
+
uses: ruby/setup-ruby@v1
|
106
|
+
with:
|
107
|
+
ruby-version: ${{ matrix.ruby }}
|
108
|
+
- name: Setup databases
|
109
|
+
run: |
|
110
|
+
psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
|
111
|
+
- name: Install dependencies
|
112
|
+
run: bundle install
|
113
|
+
- name: Run tests
|
114
|
+
run: bundle exec rspec
|
115
|
+
|
116
|
+
bug-report-templates:
|
117
|
+
runs-on: ubuntu-20.04
|
118
|
+
steps:
|
119
|
+
- uses: actions/checkout@v2
|
120
|
+
- name: Set up Ruby
|
121
|
+
uses: ruby/setup-ruby@v1
|
122
|
+
with:
|
123
|
+
ruby-version: 3.1.2
|
124
|
+
- name: Install dependencies
|
125
|
+
run: bundle install
|
126
|
+
- name: Run bug report templates
|
127
|
+
run: |
|
128
|
+
ruby bug_report_templates/test-ransacker-arel-present-predicate.rb
|
129
|
+
ruby bug_report_templates/test-ransack-scope-and-column-same-name.rb
|
130
|
+
rm Gemfile Gemfile.lock
|
data/.gitignore
CHANGED
File without changes
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.6
|
3
|
+
|
4
|
+
DisabledByDefault: true
|
5
|
+
|
6
|
+
Layout/EmptyLineAfterMagicComment:
|
7
|
+
Enabled: true
|
8
|
+
|
9
|
+
Layout/EmptyLineBetweenDefs:
|
10
|
+
Enabled: true
|
11
|
+
|
12
|
+
Layout/EmptyLines:
|
13
|
+
Enabled: true
|
14
|
+
|
15
|
+
Layout/FirstArrayElementIndentation:
|
16
|
+
EnforcedStyle: consistent
|
17
|
+
|
18
|
+
Layout/SpaceAfterComma:
|
19
|
+
Enabled: true
|
20
|
+
|
21
|
+
Layout/SpaceInsideBlockBraces:
|
22
|
+
Enabled: true
|
23
|
+
|
24
|
+
Layout/SpaceInsideHashLiteralBraces:
|
25
|
+
Enabled: true
|
26
|
+
|
27
|
+
Layout/SpaceInsideParens:
|
28
|
+
Enabled: true
|
29
|
+
|
30
|
+
Layout/TrailingEmptyLines:
|
31
|
+
Enabled: true
|
32
|
+
|
33
|
+
Style/RedundantFileExtensionInRequire:
|
34
|
+
Enabled: true
|
35
|
+
|
36
|
+
Style/RedundantReturn:
|
37
|
+
Enabled: true
|
38
|
+
|
39
|
+
Style/SelfAssignment:
|
40
|
+
Enabled: true
|
41
|
+
|
42
|
+
Style/Semicolon:
|
43
|
+
Enabled: true
|
44
|
+
|