ransack 4.3.0 → 4.4.1
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/README.md +6 -4
- data/lib/polyamorous/polyamorous.rb +1 -1
- data/lib/ransack/adapters/active_record/context.rb +30 -3
- data/lib/ransack/context.rb +3 -0
- data/lib/ransack/helpers/form_builder.rb +6 -7
- data/lib/ransack/helpers/form_helper.rb +86 -20
- data/lib/ransack/locale/ja.yml +51 -51
- data/lib/ransack/locale/ko.yml +6 -6
- data/lib/ransack/locale/uk.yml +72 -0
- data/lib/ransack/nodes/condition.rb +35 -5
- data/lib/ransack/nodes/grouping.rb +1 -1
- data/lib/ransack/nodes/sort.rb +1 -1
- data/lib/ransack/nodes/value.rb +1 -1
- data/lib/ransack/search.rb +1 -1
- data/lib/ransack/version.rb +1 -1
- data/lib/ransack.rb +4 -0
- data/spec/console.rb +3 -15
- data/spec/factories/articles.rb +7 -0
- data/spec/factories/comments.rb +7 -0
- data/spec/factories/notes.rb +13 -0
- data/spec/factories/people.rb +10 -0
- data/spec/factories/tags.rb +5 -0
- data/spec/polyamorous/join_association_spec.rb +0 -1
- data/spec/polyamorous/join_dependency_spec.rb +0 -1
- data/spec/ransack/adapters/active_record/base_spec.rb +139 -2
- data/spec/ransack/adapters/active_record/context_spec.rb +72 -0
- data/spec/ransack/helpers/form_builder_spec.rb +0 -2
- data/spec/ransack/helpers/form_helper_spec.rb +219 -5
- data/spec/ransack/invalid_search_error_spec.rb +27 -0
- data/spec/ransack/nodes/condition_spec.rb +229 -0
- data/spec/ransack/nodes/grouping_spec.rb +2 -2
- data/spec/ransack/nodes/value_spec.rb +12 -1
- data/spec/ransack/predicate_spec.rb +0 -1
- data/spec/ransack/ransacker_spec.rb +69 -0
- data/spec/ransack/search_spec.rb +115 -2
- data/spec/ransack/translate_spec.rb +0 -1
- data/spec/spec_helper.rb +7 -21
- data/spec/support/schema.rb +36 -9
- metadata +51 -93
- data/.github/FUNDING.yml +0 -3
- data/.github/SECURITY.md +0 -12
- data/.github/workflows/codeql.yml +0 -72
- data/.github/workflows/cronjob.yml +0 -141
- data/.github/workflows/deploy.yml +0 -35
- data/.github/workflows/rubocop.yml +0 -20
- data/.github/workflows/test-deploy.yml +0 -29
- data/.github/workflows/test.yml +0 -183
- data/.gitignore +0 -7
- data/.nojekyll +0 -0
- data/.rubocop.yml +0 -50
- data/CHANGELOG.md +0 -1193
- data/CONTRIBUTING.md +0 -171
- data/Gemfile +0 -58
- data/Rakefile +0 -24
- data/bug_report_templates/test-ransack-scope-and-column-same-name.rb +0 -78
- data/bug_report_templates/test-ransacker-arel-present-predicate.rb +0 -75
- data/docs/.gitignore +0 -19
- data/docs/.nojekyll +0 -0
- data/docs/babel.config.js +0 -3
- data/docs/blog/2022-03-27-ransack-3.0.0.md +0 -20
- data/docs/docs/getting-started/_category_.json +0 -4
- data/docs/docs/getting-started/advanced-mode.md +0 -46
- data/docs/docs/getting-started/configuration.md +0 -47
- data/docs/docs/getting-started/search-matches.md +0 -67
- data/docs/docs/getting-started/simple-mode.md +0 -289
- data/docs/docs/getting-started/sorting.md +0 -71
- data/docs/docs/getting-started/using-predicates.md +0 -282
- data/docs/docs/going-further/_category_.json +0 -4
- data/docs/docs/going-further/acts-as-taggable-on.md +0 -114
- data/docs/docs/going-further/associations.md +0 -70
- data/docs/docs/going-further/custom-predicates.md +0 -52
- data/docs/docs/going-further/documentation.md +0 -43
- data/docs/docs/going-further/exporting-to-csv.md +0 -49
- data/docs/docs/going-further/external-guides.md +0 -57
- data/docs/docs/going-further/form-customisation.md +0 -63
- data/docs/docs/going-further/i18n.md +0 -53
- data/docs/docs/going-further/img/create_release.png +0 -0
- data/docs/docs/going-further/merging-searches.md +0 -41
- data/docs/docs/going-further/other-notes.md +0 -425
- data/docs/docs/going-further/polymorphic-search.md +0 -46
- data/docs/docs/going-further/ransackers.md +0 -331
- data/docs/docs/going-further/release_process.md +0 -36
- data/docs/docs/going-further/saving-queries.md +0 -82
- data/docs/docs/going-further/searching-postgres.md +0 -57
- data/docs/docs/going-further/wiki-contributors.md +0 -82
- data/docs/docs/intro.md +0 -99
- data/docs/docusaurus.config.js +0 -120
- data/docs/package.json +0 -42
- data/docs/sidebars.js +0 -31
- data/docs/src/components/HomepageFeatures/index.js +0 -64
- data/docs/src/components/HomepageFeatures/styles.module.css +0 -11
- data/docs/src/css/custom.css +0 -39
- data/docs/src/pages/index.module.css +0 -23
- data/docs/src/pages/markdown-page.md +0 -7
- 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 +0 -1
- 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 +0 -171
- data/docs/static/img/undraw_docusaurus_react.svg +0 -170
- data/docs/static/img/undraw_docusaurus_tree.svg +0 -40
- data/docs/static/logo/ransack-h.png +0 -0
- data/docs/static/logo/ransack-h.svg +0 -34
- data/docs/static/logo/ransack-v.png +0 -0
- data/docs/static/logo/ransack-v.svg +0 -34
- data/docs/static/logo/ransack.png +0 -0
- data/docs/static/logo/ransack.svg +0 -21
- data/docs/yarn.lock +0 -8884
- data/ransack.gemspec +0 -26
- data/spec/blueprints/articles.rb +0 -5
- data/spec/blueprints/comments.rb +0 -5
- data/spec/blueprints/notes.rb +0 -5
- data/spec/blueprints/people.rb +0 -8
- data/spec/blueprints/tags.rb +0 -3
data/spec/support/schema.rb
CHANGED
@@ -116,7 +116,7 @@ class Person < ApplicationRecord
|
|
116
116
|
)
|
117
117
|
end
|
118
118
|
|
119
|
-
ransacker :sql_literal_id do
|
119
|
+
ransacker :sql_literal_id, type: :integer do
|
120
120
|
Arel.sql('people.id')
|
121
121
|
end
|
122
122
|
|
@@ -138,6 +138,17 @@ class Person < ApplicationRecord
|
|
138
138
|
Arel.sql(query)
|
139
139
|
end
|
140
140
|
|
141
|
+
ransacker :article_tags, formatter: proc { |id|
|
142
|
+
if Tag.exists?(id)
|
143
|
+
joins(articles: :tags)
|
144
|
+
.where(tags: { id: id })
|
145
|
+
.distinct
|
146
|
+
.select(:id).arel
|
147
|
+
end
|
148
|
+
} do |parent|
|
149
|
+
parent.table[:id]
|
150
|
+
end
|
151
|
+
|
141
152
|
def self.ransackable_attributes(auth_object = nil)
|
142
153
|
if auth_object == :admin
|
143
154
|
authorizable_ransackable_attributes - ['only_sort']
|
@@ -163,6 +174,7 @@ class Article < ApplicationRecord
|
|
163
174
|
has_many :comments
|
164
175
|
has_and_belongs_to_many :tags
|
165
176
|
has_many :notes, as: :notable
|
177
|
+
has_many :recent_notes, as: :notable
|
166
178
|
|
167
179
|
alias_attribute :content, :body
|
168
180
|
|
@@ -232,18 +244,28 @@ end
|
|
232
244
|
class Comment < ApplicationRecord
|
233
245
|
belongs_to :article
|
234
246
|
belongs_to :person
|
247
|
+
has_and_belongs_to_many :tags
|
235
248
|
|
236
249
|
default_scope { where(disabled: false) }
|
237
250
|
end
|
238
251
|
|
239
252
|
class Tag < ApplicationRecord
|
240
253
|
has_and_belongs_to_many :articles
|
254
|
+
has_and_belongs_to_many :comments
|
241
255
|
end
|
242
256
|
|
243
257
|
class Note < ApplicationRecord
|
244
258
|
belongs_to :notable, polymorphic: true
|
245
259
|
end
|
246
260
|
|
261
|
+
class RecentNote < ApplicationRecord
|
262
|
+
DEFAULT_NOTABLE_ID = 1
|
263
|
+
self.table_name = "notes"
|
264
|
+
default_scope { where(notable_id: DEFAULT_NOTABLE_ID) }
|
265
|
+
|
266
|
+
belongs_to :notable, polymorphic: true
|
267
|
+
end
|
268
|
+
|
247
269
|
class Account < ApplicationRecord
|
248
270
|
belongs_to :agent_account, class_name: "Account"
|
249
271
|
belongs_to :trade_account, class_name: "Account"
|
@@ -310,6 +332,11 @@ module Schema
|
|
310
332
|
t.integer :tag_id
|
311
333
|
end
|
312
334
|
|
335
|
+
create_table :comments_tags, force: true, id: false do |t|
|
336
|
+
t.integer :comment_id
|
337
|
+
t.integer :tag_id
|
338
|
+
end
|
339
|
+
|
313
340
|
create_table :notes, force: true do |t|
|
314
341
|
t.integer :notable_id
|
315
342
|
t.string :notable_type
|
@@ -343,23 +370,23 @@ module Schema
|
|
343
370
|
end
|
344
371
|
|
345
372
|
10.times do
|
346
|
-
person =
|
347
|
-
|
373
|
+
person = FactoryBot.create(:person)
|
374
|
+
FactoryBot.create(:note, :for_person, notable: person)
|
348
375
|
3.times do
|
349
|
-
article =
|
376
|
+
article = FactoryBot.create(:article, person: person)
|
350
377
|
3.times do
|
351
|
-
article.tags = [
|
378
|
+
article.tags = [FactoryBot.create(:tag), FactoryBot.create(:tag), FactoryBot.create(:tag)]
|
352
379
|
end
|
353
|
-
|
380
|
+
FactoryBot.create(:note, :for_article, notable: article)
|
354
381
|
10.times do
|
355
|
-
|
382
|
+
FactoryBot.create(:comment, article: article, person: person)
|
356
383
|
end
|
357
384
|
end
|
358
385
|
end
|
359
386
|
|
360
|
-
|
387
|
+
FactoryBot.create(:comment,
|
361
388
|
body: 'First post!',
|
362
|
-
article:
|
389
|
+
article: FactoryBot.create(:article, title: 'Hello, world!')
|
363
390
|
)
|
364
391
|
end
|
365
392
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ransack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernie Miller
|
@@ -9,10 +9,9 @@ authors:
|
|
9
9
|
- Jon Atack
|
10
10
|
- Sean Carroll
|
11
11
|
- David Rodríguez
|
12
|
-
autorequire:
|
13
12
|
bindir: bin
|
14
13
|
cert_chain: []
|
15
|
-
date: 2025-
|
14
|
+
date: 2025-09-29 00:00:00.000000000 Z
|
16
15
|
dependencies:
|
17
16
|
- !ruby/object:Gem::Dependency
|
18
17
|
name: activerecord
|
@@ -20,28 +19,28 @@ dependencies:
|
|
20
19
|
requirements:
|
21
20
|
- - ">="
|
22
21
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
22
|
+
version: '7.2'
|
24
23
|
type: :runtime
|
25
24
|
prerelease: false
|
26
25
|
version_requirements: !ruby/object:Gem::Requirement
|
27
26
|
requirements:
|
28
27
|
- - ">="
|
29
28
|
- !ruby/object:Gem::Version
|
30
|
-
version:
|
29
|
+
version: '7.2'
|
31
30
|
- !ruby/object:Gem::Dependency
|
32
31
|
name: activesupport
|
33
32
|
requirement: !ruby/object:Gem::Requirement
|
34
33
|
requirements:
|
35
34
|
- - ">="
|
36
35
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
36
|
+
version: '7.2'
|
38
37
|
type: :runtime
|
39
38
|
prerelease: false
|
40
39
|
version_requirements: !ruby/object:Gem::Requirement
|
41
40
|
requirements:
|
42
41
|
- - ">="
|
43
42
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
43
|
+
version: '7.2'
|
45
44
|
- !ruby/object:Gem::Dependency
|
46
45
|
name: i18n
|
47
46
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,90 +55,20 @@ dependencies:
|
|
56
55
|
- - ">="
|
57
56
|
- !ruby/object:Gem::Version
|
58
57
|
version: '0'
|
59
|
-
description:
|
60
|
-
|
58
|
+
description: Powerful object-based searching and filtering for Active Record with
|
59
|
+
advanced features like complex boolean queries, association searching, custom predicates
|
60
|
+
and i18n support.
|
61
61
|
email:
|
62
62
|
- ernie@erniemiller.org
|
63
63
|
- radarlistener@gmail.com
|
64
64
|
- jonnyatack@gmail.com
|
65
|
-
-
|
65
|
+
- magma.craters2h@icloud.com
|
66
66
|
executables: []
|
67
67
|
extensions: []
|
68
68
|
extra_rdoc_files: []
|
69
69
|
files:
|
70
|
-
- ".github/FUNDING.yml"
|
71
|
-
- ".github/SECURITY.md"
|
72
|
-
- ".github/workflows/codeql.yml"
|
73
|
-
- ".github/workflows/cronjob.yml"
|
74
|
-
- ".github/workflows/deploy.yml"
|
75
|
-
- ".github/workflows/rubocop.yml"
|
76
|
-
- ".github/workflows/test-deploy.yml"
|
77
|
-
- ".github/workflows/test.yml"
|
78
|
-
- ".gitignore"
|
79
|
-
- ".nojekyll"
|
80
|
-
- ".rubocop.yml"
|
81
|
-
- CHANGELOG.md
|
82
|
-
- CONTRIBUTING.md
|
83
|
-
- Gemfile
|
84
70
|
- LICENSE
|
85
71
|
- README.md
|
86
|
-
- Rakefile
|
87
|
-
- bug_report_templates/test-ransack-scope-and-column-same-name.rb
|
88
|
-
- bug_report_templates/test-ransacker-arel-present-predicate.rb
|
89
|
-
- docs/.gitignore
|
90
|
-
- docs/.nojekyll
|
91
|
-
- docs/babel.config.js
|
92
|
-
- docs/blog/2022-03-27-ransack-3.0.0.md
|
93
|
-
- docs/docs/getting-started/_category_.json
|
94
|
-
- docs/docs/getting-started/advanced-mode.md
|
95
|
-
- docs/docs/getting-started/configuration.md
|
96
|
-
- docs/docs/getting-started/search-matches.md
|
97
|
-
- docs/docs/getting-started/simple-mode.md
|
98
|
-
- docs/docs/getting-started/sorting.md
|
99
|
-
- docs/docs/getting-started/using-predicates.md
|
100
|
-
- docs/docs/going-further/_category_.json
|
101
|
-
- docs/docs/going-further/acts-as-taggable-on.md
|
102
|
-
- docs/docs/going-further/associations.md
|
103
|
-
- docs/docs/going-further/custom-predicates.md
|
104
|
-
- docs/docs/going-further/documentation.md
|
105
|
-
- docs/docs/going-further/exporting-to-csv.md
|
106
|
-
- docs/docs/going-further/external-guides.md
|
107
|
-
- docs/docs/going-further/form-customisation.md
|
108
|
-
- docs/docs/going-further/i18n.md
|
109
|
-
- docs/docs/going-further/img/create_release.png
|
110
|
-
- docs/docs/going-further/merging-searches.md
|
111
|
-
- docs/docs/going-further/other-notes.md
|
112
|
-
- docs/docs/going-further/polymorphic-search.md
|
113
|
-
- docs/docs/going-further/ransackers.md
|
114
|
-
- docs/docs/going-further/release_process.md
|
115
|
-
- docs/docs/going-further/saving-queries.md
|
116
|
-
- docs/docs/going-further/searching-postgres.md
|
117
|
-
- docs/docs/going-further/wiki-contributors.md
|
118
|
-
- docs/docs/intro.md
|
119
|
-
- docs/docusaurus.config.js
|
120
|
-
- docs/package.json
|
121
|
-
- docs/sidebars.js
|
122
|
-
- docs/src/components/HomepageFeatures/index.js
|
123
|
-
- docs/src/components/HomepageFeatures/styles.module.css
|
124
|
-
- docs/src/css/custom.css
|
125
|
-
- docs/src/pages/index.module.css
|
126
|
-
- docs/src/pages/markdown-page.md
|
127
|
-
- docs/static/.nojekyll
|
128
|
-
- docs/static/img/docusaurus.png
|
129
|
-
- docs/static/img/favicon.ico
|
130
|
-
- docs/static/img/logo.svg
|
131
|
-
- docs/static/img/tutorial/docsVersionDropdown.png
|
132
|
-
- docs/static/img/tutorial/localeDropdown.png
|
133
|
-
- docs/static/img/undraw_docusaurus_mountain.svg
|
134
|
-
- docs/static/img/undraw_docusaurus_react.svg
|
135
|
-
- docs/static/img/undraw_docusaurus_tree.svg
|
136
|
-
- docs/static/logo/ransack-h.png
|
137
|
-
- docs/static/logo/ransack-h.svg
|
138
|
-
- docs/static/logo/ransack-v.png
|
139
|
-
- docs/static/logo/ransack-v.svg
|
140
|
-
- docs/static/logo/ransack.png
|
141
|
-
- docs/static/logo/ransack.svg
|
142
|
-
- docs/yarn.lock
|
143
72
|
- lib/polyamorous/activerecord/join_association.rb
|
144
73
|
- lib/polyamorous/activerecord/join_association_7_2.rb
|
145
74
|
- lib/polyamorous/activerecord/join_dependency.rb
|
@@ -184,6 +113,7 @@ files:
|
|
184
113
|
- lib/ransack/locale/sk.yml
|
185
114
|
- lib/ransack/locale/sv.yml
|
186
115
|
- lib/ransack/locale/tr.yml
|
116
|
+
- lib/ransack/locale/uk.yml
|
187
117
|
- lib/ransack/locale/zh-CN.yml
|
188
118
|
- lib/ransack/locale/zh-TW.yml
|
189
119
|
- lib/ransack/naming.rb
|
@@ -200,13 +130,12 @@ files:
|
|
200
130
|
- lib/ransack/translate.rb
|
201
131
|
- lib/ransack/version.rb
|
202
132
|
- lib/ransack/visitor.rb
|
203
|
-
- ransack.gemspec
|
204
|
-
- spec/blueprints/articles.rb
|
205
|
-
- spec/blueprints/comments.rb
|
206
|
-
- spec/blueprints/notes.rb
|
207
|
-
- spec/blueprints/people.rb
|
208
|
-
- spec/blueprints/tags.rb
|
209
133
|
- spec/console.rb
|
134
|
+
- spec/factories/articles.rb
|
135
|
+
- spec/factories/comments.rb
|
136
|
+
- spec/factories/notes.rb
|
137
|
+
- spec/factories/people.rb
|
138
|
+
- spec/factories/tags.rb
|
210
139
|
- spec/helpers/polyamorous_helper.rb
|
211
140
|
- spec/helpers/ransack_helper.rb
|
212
141
|
- spec/polyamorous/activerecord_compatibility_spec.rb
|
@@ -218,10 +147,12 @@ files:
|
|
218
147
|
- spec/ransack/configuration_spec.rb
|
219
148
|
- spec/ransack/helpers/form_builder_spec.rb
|
220
149
|
- spec/ransack/helpers/form_helper_spec.rb
|
150
|
+
- spec/ransack/invalid_search_error_spec.rb
|
221
151
|
- spec/ransack/nodes/condition_spec.rb
|
222
152
|
- spec/ransack/nodes/grouping_spec.rb
|
223
153
|
- spec/ransack/nodes/value_spec.rb
|
224
154
|
- spec/ransack/predicate_spec.rb
|
155
|
+
- spec/ransack/ransacker_spec.rb
|
225
156
|
- spec/ransack/search_spec.rb
|
226
157
|
- spec/ransack/translate_spec.rb
|
227
158
|
- spec/spec_helper.rb
|
@@ -230,8 +161,8 @@ files:
|
|
230
161
|
homepage: https://github.com/activerecord-hackery/ransack
|
231
162
|
licenses:
|
232
163
|
- MIT
|
233
|
-
metadata:
|
234
|
-
|
164
|
+
metadata:
|
165
|
+
changelog_uri: https://github.com/activerecord-hackery/ransack/blob/main/CHANGELOG.md
|
235
166
|
rdoc_options: []
|
236
167
|
require_paths:
|
237
168
|
- lib
|
@@ -239,15 +170,42 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
239
170
|
requirements:
|
240
171
|
- - ">="
|
241
172
|
- !ruby/object:Gem::Version
|
242
|
-
version: '3.
|
173
|
+
version: '3.1'
|
243
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
244
175
|
requirements:
|
245
176
|
- - ">="
|
246
177
|
- !ruby/object:Gem::Version
|
247
178
|
version: '0'
|
248
179
|
requirements: []
|
249
|
-
rubygems_version: 3.
|
250
|
-
signing_key:
|
180
|
+
rubygems_version: 3.6.2
|
251
181
|
specification_version: 4
|
252
182
|
summary: Object-based searching for Active Record.
|
253
|
-
test_files:
|
183
|
+
test_files:
|
184
|
+
- spec/console.rb
|
185
|
+
- spec/factories/articles.rb
|
186
|
+
- spec/factories/comments.rb
|
187
|
+
- spec/factories/notes.rb
|
188
|
+
- spec/factories/people.rb
|
189
|
+
- spec/factories/tags.rb
|
190
|
+
- spec/helpers/polyamorous_helper.rb
|
191
|
+
- spec/helpers/ransack_helper.rb
|
192
|
+
- spec/polyamorous/activerecord_compatibility_spec.rb
|
193
|
+
- spec/polyamorous/join_association_spec.rb
|
194
|
+
- spec/polyamorous/join_dependency_spec.rb
|
195
|
+
- spec/polyamorous/join_spec.rb
|
196
|
+
- spec/ransack/adapters/active_record/base_spec.rb
|
197
|
+
- spec/ransack/adapters/active_record/context_spec.rb
|
198
|
+
- spec/ransack/configuration_spec.rb
|
199
|
+
- spec/ransack/helpers/form_builder_spec.rb
|
200
|
+
- spec/ransack/helpers/form_helper_spec.rb
|
201
|
+
- spec/ransack/invalid_search_error_spec.rb
|
202
|
+
- spec/ransack/nodes/condition_spec.rb
|
203
|
+
- spec/ransack/nodes/grouping_spec.rb
|
204
|
+
- spec/ransack/nodes/value_spec.rb
|
205
|
+
- spec/ransack/predicate_spec.rb
|
206
|
+
- spec/ransack/ransacker_spec.rb
|
207
|
+
- spec/ransack/search_spec.rb
|
208
|
+
- spec/ransack/translate_spec.rb
|
209
|
+
- spec/spec_helper.rb
|
210
|
+
- spec/support/en.yml
|
211
|
+
- spec/support/schema.rb
|
data/.github/FUNDING.yml
DELETED
data/.github/SECURITY.md
DELETED
@@ -1,12 +0,0 @@
|
|
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.
|
@@ -1,72 +0,0 @@
|
|
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
|
@@ -1,141 +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
|
-
postgis:
|
60
|
-
runs-on: ubuntu-22.04
|
61
|
-
strategy:
|
62
|
-
fail-fast: false
|
63
|
-
matrix:
|
64
|
-
ruby:
|
65
|
-
- 3.2.2
|
66
|
-
env:
|
67
|
-
DB: postgis
|
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
|
100
|
-
|
101
|
-
postgres:
|
102
|
-
runs-on: ubuntu-22.04
|
103
|
-
strategy:
|
104
|
-
fail-fast: false
|
105
|
-
matrix:
|
106
|
-
ruby:
|
107
|
-
- 3.2.2
|
108
|
-
env:
|
109
|
-
DB: postgres
|
110
|
-
RAILS: main
|
111
|
-
DATABASE_USERNAME: postgres
|
112
|
-
DATABASE_PASSWORD: postgres
|
113
|
-
DATABASE_HOST: 127.0.0.1
|
114
|
-
services:
|
115
|
-
postgres:
|
116
|
-
image: postgres
|
117
|
-
ports:
|
118
|
-
- 5432:5432
|
119
|
-
env:
|
120
|
-
POSTGRES_PASSWORD: postgres
|
121
|
-
POSTGRES_HOST_AUTH_METHOD: trust
|
122
|
-
# Set health checks to wait until postgres has started
|
123
|
-
options: >-
|
124
|
-
--health-cmd pg_isready
|
125
|
-
--health-interval 10s
|
126
|
-
--health-timeout 5s
|
127
|
-
--health-retries 5
|
128
|
-
|
129
|
-
steps:
|
130
|
-
- uses: actions/checkout@v2
|
131
|
-
- name: Set up Ruby
|
132
|
-
uses: ruby/setup-ruby@v1
|
133
|
-
with:
|
134
|
-
ruby-version: ${{ matrix.ruby }}
|
135
|
-
- name: Setup databases
|
136
|
-
run: |
|
137
|
-
psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
|
138
|
-
- name: Install dependencies
|
139
|
-
run: bundle install
|
140
|
-
- name: Run tests
|
141
|
-
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
|