ransack 2.3.0 → 4.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/FUNDING.yml +3 -0
- data/.github/SECURITY.md +12 -0
- data/.github/workflows/codeql.yml +72 -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 +128 -0
- data/.nojekyll +0 -0
- data/.rubocop.yml +47 -0
- data/CHANGELOG.md +228 -1
- data/CONTRIBUTING.md +47 -22
- data/Gemfile +24 -10
- data/README.md +49 -917
- data/bug_report_templates/test-ransack-scope-and-column-same-name.rb +78 -0
- data/bug_report_templates/test-ransacker-arel-present-predicate.rb +75 -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 +288 -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 +42 -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/yarn.lock +8790 -0
- data/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +70 -0
- data/{polyamorous/lib/polyamorous/activerecord_6.0_ruby_2 → lib/polyamorous/activerecord_6.1_ruby_2}/join_dependency.rb +23 -12
- 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/{polyamorous/lib → lib/polyamorous}/polyamorous.rb +3 -8
- data/lib/ransack/adapters/active_record/base.rb +83 -10
- data/lib/ransack/adapters/active_record/context.rb +59 -115
- data/lib/ransack/configuration.rb +53 -10
- data/lib/ransack/constants.rb +126 -7
- data/lib/ransack/context.rb +34 -5
- data/lib/ransack/helpers/form_builder.rb +11 -17
- data/lib/ransack/helpers/form_helper.rb +14 -5
- data/lib/ransack/helpers.rb +1 -1
- data/lib/ransack/locale/sk.yml +70 -0
- data/lib/ransack/locale/sv.yml +70 -0
- data/lib/ransack/nodes/attribute.rb +3 -3
- data/lib/ransack/nodes/condition.rb +87 -8
- data/lib/ransack/nodes/grouping.rb +4 -4
- data/lib/ransack/nodes/node.rb +1 -1
- data/lib/ransack/nodes/sort.rb +3 -3
- data/lib/ransack/nodes/value.rb +3 -3
- data/lib/ransack/predicate.rb +3 -2
- data/lib/ransack/ransacker.rb +1 -1
- data/lib/ransack/search.rb +15 -7
- data/lib/ransack/translate.rb +6 -6
- data/lib/ransack/version.rb +1 -1
- data/lib/ransack/visitor.rb +38 -2
- data/lib/ransack.rb +6 -10
- data/ransack.gemspec +9 -24
- 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 +2 -17
- data/spec/helpers/ransack_helper.rb +1 -1
- data/spec/polyamorous/activerecord_compatibility_spec.rb +15 -0
- data/spec/{ransack → polyamorous}/join_association_spec.rb +3 -1
- data/spec/{ransack → polyamorous}/join_dependency_spec.rb +0 -16
- data/spec/ransack/adapters/active_record/base_spec.rb +109 -16
- data/spec/ransack/adapters/active_record/context_spec.rb +19 -18
- data/spec/ransack/configuration_spec.rb +33 -9
- data/spec/ransack/helpers/form_builder_spec.rb +8 -8
- data/spec/ransack/helpers/form_helper_spec.rb +109 -20
- data/spec/ransack/nodes/condition_spec.rb +37 -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 +75 -2
- data/spec/ransack/search_spec.rb +239 -38
- data/spec/ransack/translate_spec.rb +1 -1
- data/spec/spec_helper.rb +9 -5
- data/spec/support/schema.rb +83 -12
- metadata +105 -195
- data/.travis.yml +0 -49
- data/lib/ransack/adapters/active_record/ransack/constants.rb +0 -116
- data/lib/ransack/adapters/active_record/ransack/context.rb +0 -60
- data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +0 -61
- 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/polyamorous/lib/polyamorous/activerecord_5.0_ruby_2/join_association.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_5.0_ruby_2/join_dependency.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_5.1_ruby_2/join_association.rb +0 -31
- data/polyamorous/lib/polyamorous/activerecord_5.1_ruby_2/join_dependency.rb +0 -112
- data/polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_association.rb +0 -31
- data/polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_dependency.rb +0 -112
- data/polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/reflection.rb +0 -12
- data/polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/join_association.rb +0 -22
- data/polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/join_dependency.rb +0 -81
- data/polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/reflection.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +0 -2
- data/polyamorous/lib/polyamorous/version.rb +0 -3
- data/polyamorous/polyamorous.gemspec +0 -35
- /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/{polyamorous/lib → lib}/polyamorous/join.rb +0 -0
- /data/{polyamorous/lib → lib}/polyamorous/swapping_reflection_class.rb +0 -0
- /data/{polyamorous/lib → lib}/polyamorous/tree_node.rb +0 -0
- /data/lib/ransack/{adapters/active_record.rb → active_record.rb} +0 -0
- /data/spec/{ransack → polyamorous}/join_spec.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
|
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,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,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,128 @@
|
|
1
|
+
name: test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
pull_request:
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
sqlite3:
|
11
|
+
runs-on: ubuntu-20.04
|
12
|
+
strategy:
|
13
|
+
fail-fast: false
|
14
|
+
matrix:
|
15
|
+
rails:
|
16
|
+
- v7.0.3
|
17
|
+
- v6.1.6
|
18
|
+
ruby:
|
19
|
+
- 3.1.2
|
20
|
+
- 3.0.4
|
21
|
+
- 2.7.6
|
22
|
+
env:
|
23
|
+
DB: sqlite3
|
24
|
+
RAILS: ${{ matrix.rails }}
|
25
|
+
steps:
|
26
|
+
- uses: actions/checkout@v2
|
27
|
+
- name: Set up Ruby
|
28
|
+
uses: ruby/setup-ruby@v1
|
29
|
+
with:
|
30
|
+
ruby-version: ${{ matrix.ruby }}
|
31
|
+
bundler-cache: true
|
32
|
+
- name: Run tests
|
33
|
+
run: bundle exec rspec
|
34
|
+
|
35
|
+
mysql:
|
36
|
+
runs-on: ubuntu-20.04
|
37
|
+
strategy:
|
38
|
+
fail-fast: false
|
39
|
+
matrix:
|
40
|
+
rails:
|
41
|
+
- v7.0.3
|
42
|
+
- v6.1.6
|
43
|
+
ruby:
|
44
|
+
- 3.1.2
|
45
|
+
- 3.0.4
|
46
|
+
- 2.7.6
|
47
|
+
env:
|
48
|
+
DB: mysql
|
49
|
+
RAILS: ${{ matrix.rails }}
|
50
|
+
MYSQL_USERNAME: root
|
51
|
+
MYSQL_PASSWORD: root
|
52
|
+
steps:
|
53
|
+
- uses: actions/checkout@v2
|
54
|
+
- name: Set up Ruby
|
55
|
+
uses: ruby/setup-ruby@v1
|
56
|
+
with:
|
57
|
+
ruby-version: ${{ matrix.ruby }}
|
58
|
+
bundler-cache: true
|
59
|
+
- name: Startup MySQL
|
60
|
+
run: |
|
61
|
+
sudo systemctl start mysql.service
|
62
|
+
- name: Setup databases
|
63
|
+
run: |
|
64
|
+
mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
|
65
|
+
mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
|
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
|
+
bundler-cache: true
|
109
|
+
- name: Setup databases
|
110
|
+
run: |
|
111
|
+
psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
|
112
|
+
- name: Run tests
|
113
|
+
run: bundle exec rspec
|
114
|
+
|
115
|
+
bug-report-templates:
|
116
|
+
runs-on: ubuntu-20.04
|
117
|
+
steps:
|
118
|
+
- uses: actions/checkout@v2
|
119
|
+
- name: Set up Ruby
|
120
|
+
uses: ruby/setup-ruby@v1
|
121
|
+
with:
|
122
|
+
ruby-version: 3.1.2
|
123
|
+
bundler-cache: true
|
124
|
+
- name: Run bug report templates
|
125
|
+
run: |
|
126
|
+
ruby bug_report_templates/test-ransacker-arel-present-predicate.rb
|
127
|
+
ruby bug_report_templates/test-ransack-scope-and-column-same-name.rb
|
128
|
+
rm Gemfile Gemfile.lock
|
data/.nojekyll
ADDED
File without changes
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,47 @@
|
|
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/HashSyntax:
|
34
|
+
Enabled: true
|
35
|
+
|
36
|
+
Style/RedundantFileExtensionInRequire:
|
37
|
+
Enabled: true
|
38
|
+
|
39
|
+
Style/RedundantReturn:
|
40
|
+
Enabled: true
|
41
|
+
|
42
|
+
Style/SelfAssignment:
|
43
|
+
Enabled: true
|
44
|
+
|
45
|
+
Style/Semicolon:
|
46
|
+
Enabled: true
|
47
|
+
|