ransack 4.3.0 → 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 (104) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -2
  3. data/lib/polyamorous/polyamorous.rb +1 -1
  4. data/lib/ransack/adapters/active_record/context.rb +30 -3
  5. data/lib/ransack/context.rb +3 -0
  6. data/lib/ransack/helpers/form_builder.rb +6 -7
  7. data/lib/ransack/helpers/form_helper.rb +86 -20
  8. data/lib/ransack/locale/ja.yml +51 -51
  9. data/lib/ransack/locale/ko.yml +6 -6
  10. data/lib/ransack/locale/uk.yml +72 -0
  11. data/lib/ransack/nodes/condition.rb +36 -6
  12. data/lib/ransack/nodes/grouping.rb +1 -1
  13. data/lib/ransack/nodes/sort.rb +1 -1
  14. data/lib/ransack/nodes/value.rb +9 -1
  15. data/lib/ransack/search.rb +1 -1
  16. data/lib/ransack/version.rb +1 -1
  17. data/lib/ransack.rb +8 -0
  18. data/spec/polyamorous/join_association_spec.rb +0 -1
  19. data/spec/polyamorous/join_dependency_spec.rb +0 -1
  20. data/spec/ransack/adapters/active_record/base_spec.rb +101 -2
  21. data/spec/ransack/adapters/active_record/context_spec.rb +72 -0
  22. data/spec/ransack/helpers/form_builder_spec.rb +0 -2
  23. data/spec/ransack/helpers/form_helper_spec.rb +219 -5
  24. data/spec/ransack/nodes/condition_spec.rb +229 -0
  25. data/spec/ransack/nodes/grouping_spec.rb +2 -2
  26. data/spec/ransack/nodes/value_spec.rb +12 -1
  27. data/spec/ransack/predicate_spec.rb +0 -1
  28. data/spec/ransack/search_spec.rb +107 -1
  29. data/spec/ransack/translate_spec.rb +0 -1
  30. data/spec/spec_helper.rb +2 -3
  31. data/spec/support/schema.rb +30 -0
  32. metadata +41 -87
  33. data/.github/FUNDING.yml +0 -3
  34. data/.github/SECURITY.md +0 -12
  35. data/.github/workflows/codeql.yml +0 -72
  36. data/.github/workflows/cronjob.yml +0 -141
  37. data/.github/workflows/deploy.yml +0 -35
  38. data/.github/workflows/rubocop.yml +0 -20
  39. data/.github/workflows/test-deploy.yml +0 -29
  40. data/.github/workflows/test.yml +0 -183
  41. data/.gitignore +0 -7
  42. data/.nojekyll +0 -0
  43. data/.rubocop.yml +0 -50
  44. data/CHANGELOG.md +0 -1193
  45. data/CONTRIBUTING.md +0 -171
  46. data/Gemfile +0 -58
  47. data/Rakefile +0 -24
  48. data/bug_report_templates/test-ransack-scope-and-column-same-name.rb +0 -78
  49. data/bug_report_templates/test-ransacker-arel-present-predicate.rb +0 -75
  50. data/docs/.gitignore +0 -19
  51. data/docs/.nojekyll +0 -0
  52. data/docs/babel.config.js +0 -3
  53. data/docs/blog/2022-03-27-ransack-3.0.0.md +0 -20
  54. data/docs/docs/getting-started/_category_.json +0 -4
  55. data/docs/docs/getting-started/advanced-mode.md +0 -46
  56. data/docs/docs/getting-started/configuration.md +0 -47
  57. data/docs/docs/getting-started/search-matches.md +0 -67
  58. data/docs/docs/getting-started/simple-mode.md +0 -289
  59. data/docs/docs/getting-started/sorting.md +0 -71
  60. data/docs/docs/getting-started/using-predicates.md +0 -282
  61. data/docs/docs/going-further/_category_.json +0 -4
  62. data/docs/docs/going-further/acts-as-taggable-on.md +0 -114
  63. data/docs/docs/going-further/associations.md +0 -70
  64. data/docs/docs/going-further/custom-predicates.md +0 -52
  65. data/docs/docs/going-further/documentation.md +0 -43
  66. data/docs/docs/going-further/exporting-to-csv.md +0 -49
  67. data/docs/docs/going-further/external-guides.md +0 -57
  68. data/docs/docs/going-further/form-customisation.md +0 -63
  69. data/docs/docs/going-further/i18n.md +0 -53
  70. data/docs/docs/going-further/img/create_release.png +0 -0
  71. data/docs/docs/going-further/merging-searches.md +0 -41
  72. data/docs/docs/going-further/other-notes.md +0 -425
  73. data/docs/docs/going-further/polymorphic-search.md +0 -46
  74. data/docs/docs/going-further/ransackers.md +0 -331
  75. data/docs/docs/going-further/release_process.md +0 -36
  76. data/docs/docs/going-further/saving-queries.md +0 -82
  77. data/docs/docs/going-further/searching-postgres.md +0 -57
  78. data/docs/docs/going-further/wiki-contributors.md +0 -82
  79. data/docs/docs/intro.md +0 -99
  80. data/docs/docusaurus.config.js +0 -120
  81. data/docs/package.json +0 -42
  82. data/docs/sidebars.js +0 -31
  83. data/docs/src/components/HomepageFeatures/index.js +0 -64
  84. data/docs/src/components/HomepageFeatures/styles.module.css +0 -11
  85. data/docs/src/css/custom.css +0 -39
  86. data/docs/src/pages/index.module.css +0 -23
  87. data/docs/src/pages/markdown-page.md +0 -7
  88. data/docs/static/.nojekyll +0 -0
  89. data/docs/static/img/docusaurus.png +0 -0
  90. data/docs/static/img/favicon.ico +0 -0
  91. data/docs/static/img/logo.svg +0 -1
  92. data/docs/static/img/tutorial/docsVersionDropdown.png +0 -0
  93. data/docs/static/img/tutorial/localeDropdown.png +0 -0
  94. data/docs/static/img/undraw_docusaurus_mountain.svg +0 -171
  95. data/docs/static/img/undraw_docusaurus_react.svg +0 -170
  96. data/docs/static/img/undraw_docusaurus_tree.svg +0 -40
  97. data/docs/static/logo/ransack-h.png +0 -0
  98. data/docs/static/logo/ransack-h.svg +0 -34
  99. data/docs/static/logo/ransack-v.png +0 -0
  100. data/docs/static/logo/ransack-v.svg +0 -34
  101. data/docs/static/logo/ransack.png +0 -0
  102. data/docs/static/logo/ransack.svg +0 -21
  103. data/docs/yarn.lock +0 -8884
  104. data/ransack.gemspec +0 -26
