ransack 4.1.1 → 4.4.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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -3
  3. data/lib/polyamorous/activerecord/join_association_7_2.rb +55 -0
  4. data/lib/polyamorous/polyamorous.rb +5 -1
  5. data/lib/ransack/adapters/active_record/context.rb +32 -5
  6. data/lib/ransack/constants.rb +1 -1
  7. data/lib/ransack/context.rb +7 -4
  8. data/lib/ransack/helpers/form_builder.rb +6 -7
  9. data/lib/ransack/helpers/form_helper.rb +86 -20
  10. data/lib/ransack/invalid_search_error.rb +3 -0
  11. data/lib/ransack/locale/ja.yml +51 -51
  12. data/lib/ransack/locale/ko.yml +70 -0
  13. data/lib/ransack/locale/uk.yml +72 -0
  14. data/lib/ransack/nodes/condition.rb +39 -7
  15. data/lib/ransack/nodes/grouping.rb +1 -1
  16. data/lib/ransack/nodes/sort.rb +1 -1
  17. data/lib/ransack/nodes/value.rb +9 -1
  18. data/lib/ransack/search.rb +4 -3
  19. data/lib/ransack/version.rb +1 -1
  20. data/lib/ransack.rb +9 -0
  21. data/spec/polyamorous/join_association_spec.rb +0 -1
  22. data/spec/polyamorous/join_dependency_spec.rb +0 -1
  23. data/spec/ransack/adapters/active_record/base_spec.rb +106 -3
  24. data/spec/ransack/adapters/active_record/context_spec.rb +72 -0
  25. data/spec/ransack/helpers/form_builder_spec.rb +0 -2
  26. data/spec/ransack/helpers/form_helper_spec.rb +219 -5
  27. data/spec/ransack/nodes/condition_spec.rb +230 -0
  28. data/spec/ransack/nodes/grouping_spec.rb +2 -2
  29. data/spec/ransack/nodes/value_spec.rb +12 -1
  30. data/spec/ransack/predicate_spec.rb +16 -9
  31. data/spec/ransack/search_spec.rb +121 -1
  32. data/spec/ransack/translate_spec.rb +0 -1
  33. data/spec/spec_helper.rb +2 -3
  34. data/spec/support/schema.rb +42 -0
  35. metadata +17 -86
  36. data/.github/FUNDING.yml +0 -3
  37. data/.github/SECURITY.md +0 -12
  38. data/.github/workflows/codeql.yml +0 -72
  39. data/.github/workflows/cronjob.yml +0 -99
  40. data/.github/workflows/deploy.yml +0 -35
  41. data/.github/workflows/rubocop.yml +0 -20
  42. data/.github/workflows/test-deploy.yml +0 -29
  43. data/.github/workflows/test.yml +0 -131
  44. data/.gitignore +0 -7
  45. data/.nojekyll +0 -0
  46. data/.rubocop.yml +0 -50
  47. data/CHANGELOG.md +0 -1176
  48. data/CONTRIBUTING.md +0 -171
  49. data/Gemfile +0 -53
  50. data/Rakefile +0 -24
  51. data/bug_report_templates/test-ransack-scope-and-column-same-name.rb +0 -78
  52. data/bug_report_templates/test-ransacker-arel-present-predicate.rb +0 -75
  53. data/docs/.gitignore +0 -19
  54. data/docs/.nojekyll +0 -0
  55. data/docs/babel.config.js +0 -3
  56. data/docs/blog/2022-03-27-ransack-3.0.0.md +0 -20
  57. data/docs/docs/getting-started/_category_.json +0 -4
  58. data/docs/docs/getting-started/advanced-mode.md +0 -46
  59. data/docs/docs/getting-started/configuration.md +0 -47
  60. data/docs/docs/getting-started/search-matches.md +0 -67
  61. data/docs/docs/getting-started/simple-mode.md +0 -288
  62. data/docs/docs/getting-started/sorting.md +0 -71
  63. data/docs/docs/getting-started/using-predicates.md +0 -282
  64. data/docs/docs/going-further/_category_.json +0 -4
  65. data/docs/docs/going-further/acts-as-taggable-on.md +0 -114
  66. data/docs/docs/going-further/associations.md +0 -70
  67. data/docs/docs/going-further/custom-predicates.md +0 -52
  68. data/docs/docs/going-further/documentation.md +0 -43
  69. data/docs/docs/going-further/exporting-to-csv.md +0 -49
  70. data/docs/docs/going-further/external-guides.md +0 -57
  71. data/docs/docs/going-further/form-customisation.md +0 -63
  72. data/docs/docs/going-further/i18n.md +0 -53
  73. data/docs/docs/going-further/img/create_release.png +0 -0
  74. data/docs/docs/going-further/merging-searches.md +0 -41
  75. data/docs/docs/going-further/other-notes.md +0 -428
  76. data/docs/docs/going-further/polymorphic-search.md +0 -46
  77. data/docs/docs/going-further/ransackers.md +0 -331
  78. data/docs/docs/going-further/release_process.md +0 -36
  79. data/docs/docs/going-further/saving-queries.md +0 -82
  80. data/docs/docs/going-further/searching-postgres.md +0 -57
  81. data/docs/docs/going-further/wiki-contributors.md +0 -82
  82. data/docs/docs/intro.md +0 -99
  83. data/docs/docusaurus.config.js +0 -120
  84. data/docs/package.json +0 -42
  85. data/docs/sidebars.js +0 -31
  86. data/docs/src/components/HomepageFeatures/index.js +0 -64
  87. data/docs/src/components/HomepageFeatures/styles.module.css +0 -11
  88. data/docs/src/css/custom.css +0 -39
  89. data/docs/src/pages/index.module.css +0 -23
  90. data/docs/src/pages/markdown-page.md +0 -7
  91. data/docs/static/.nojekyll +0 -0
  92. data/docs/static/img/docusaurus.png +0 -0
  93. data/docs/static/img/favicon.ico +0 -0
  94. data/docs/static/img/logo.svg +0 -1
  95. data/docs/static/img/tutorial/docsVersionDropdown.png +0 -0
  96. data/docs/static/img/tutorial/localeDropdown.png +0 -0
  97. data/docs/static/img/undraw_docusaurus_mountain.svg +0 -171
  98. data/docs/static/img/undraw_docusaurus_react.svg +0 -170
  99. data/docs/static/img/undraw_docusaurus_tree.svg +0 -40
  100. data/docs/static/logo/ransack-h.png +0 -0
  101. data/docs/static/logo/ransack-h.svg +0 -34
  102. data/docs/static/logo/ransack-v.png +0 -0
  103. data/docs/static/logo/ransack-v.svg +0 -34
  104. data/docs/static/logo/ransack.png +0 -0
  105. data/docs/static/logo/ransack.svg +0 -21
  106. data/docs/yarn.lock +0 -8879
  107. data/ransack.gemspec +0 -26
@@ -1,99 +0,0 @@
1
- name: cronjob
2
-
3
- on:
4
- schedule:
5
- - cron: "0 0 * * *"
6
-
7
- jobs:
8
- sqlite3:
9
- runs-on: ubuntu-22.04
10
- strategy:
11
- fail-fast: false
12
- matrix:
13
- ruby:
14
- - 3.2.2
15
- env:
16
- DB: sqlite3
17
- RAILS: main
18
- steps:
19
- - uses: actions/checkout@v2
20
- - name: Set up Ruby
21
- uses: ruby/setup-ruby@v1
22
- with:
23
- ruby-version: ${{ matrix.ruby }}
24
- - name: Install dependencies
25
- run: bundle install
26
- - name: Run tests
27
- run: bundle exec rspec
28
-
29
- mysql:
30
- runs-on: ubuntu-22.04
31
- strategy:
32
- fail-fast: false
33
- matrix:
34
- ruby:
35
- - 3.2.2
36
- env:
37
- DB: mysql
38
- RAILS: main
39
- MYSQL_USERNAME: root
40
- MYSQL_PASSWORD: root
41
- steps:
42
- - uses: actions/checkout@v2
43
- - name: Set up Ruby
44
- uses: ruby/setup-ruby@v1
45
- with:
46
- ruby-version: ${{ matrix.ruby }}
47
- - name: Startup MySQL
48
- run: |
49
- sudo systemctl start mysql.service
50
- - name: Setup databases
51
- run: |
52
- mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
53
- mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
54
- - name: Install dependencies
55
- run: bundle install
56
- - name: Run tests
57
- run: bundle exec rspec
58
-
59
- postgres:
60
- runs-on: ubuntu-22.04
61
- strategy:
62
- fail-fast: false
63
- matrix:
64
- ruby:
65
- - 3.2.2
66
- env:
67
- DB: postgres
68
- RAILS: main
69
- DATABASE_USERNAME: postgres
70
- DATABASE_PASSWORD: postgres
71
- DATABASE_HOST: 127.0.0.1
72
- services:
73
- postgres:
74
- image: postgres
75
- ports:
76
- - 5432:5432
77
- env:
78
- POSTGRES_PASSWORD: postgres
79
- POSTGRES_HOST_AUTH_METHOD: trust
80
- # Set health checks to wait until postgres has started
81
- options: >-
82
- --health-cmd pg_isready
83
- --health-interval 10s
84
- --health-timeout 5s
85
- --health-retries 5
86
-
87
- steps:
88
- - uses: actions/checkout@v2
89
- - name: Set up Ruby
90
- uses: ruby/setup-ruby@v1
91
- with:
92
- ruby-version: ${{ matrix.ruby }}
93
- - name: Setup databases
94
- run: |
95
- psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
96
- - name: Install dependencies
97
- run: bundle install
98
- - name: Run tests
99
- run: bundle exec rspec
@@ -1,35 +0,0 @@
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-22.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
@@ -1,20 +0,0 @@
1
- name: rubocop
2
-
3
- on:
4
- push:
5
- pull_request:
6
-
7
- jobs:
8
- build:
9
- runs-on: ubuntu-22.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.2.2
17
- - name: Install gems
18
- run: bundle install --jobs 4 --retry 3
19
- - name: Run RuboCop
20
- run: bundle exec rubocop --parallel
@@ -1,29 +0,0 @@
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-22.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
@@ -1,131 +0,0 @@
1
- name: test
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- pull_request:
8
-
9
- jobs:
10
- sqlite3:
11
- runs-on: ubuntu-22.04
12
- strategy:
13
- fail-fast: false
14
- matrix:
15
- rails:
16
- - v7.1.0
17
- - v7.0.3
18
- - v6.1.6
19
- ruby:
20
- - 3.2.2
21
- - 3.1.4
22
- - 3.0.6
23
- env:
24
- DB: sqlite3
25
- RAILS: ${{ matrix.rails }}
26
- steps:
27
- - uses: actions/checkout@v2
28
- - name: Set up Ruby
29
- uses: ruby/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby }}
32
- bundler-cache: true
33
- - name: Run tests
34
- run: bundle exec rspec
35
-
36
- mysql:
37
- runs-on: ubuntu-22.04
38
- strategy:
39
- fail-fast: false
40
- matrix:
41
- rails:
42
- - v7.1.0
43
- - v7.0.3
44
- - v6.1.6
45
- ruby:
46
- - 3.2.2
47
- - 3.1.4
48
- - 3.0.6
49
- env:
50
- DB: mysql
51
- RAILS: ${{ matrix.rails }}
52
- MYSQL_USERNAME: root
53
- MYSQL_PASSWORD: root
54
- steps:
55
- - uses: actions/checkout@v2
56
- - name: Set up Ruby
57
- uses: ruby/setup-ruby@v1
58
- with:
59
- ruby-version: ${{ matrix.ruby }}
60
- bundler-cache: true
61
- - name: Startup MySQL
62
- run: |
63
- sudo systemctl start mysql.service
64
- - name: Setup databases
65
- run: |
66
- mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
67
- mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
68
- - name: Run tests
69
- run: bundle exec rspec
70
-
71
- postgres:
72
- runs-on: ubuntu-22.04
73
- strategy:
74
- fail-fast: false
75
- matrix:
76
- rails:
77
- - v7.1.0
78
- - v7.0.3
79
- - v6.1.6
80
- ruby:
81
- - 3.2.2
82
- - 3.1.4
83
- - 3.0.6
84
- env:
85
- DB: postgres
86
- RAILS: ${{ matrix.rails }}
87
- DATABASE_USERNAME: postgres
88
- DATABASE_PASSWORD: postgres
89
- DATABASE_HOST: 127.0.0.1
90
- services:
91
- postgres:
92
- image: postgres
93
- ports:
94
- - 5432:5432
95
- env:
96
- POSTGRES_PASSWORD: postgres
97
- POSTGRES_HOST_AUTH_METHOD: trust
98
- # Set health checks to wait until postgres has started
99
- options: >-
100
- --health-cmd pg_isready
101
- --health-interval 10s
102
- --health-timeout 5s
103
- --health-retries 5
104
-
105
- steps:
106
- - uses: actions/checkout@v2
107
- - name: Set up Ruby
108
- uses: ruby/setup-ruby@v1
109
- with:
110
- ruby-version: ${{ matrix.ruby }}
111
- bundler-cache: true
112
- - name: Setup databases
113
- run: |
114
- psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
115
- - name: Run tests
116
- run: bundle exec rspec
117
-
118
- bug-report-templates:
119
- runs-on: ubuntu-22.04
120
- steps:
121
- - uses: actions/checkout@v2
122
- - name: Set up Ruby
123
- uses: ruby/setup-ruby@v1
124
- with:
125
- ruby-version: 3.2.2
126
- bundler-cache: true
127
- - name: Run bug report templates
128
- run: |
129
- ruby bug_report_templates/test-ransacker-arel-present-predicate.rb
130
- ruby bug_report_templates/test-ransack-scope-and-column-same-name.rb
131
- rm Gemfile Gemfile.lock
data/.gitignore DELETED
@@ -1,7 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
5
- coverage/*
6
- .DS_Store
7
- .byebug_history
data/.nojekyll DELETED
File without changes
data/.rubocop.yml DELETED
@@ -1,50 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 3.0
3
-
4
- DisabledByDefault: true
5
-
6
- Exclude:
7
- - "docs/**/*"
8
-
9
- Layout/EmptyLineAfterMagicComment:
10
- Enabled: true
11
-
12
- Layout/EmptyLineBetweenDefs:
13
- Enabled: true
14
-
15
- Layout/EmptyLines:
16
- Enabled: true
17
-
18
- Layout/FirstArrayElementIndentation:
19
- EnforcedStyle: consistent
20
-
21
- Layout/SpaceAfterComma:
22
- Enabled: true
23
-
24
- Layout/SpaceInsideBlockBraces:
25
- Enabled: true
26
-
27
- Layout/SpaceInsideHashLiteralBraces:
28
- Enabled: true
29
-
30
- Layout/SpaceInsideParens:
31
- Enabled: true
32
-
33
- Layout/TrailingEmptyLines:
34
- Enabled: true
35
-
36
- Style/HashSyntax:
37
- Enabled: true
38
-
39
- Style/RedundantFileExtensionInRequire:
40
- Enabled: true
41
-
42
- Style/RedundantReturn:
43
- Enabled: true
44
-
45
- Style/SelfAssignment:
46
- Enabled: true
47
-
48
- Style/Semicolon:
49
- Enabled: true
50
-