@@ -1,183 +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-latest
12
- strategy:
13
- fail-fast: false
14
- matrix:
15
- rails:
16
- - 8-0-stable
17
- - v7.2.2
18
- - v7.1.0
19
- ruby:
20
- - 3.2.2
21
- - 3.1.4
22
- exclude:
23
- - rails: 8-0-stable
24
- ruby: 3.1.4
25
- env:
26
- DB: sqlite3
27
- RAILS: ${{ matrix.rails }}
28
- steps:
29
- - uses: actions/checkout@v2
30
- - name: Set up Ruby
31
- uses: ruby/setup-ruby@v1
32
- with:
33
- ruby-version: ${{ matrix.ruby }}
34
- bundler-cache: true
35
- - name: Run tests
36
- run: bundle exec rspec
37
-
38
- mysql:
39
- runs-on: ubuntu-latest
40
- strategy:
41
- fail-fast: false
42
- matrix:
43
- rails:
44
- - 8-0-stable
45
- - 7-2-stable
46
- - v7.1.0
47
- ruby:
48
- - 3.2.2
49
- - 3.1.4
50
- exclude:
51
- - rails: 8-0-stable
52
- ruby: 3.1.4
53
-
54
- env:
55
- DB: mysql
56
- RAILS: ${{ matrix.rails }}
57
- MYSQL_USERNAME: root
58
- MYSQL_PASSWORD: root
59
- steps:
60
- - uses: actions/checkout@v2
61
- - name: Set up Ruby
62
- uses: ruby/setup-ruby@v1
63
- with:
64
- ruby-version: ${{ matrix.ruby }}
65
- bundler-cache: true
66
- - name: Startup MySQL
67
- run: |
68
- sudo systemctl start mysql.service
69
- - name: Setup databases
70
- run: |
71
- mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
72
- mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
73
- - name: Run tests
74
- run: bundle exec rspec
75
-
76
- postgis:
77
- runs-on: ubuntu-22.04
78
- strategy:
79
- fail-fast: false
80
- matrix:
81
- rails:
82
- - 7-2-stable
83
- - v7.1.0
84
- ruby:
85
- - 3.2.2
86
- - 3.1.4
87
- env:
88
- DB: postgis
89
- RAILS: ${{ matrix.rails }}
90
- DATABASE_USERNAME: postgres
91
- DATABASE_PASSWORD: postgres
92
- DATABASE_HOST: 127.0.0.1
93
- services:
94
- postgres:
95
- image: postgres
96
- ports:
97
- - 5432:5432
98
- env:
99
- POSTGRES_PASSWORD: postgres
100
- POSTGRES_HOST_AUTH_METHOD: trust
101
- # Set health checks to wait until postgres has started
102
- options: >-
103
- --health-cmd pg_isready
104
- --health-interval 10s
105
- --health-timeout 5s
106
- --health-retries 5
107
-
108
- steps:
109
- - uses: actions/checkout@v2
110
- - name: Set up Ruby
111
- uses: ruby/setup-ruby@v1
112
- with:
113
- ruby-version: ${{ matrix.ruby }}
114
- bundler-cache: true
115
- - name: Setup databases
116
- run: |
117
- psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
118
- - name: Run tests
119
- run: bundle exec rspec
120
-
121
- postgres:
122
- runs-on: ubuntu-latest
123
- strategy:
124
- fail-fast: false
125
- matrix:
126
- rails:
127
- - 8-0-stable
128
- - 7-2-stable
129
- - v7.1.0
130
- ruby:
131
- - 3.2.2
132
- - 3.1.4
133
- exclude:
134
- - rails: 8-0-stable
135
- ruby: 3.1.4
136
- env:
137
- DB: postgres
138
- RAILS: ${{ matrix.rails }}
139
- DATABASE_USERNAME: postgres
140
- DATABASE_PASSWORD: postgres
141
- DATABASE_HOST: 127.0.0.1
142
- services:
143
- postgres:
144
- image: postgres
145
- ports:
146
- - 5432:5432
147
- env:
148
- POSTGRES_PASSWORD: postgres
149
- POSTGRES_HOST_AUTH_METHOD: trust
150
- # Set health checks to wait until postgres has started
151
- options: >-
152
- --health-cmd pg_isready
153
- --health-interval 10s
154
- --health-timeout 5s
155
- --health-retries 5
156
-
157
- steps:
158
- - uses: actions/checkout@v2
159
- - name: Set up Ruby
160
- uses: ruby/setup-ruby@v1
161
- with:
162
- ruby-version: ${{ matrix.ruby }}
163
- bundler-cache: true
164
- - name: Setup databases
165
- run: |
166
- psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
167
- - name: Run tests
168
- run: bundle exec rspec
169
-
170
- bug-report-templates:
171
- runs-on: ubuntu-latest
172
- steps:
173
- - uses: actions/checkout@v2
174
- - name: Set up Ruby
175
- uses: ruby/setup-ruby@v1
176
- with:
177
- ruby-version: 3.2.2
178
- bundler-cache: true
179
- - name: Run bug report templates
180
- run: |
181
- ruby bug_report_templates/test-ransacker-arel-present-predicate.rb
182
- ruby bug_report_templates/test-ransack-scope-and-column-same-name.rb
183
- 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
-