ransack 2.3.0 → 4.1.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 (159) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +3 -0
  3. data/.github/SECURITY.md +12 -0
  4. data/.github/workflows/codeql.yml +72 -0
  5. data/.github/workflows/cronjob.yml +99 -0
  6. data/.github/workflows/deploy.yml +35 -0
  7. data/.github/workflows/rubocop.yml +20 -0
  8. data/.github/workflows/test-deploy.yml +29 -0
  9. data/.github/workflows/test.yml +131 -0
  10. data/.nojekyll +0 -0
  11. data/.rubocop.yml +50 -0
  12. data/CHANGELOG.md +263 -1
  13. data/CONTRIBUTING.md +51 -29
  14. data/Gemfile +24 -10
  15. data/README.md +49 -917
  16. data/bug_report_templates/test-ransack-scope-and-column-same-name.rb +78 -0
  17. data/bug_report_templates/test-ransacker-arel-present-predicate.rb +75 -0
  18. data/docs/.gitignore +19 -0
  19. data/docs/.nojekyll +0 -0
  20. data/docs/babel.config.js +3 -0
  21. data/docs/blog/2022-03-27-ransack-3.0.0.md +20 -0
  22. data/docs/docs/getting-started/_category_.json +4 -0
  23. data/docs/docs/getting-started/advanced-mode.md +46 -0
  24. data/docs/docs/getting-started/configuration.md +47 -0
  25. data/docs/docs/getting-started/search-matches.md +67 -0
  26. data/docs/docs/getting-started/simple-mode.md +288 -0
  27. data/docs/docs/getting-started/sorting.md +71 -0
  28. data/docs/docs/getting-started/using-predicates.md +282 -0
  29. data/docs/docs/going-further/_category_.json +4 -0
  30. data/docs/docs/going-further/acts-as-taggable-on.md +114 -0
  31. data/docs/docs/going-further/associations.md +70 -0
  32. data/docs/docs/going-further/custom-predicates.md +52 -0
  33. data/docs/docs/going-further/documentation.md +43 -0
  34. data/docs/docs/going-further/exporting-to-csv.md +49 -0
  35. data/docs/docs/going-further/external-guides.md +57 -0
  36. data/docs/docs/going-further/form-customisation.md +63 -0
  37. data/docs/docs/going-further/i18n.md +53 -0
  38. data/docs/docs/going-further/img/create_release.png +0 -0
  39. data/docs/docs/going-further/merging-searches.md +41 -0
  40. data/docs/docs/going-further/other-notes.md +428 -0
  41. data/docs/docs/going-further/polymorphic-search.md +46 -0
  42. data/docs/docs/going-further/ransackers.md +331 -0
  43. data/docs/docs/going-further/release_process.md +36 -0
  44. data/docs/docs/going-further/saving-queries.md +82 -0
  45. data/docs/docs/going-further/searching-postgres.md +57 -0
  46. data/docs/docs/going-further/wiki-contributors.md +82 -0
  47. data/docs/docs/intro.md +99 -0
  48. data/docs/docusaurus.config.js +120 -0
  49. data/docs/package.json +42 -0
  50. data/docs/sidebars.js +31 -0
  51. data/docs/src/components/HomepageFeatures/index.js +64 -0
  52. data/docs/src/components/HomepageFeatures/styles.module.css +11 -0
  53. data/docs/src/css/custom.css +39 -0
  54. data/docs/src/pages/index.module.css +23 -0
  55. data/docs/src/pages/markdown-page.md +7 -0
  56. data/docs/static/.nojekyll +0 -0
  57. data/docs/static/img/docusaurus.png +0 -0
  58. data/docs/static/img/favicon.ico +0 -0
  59. data/docs/static/img/logo.svg +1 -0
  60. data/docs/static/img/tutorial/docsVersionDropdown.png +0 -0
  61. data/docs/static/img/tutorial/localeDropdown.png +0 -0
  62. data/docs/static/img/undraw_docusaurus_mountain.svg +171 -0
  63. data/docs/static/img/undraw_docusaurus_react.svg +170 -0
  64. data/docs/static/img/undraw_docusaurus_tree.svg +40 -0
  65. data/docs/yarn.lock +8879 -0
  66. data/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +70 -0
  67. data/{polyamorous/lib/polyamorous/activerecord_6.0_ruby_2 → lib/polyamorous/activerecord_6.1_ruby_2}/join_dependency.rb +33 -12
  68. data/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +11 -0
  69. data/lib/polyamorous/activerecord_7.0_ruby_2/join_association.rb +1 -0
  70. data/lib/polyamorous/activerecord_7.0_ruby_2/join_dependency.rb +1 -0
  71. data/lib/polyamorous/activerecord_7.0_ruby_2/reflection.rb +1 -0
  72. data/lib/polyamorous/activerecord_7.1_ruby_2/join_association.rb +1 -0
  73. data/lib/polyamorous/activerecord_7.1_ruby_2/join_dependency.rb +1 -0
  74. data/lib/polyamorous/activerecord_7.1_ruby_2/reflection.rb +1 -0
  75. data/{polyamorous/lib → lib/polyamorous}/polyamorous.rb +3 -8
  76. data/lib/ransack/adapters/active_record/base.rb +83 -10
  77. data/lib/ransack/adapters/active_record/context.rb +61 -116
  78. data/lib/ransack/configuration.rb +53 -10
  79. data/lib/ransack/constants.rb +126 -7
  80. data/lib/ransack/context.rb +34 -5
  81. data/lib/ransack/helpers/form_builder.rb +11 -17
  82. data/lib/ransack/helpers/form_helper.rb +14 -5
  83. data/lib/ransack/helpers.rb +1 -1
  84. data/lib/ransack/locale/sk.yml +70 -0
  85. data/lib/ransack/locale/sv.yml +70 -0
  86. data/lib/ransack/nodes/attribute.rb +3 -3
  87. data/lib/ransack/nodes/condition.rb +87 -8
  88. data/lib/ransack/nodes/grouping.rb +4 -4
  89. data/lib/ransack/nodes/node.rb +1 -1
  90. data/lib/ransack/nodes/sort.rb +3 -3
  91. data/lib/ransack/nodes/value.rb +3 -3
  92. data/lib/ransack/predicate.rb +3 -2
  93. data/lib/ransack/ransacker.rb +1 -1
  94. data/lib/ransack/search.rb +15 -7
  95. data/lib/ransack/translate.rb +6 -6
  96. data/lib/ransack/version.rb +1 -1
  97. data/lib/ransack/visitor.rb +38 -2
  98. data/lib/ransack.rb +6 -10
  99. data/ransack.gemspec +9 -24
  100. data/spec/blueprints/articles.rb +1 -1
  101. data/spec/blueprints/comments.rb +1 -1
  102. data/spec/blueprints/notes.rb +1 -1
  103. data/spec/blueprints/tags.rb +1 -1
  104. data/spec/console.rb +5 -5
  105. data/spec/helpers/polyamorous_helper.rb +2 -17
  106. data/spec/helpers/ransack_helper.rb +1 -1
  107. data/spec/polyamorous/activerecord_compatibility_spec.rb +15 -0
  108. data/spec/{ransack → polyamorous}/join_association_spec.rb +3 -1
  109. data/spec/{ransack → polyamorous}/join_dependency_spec.rb +0 -16
  110. data/spec/ransack/adapters/active_record/base_spec.rb +125 -16
  111. data/spec/ransack/adapters/active_record/context_spec.rb +19 -18
  112. data/spec/ransack/configuration_spec.rb +33 -9
  113. data/spec/ransack/helpers/form_builder_spec.rb +8 -8
  114. data/spec/ransack/helpers/form_helper_spec.rb +109 -20
  115. data/spec/ransack/nodes/condition_spec.rb +37 -0
  116. data/spec/ransack/nodes/grouping_spec.rb +2 -2
  117. data/spec/ransack/nodes/value_spec.rb +115 -0
  118. data/spec/ransack/predicate_spec.rb +75 -2
  119. data/spec/ransack/search_spec.rb +239 -38
  120. data/spec/ransack/translate_spec.rb +1 -1
  121. data/spec/spec_helper.rb +9 -5
  122. data/spec/support/schema.rb +111 -12
  123. metadata +105 -195
  124. data/.travis.yml +0 -49
  125. data/lib/ransack/adapters/active_record/ransack/constants.rb +0 -116
  126. data/lib/ransack/adapters/active_record/ransack/context.rb +0 -60
  127. data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +0 -61
  128. data/lib/ransack/adapters/active_record/ransack/translate.rb +0 -8
  129. data/lib/ransack/adapters/active_record/ransack/visitor.rb +0 -47
  130. data/lib/ransack/adapters.rb +0 -64
  131. data/lib/ransack/nodes.rb +0 -8
  132. data/polyamorous/lib/polyamorous/activerecord_5.0_ruby_2/join_association.rb +0 -2
  133. data/polyamorous/lib/polyamorous/activerecord_5.0_ruby_2/join_dependency.rb +0 -2
  134. data/polyamorous/lib/polyamorous/activerecord_5.1_ruby_2/join_association.rb +0 -31
  135. data/polyamorous/lib/polyamorous/activerecord_5.1_ruby_2/join_dependency.rb +0 -112
  136. data/polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_association.rb +0 -31
  137. data/polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_dependency.rb +0 -112
  138. data/polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/reflection.rb +0 -12
  139. data/polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/join_association.rb +0 -22
  140. data/polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/join_dependency.rb +0 -81
  141. data/polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/reflection.rb +0 -2
  142. data/polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb +0 -2
  143. data/polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb +0 -2
  144. data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +0 -2
  145. data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +0 -2
  146. data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +0 -2
  147. data/polyamorous/lib/polyamorous/version.rb +0 -3
  148. data/polyamorous/polyamorous.gemspec +0 -35
  149. /data/{logo → docs/static/logo}/ransack-h.png +0 -0
  150. /data/{logo → docs/static/logo}/ransack-h.svg +0 -0
  151. /data/{logo → docs/static/logo}/ransack-v.png +0 -0
  152. /data/{logo → docs/static/logo}/ransack-v.svg +0 -0
  153. /data/{logo → docs/static/logo}/ransack.png +0 -0
  154. /data/{logo → docs/static/logo}/ransack.svg +0 -0
  155. /data/{polyamorous/lib → lib}/polyamorous/join.rb +0 -0
  156. /data/{polyamorous/lib → lib}/polyamorous/swapping_reflection_class.rb +0 -0
  157. /data/{polyamorous/lib → lib}/polyamorous/tree_node.rb +0 -0
  158. /data/lib/ransack/{adapters/active_record.rb → active_record.rb} +0 -0
  159. /data/spec/{ransack → polyamorous}/join_spec.rb +0 -0
@@ -6,6 +6,8 @@ when 'mysql', 'mysql2'
6
6
  ActiveRecord::Base.establish_connection(
7
7
  adapter: 'mysql2',
8
8
  database: 'ransack',
9
+ username: ENV.fetch("MYSQL_USERNAME") { "root" },
10
+ password: ENV.fetch("MYSQL_PASSWORD") { "" },
9
11
  encoding: 'utf8'
10
12
  )
11
13
  when 'pg', 'postgres', 'postgresql'
@@ -13,7 +15,9 @@ when 'pg', 'postgres', 'postgresql'
13
15
  ActiveRecord::Base.establish_connection(
14
16
  adapter: 'postgresql',
15
17
  database: 'ransack',
16
- # username: 'postgres', # Uncomment the username option if you have set one
18
+ username: ENV.fetch("DATABASE_USERNAME") { "postgres" },
19
+ password: ENV.fetch("DATABASE_PASSWORD") { "" },
20
+ host: ENV.fetch("DATABASE_HOST") { "localhost" },
17
21
  min_messages: 'warning'
18
22
  )
19
23
  else
@@ -24,7 +28,24 @@ else
24
28
  )
25
29
  end
26
30
 
27
- class Person < ActiveRecord::Base
31
+ # This is just a test app with no sensitive data, so we explicitly allowlist all
32
+ # attributes and associations for search. In general, end users should
33
+ # explicitly authorize each model, but this shows a way to configure the
34
+ # unrestricted default behavior of versions prior to Ransack 4.
35
+ #
36
+ class ApplicationRecord < ActiveRecord::Base
37
+ self.abstract_class = true
38
+
39
+ def self.ransackable_attributes(auth_object = nil)
40
+ authorizable_ransackable_attributes
41
+ end
42
+
43
+ def self.ransackable_associations(auth_object = nil)
44
+ authorizable_ransackable_associations
45
+ end
46
+ end
47
+
48
+ class Person < ApplicationRecord
28
49
  default_scope { order(id: :desc) }
29
50
  belongs_to :parent, class_name: 'Person', foreign_key: :parent_id
30
51
  has_many :children, class_name: 'Person', foreign_key: :parent_id
@@ -83,7 +104,6 @@ class Person < ActiveRecord::Base
83
104
  )
84
105
  end
85
106
 
86
-
87
107
  ransacker :sql_literal_id do
88
108
  Arel.sql('people.id')
89
109
  end
@@ -106,12 +126,11 @@ class Person < ActiveRecord::Base
106
126
  Arel.sql(query)
107
127
  end
108
128
 
109
-
110
129
  def self.ransackable_attributes(auth_object = nil)
111
130
  if auth_object == :admin
112
- super - ['only_sort']
131
+ authorizable_ransackable_attributes - ['only_sort']
113
132
  else
114
- super - ['only_sort', 'only_admin']
133
+ authorizable_ransackable_attributes - ['only_sort', 'only_admin']
115
134
  end
116
135
  end
117
136
 
@@ -127,7 +146,7 @@ end
127
146
  class Musician < Person
128
147
  end
129
148
 
130
- class Article < ActiveRecord::Base
149
+ class Article < ApplicationRecord
131
150
  belongs_to :person
132
151
  has_many :comments
133
152
  has_and_belongs_to_many :tags
@@ -136,12 +155,51 @@ class Article < ActiveRecord::Base
136
155
  alias_attribute :content, :body
137
156
 
138
157
  default_scope { where("'default_scope' = 'default_scope'") }
158
+ scope :latest_comment_cont, lambda { |msg|
159
+ join = <<-SQL
160
+ (LEFT OUTER JOIN (
161
+ SELECT
162
+ comments.*,
163
+ row_number() OVER (PARTITION BY comments.article_id ORDER BY comments.id DESC) AS rownum
164
+ FROM comments
165
+ ) AS latest_comment
166
+ ON latest_comment.article_id = article.id
167
+ AND latest_comment.rownum = 1
168
+ )
169
+ SQL
170
+ .squish
171
+
172
+ joins(join).where("latest_comment.body ILIKE ?", "%#{msg}%")
173
+ }
174
+
175
+ ransacker :title_type, formatter: lambda { |tuples|
176
+ title, type = JSON.parse(tuples)
177
+ Arel::Nodes::Grouping.new(
178
+ [
179
+ Arel::Nodes.build_quoted(title),
180
+ Arel::Nodes.build_quoted(type)
181
+ ]
182
+ )
183
+ } do |_parent|
184
+ articles = Article.arel_table
185
+ Arel::Nodes::Grouping.new(
186
+ %i[title type].map do |field|
187
+ Arel::Nodes::NamedFunction.new(
188
+ 'COALESCE',
189
+ [
190
+ Arel::Nodes::NamedFunction.new('TRIM', [articles[field]]),
191
+ Arel::Nodes.build_quoted('')
192
+ ]
193
+ )
194
+ end
195
+ )
196
+ end
139
197
  end
140
198
 
141
199
  class StoryArticle < Article
142
200
  end
143
201
 
144
- class Recommendation < ActiveRecord::Base
202
+ class Recommendation < ApplicationRecord
145
203
  belongs_to :person
146
204
  belongs_to :target_person, class_name: 'Person'
147
205
  belongs_to :article
@@ -159,19 +217,40 @@ module Namespace
159
217
  end
160
218
  end
161
219
 
162
- class Comment < ActiveRecord::Base
220
+ class Comment < ApplicationRecord
163
221
  belongs_to :article
164
222
  belongs_to :person
223
+
224
+ default_scope { where(disabled: false) }
165
225
  end
166
226
 
167
- class Tag < ActiveRecord::Base
227
+ class Tag < ApplicationRecord
168
228
  has_and_belongs_to_many :articles
169
229
  end
170
230
 
171
- class Note < ActiveRecord::Base
231
+ class Note < ApplicationRecord
172
232
  belongs_to :notable, polymorphic: true
173
233
  end
174
234
 
235
+ class Account < ApplicationRecord
236
+ belongs_to :agent_account, class_name: "Account"
237
+ belongs_to :trade_account, class_name: "Account"
238
+ end
239
+
240
+ class Address < ApplicationRecord
241
+ has_one :organization
242
+ end
243
+
244
+ class Organization < ApplicationRecord
245
+ belongs_to :address
246
+ has_many :employees
247
+ end
248
+
249
+ class Employee < ApplicationRecord
250
+ belongs_to :organization
251
+ has_one :address, through: :organization
252
+ end
253
+
175
254
  module Schema
176
255
  def self.create
177
256
  ActiveRecord::Migration.verbose = false
@@ -207,6 +286,7 @@ module Schema
207
286
  t.integer :article_id
208
287
  t.integer :person_id
209
288
  t.text :body
289
+ t.boolean :disabled, default: false
210
290
  end
211
291
 
212
292
  create_table :tags, force: true do |t|
@@ -229,6 +309,25 @@ module Schema
229
309
  t.integer :target_person_id
230
310
  t.integer :article_id
231
311
  end
312
+
313
+ create_table :accounts, force: true do |t|
314
+ t.belongs_to :agent_account
315
+ t.belongs_to :trade_account
316
+ end
317
+
318
+ create_table :addresses, force: true do |t|
319
+ t.string :city
320
+ end
321
+
322
+ create_table :organizations, force: true do |t|
323
+ t.string :name
324
+ t.integer :address_id
325
+ end
326
+
327
+ create_table :employees, force: true do |t|
328
+ t.string :name
329
+ t.integer :organization_id
330
+ end
232
331
  end
233
332
 
234
333
  10.times do
@@ -254,7 +353,7 @@ module Schema
254
353
  end
255
354
 
256
355
  module SubDB
257
- class Base < ActiveRecord::Base
356
+ class Base < ApplicationRecord
258
357
  self.abstract_class = true
259
358
  establish_connection(
260
359
  adapter: 'sqlite3',
metadata CHANGED
@@ -1,60 +1,47 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ransack
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernie Miller
8
8
  - Ryan Bigg
9
9
  - Jon Atack
10
10
  - Sean Carroll
11
- autorequire:
11
+ - David Rodríguez
12
+ autorequire:
12
13
  bindir: bin
13
14
  cert_chain: []
14
- date: 2019-08-18 00:00:00.000000000 Z
15
+ date: 2023-10-23 00:00:00.000000000 Z
15
16
  dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: actionpack
18
- requirement: !ruby/object:Gem::Requirement
19
- requirements:
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: '5.0'
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: '5.0'
30
17
  - !ruby/object:Gem::Dependency
31
18
  name: activerecord
32
19
  requirement: !ruby/object:Gem::Requirement
33
20
  requirements:
34
21
  - - ">="
35
22
  - !ruby/object:Gem::Version
36
- version: '5.0'
23
+ version: 6.1.5
37
24
  type: :runtime
38
25
  prerelease: false
39
26
  version_requirements: !ruby/object:Gem::Requirement
40
27
  requirements:
41
28
  - - ">="
42
29
  - !ruby/object:Gem::Version
43
- version: '5.0'
30
+ version: 6.1.5
44
31
  - !ruby/object:Gem::Dependency
45
32
  name: activesupport
46
33
  requirement: !ruby/object:Gem::Requirement
47
34
  requirements:
48
35
  - - ">="
49
36
  - !ruby/object:Gem::Version
50
- version: '5.0'
37
+ version: 6.1.5
51
38
  type: :runtime
52
39
  prerelease: false
53
40
  version_requirements: !ruby/object:Gem::Requirement
54
41
  requirements:
55
42
  - - ">="
56
43
  - !ruby/object:Gem::Version
57
- version: '5.0'
44
+ version: 6.1.5
58
45
  - !ruby/object:Gem::Dependency
59
46
  name: i18n
60
47
  requirement: !ruby/object:Gem::Requirement
@@ -69,132 +56,6 @@ dependencies:
69
56
  - - ">="
70
57
  - !ruby/object:Gem::Version
71
58
  version: '0'
72
- - !ruby/object:Gem::Dependency
73
- name: polyamorous
74
- requirement: !ruby/object:Gem::Requirement
75
- requirements:
76
- - - '='
77
- - !ruby/object:Gem::Version
78
- version: 2.3.0
79
- type: :runtime
80
- prerelease: false
81
- version_requirements: !ruby/object:Gem::Requirement
82
- requirements:
83
- - - '='
84
- - !ruby/object:Gem::Version
85
- version: 2.3.0
86
- - !ruby/object:Gem::Dependency
87
- name: rspec
88
- requirement: !ruby/object:Gem::Requirement
89
- requirements:
90
- - - "~>"
91
- - !ruby/object:Gem::Version
92
- version: '3'
93
- type: :development
94
- prerelease: false
95
- version_requirements: !ruby/object:Gem::Requirement
96
- requirements:
97
- - - "~>"
98
- - !ruby/object:Gem::Version
99
- version: '3'
100
- - !ruby/object:Gem::Dependency
101
- name: machinist
102
- requirement: !ruby/object:Gem::Requirement
103
- requirements:
104
- - - "~>"
105
- - !ruby/object:Gem::Version
106
- version: 1.0.6
107
- type: :development
108
- prerelease: false
109
- version_requirements: !ruby/object:Gem::Requirement
110
- requirements:
111
- - - "~>"
112
- - !ruby/object:Gem::Version
113
- version: 1.0.6
114
- - !ruby/object:Gem::Dependency
115
- name: faker
116
- requirement: !ruby/object:Gem::Requirement
117
- requirements:
118
- - - "~>"
119
- - !ruby/object:Gem::Version
120
- version: 0.9.5
121
- type: :development
122
- prerelease: false
123
- version_requirements: !ruby/object:Gem::Requirement
124
- requirements:
125
- - - "~>"
126
- - !ruby/object:Gem::Version
127
- version: 0.9.5
128
- - !ruby/object:Gem::Dependency
129
- name: sqlite3
130
- requirement: !ruby/object:Gem::Requirement
131
- requirements:
132
- - - "~>"
133
- - !ruby/object:Gem::Version
134
- version: 1.4.1
135
- type: :development
136
- prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - "~>"
140
- - !ruby/object:Gem::Version
141
- version: 1.4.1
142
- - !ruby/object:Gem::Dependency
143
- name: pg
144
- requirement: !ruby/object:Gem::Requirement
145
- requirements:
146
- - - "~>"
147
- - !ruby/object:Gem::Version
148
- version: '0.21'
149
- type: :development
150
- prerelease: false
151
- version_requirements: !ruby/object:Gem::Requirement
152
- requirements:
153
- - - "~>"
154
- - !ruby/object:Gem::Version
155
- version: '0.21'
156
- - !ruby/object:Gem::Dependency
157
- name: mysql2
158
- requirement: !ruby/object:Gem::Requirement
159
- requirements:
160
- - - '='
161
- - !ruby/object:Gem::Version
162
- version: 0.3.20
163
- type: :development
164
- prerelease: false
165
- version_requirements: !ruby/object:Gem::Requirement
166
- requirements:
167
- - - '='
168
- - !ruby/object:Gem::Version
169
- version: 0.3.20
170
- - !ruby/object:Gem::Dependency
171
- name: pry
172
- requirement: !ruby/object:Gem::Requirement
173
- requirements:
174
- - - '='
175
- - !ruby/object:Gem::Version
176
- version: '0.10'
177
- type: :development
178
- prerelease: false
179
- version_requirements: !ruby/object:Gem::Requirement
180
- requirements:
181
- - - '='
182
- - !ruby/object:Gem::Version
183
- version: '0.10'
184
- - !ruby/object:Gem::Dependency
185
- name: byebug
186
- requirement: !ruby/object:Gem::Requirement
187
- requirements:
188
- - - ">="
189
- - !ruby/object:Gem::Version
190
- version: '0'
191
- type: :development
192
- prerelease: false
193
- version_requirements: !ruby/object:Gem::Requirement
194
- requirements:
195
- - - ">="
196
- - !ruby/object:Gem::Version
197
- version: '0'
198
59
  description: Ransack is the successor to the MetaSearch gem. It improves and expands
199
60
  upon MetaSearch's functionality, but does not have a 100%-compatible API.
200
61
  email:
@@ -206,24 +67,96 @@ executables: []
206
67
  extensions: []
207
68
  extra_rdoc_files: []
208
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"
209
78
  - ".gitignore"
210
- - ".travis.yml"
79
+ - ".nojekyll"
80
+ - ".rubocop.yml"
211
81
  - CHANGELOG.md
212
82
  - CONTRIBUTING.md
213
83
  - Gemfile
214
84
  - LICENSE
215
85
  - README.md
216
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
+ - lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb
144
+ - lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb
145
+ - lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb
146
+ - lib/polyamorous/activerecord_7.0_ruby_2/join_association.rb
147
+ - lib/polyamorous/activerecord_7.0_ruby_2/join_dependency.rb
148
+ - lib/polyamorous/activerecord_7.0_ruby_2/reflection.rb
149
+ - lib/polyamorous/activerecord_7.1_ruby_2/join_association.rb
150
+ - lib/polyamorous/activerecord_7.1_ruby_2/join_dependency.rb
151
+ - lib/polyamorous/activerecord_7.1_ruby_2/reflection.rb
152
+ - lib/polyamorous/join.rb
153
+ - lib/polyamorous/polyamorous.rb
154
+ - lib/polyamorous/swapping_reflection_class.rb
155
+ - lib/polyamorous/tree_node.rb
217
156
  - lib/ransack.rb
218
- - lib/ransack/adapters.rb
219
- - lib/ransack/adapters/active_record.rb
157
+ - lib/ransack/active_record.rb
220
158
  - lib/ransack/adapters/active_record/base.rb
221
159
  - lib/ransack/adapters/active_record/context.rb
222
- - lib/ransack/adapters/active_record/ransack/constants.rb
223
- - lib/ransack/adapters/active_record/ransack/context.rb
224
- - lib/ransack/adapters/active_record/ransack/nodes/condition.rb
225
- - lib/ransack/adapters/active_record/ransack/translate.rb
226
- - lib/ransack/adapters/active_record/ransack/visitor.rb
227
160
  - lib/ransack/configuration.rb
228
161
  - lib/ransack/constants.rb
229
162
  - lib/ransack/context.rb
@@ -251,11 +184,12 @@ files:
251
184
  - lib/ransack/locale/pt-BR.yml
252
185
  - lib/ransack/locale/ro.yml
253
186
  - lib/ransack/locale/ru.yml
187
+ - lib/ransack/locale/sk.yml
188
+ - lib/ransack/locale/sv.yml
254
189
  - lib/ransack/locale/tr.yml
255
190
  - lib/ransack/locale/zh-CN.yml
256
191
  - lib/ransack/locale/zh-TW.yml
257
192
  - lib/ransack/naming.rb
258
- - lib/ransack/nodes.rb
259
193
  - lib/ransack/nodes/attribute.rb
260
194
  - lib/ransack/nodes/bindable.rb
261
195
  - lib/ransack/nodes/condition.rb
@@ -269,34 +203,6 @@ files:
269
203
  - lib/ransack/translate.rb
270
204
  - lib/ransack/version.rb
271
205
  - lib/ransack/visitor.rb
272
- - logo/ransack-h.png
273
- - logo/ransack-h.svg
274
- - logo/ransack-v.png
275
- - logo/ransack-v.svg
276
- - logo/ransack.png
277
- - logo/ransack.svg
278
- - polyamorous/lib/polyamorous.rb
279
- - polyamorous/lib/polyamorous/activerecord_5.0_ruby_2/join_association.rb
280
- - polyamorous/lib/polyamorous/activerecord_5.0_ruby_2/join_dependency.rb
281
- - polyamorous/lib/polyamorous/activerecord_5.1_ruby_2/join_association.rb
282
- - polyamorous/lib/polyamorous/activerecord_5.1_ruby_2/join_dependency.rb
283
- - polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_association.rb
284
- - polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_dependency.rb
285
- - polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/reflection.rb
286
- - polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/join_association.rb
287
- - polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/join_dependency.rb
288
- - polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/reflection.rb
289
- - polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb
290
- - polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb
291
- - polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb
292
- - polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb
293
- - polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb
294
- - polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb
295
- - polyamorous/lib/polyamorous/join.rb
296
- - polyamorous/lib/polyamorous/swapping_reflection_class.rb
297
- - polyamorous/lib/polyamorous/tree_node.rb
298
- - polyamorous/lib/polyamorous/version.rb
299
- - polyamorous/polyamorous.gemspec
300
206
  - ransack.gemspec
301
207
  - spec/blueprints/articles.rb
302
208
  - spec/blueprints/comments.rb
@@ -306,16 +212,18 @@ files:
306
212
  - spec/console.rb
307
213
  - spec/helpers/polyamorous_helper.rb
308
214
  - spec/helpers/ransack_helper.rb
215
+ - spec/polyamorous/activerecord_compatibility_spec.rb
216
+ - spec/polyamorous/join_association_spec.rb
217
+ - spec/polyamorous/join_dependency_spec.rb
218
+ - spec/polyamorous/join_spec.rb
309
219
  - spec/ransack/adapters/active_record/base_spec.rb
310
220
  - spec/ransack/adapters/active_record/context_spec.rb
311
221
  - spec/ransack/configuration_spec.rb
312
222
  - spec/ransack/helpers/form_builder_spec.rb
313
223
  - spec/ransack/helpers/form_helper_spec.rb
314
- - spec/ransack/join_association_spec.rb
315
- - spec/ransack/join_dependency_spec.rb
316
- - spec/ransack/join_spec.rb
317
224
  - spec/ransack/nodes/condition_spec.rb
318
225
  - spec/ransack/nodes/grouping_spec.rb
226
+ - spec/ransack/nodes/value_spec.rb
319
227
  - spec/ransack/predicate_spec.rb
320
228
  - spec/ransack/search_spec.rb
321
229
  - spec/ransack/translate_spec.rb
@@ -326,7 +234,7 @@ homepage: https://github.com/activerecord-hackery/ransack
326
234
  licenses:
327
235
  - MIT
328
236
  metadata: {}
329
- post_install_message:
237
+ post_install_message:
330
238
  rdoc_options: []
331
239
  require_paths:
332
240
  - lib
@@ -334,17 +242,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
334
242
  requirements:
335
243
  - - ">="
336
244
  - !ruby/object:Gem::Version
337
- version: '1.9'
245
+ version: '3.0'
338
246
  required_rubygems_version: !ruby/object:Gem::Requirement
339
247
  requirements:
340
248
  - - ">="
341
249
  - !ruby/object:Gem::Version
342
250
  version: '0'
343
251
  requirements: []
344
- rubygems_version: 3.0.2
345
- signing_key:
252
+ rubygems_version: 3.4.21
253
+ signing_key:
346
254
  specification_version: 4
347
- summary: Object-based searching for Active Record and Mongoid (currently).
255
+ summary: Object-based searching for Active Record.
348
256
  test_files:
349
257
  - spec/blueprints/articles.rb
350
258
  - spec/blueprints/comments.rb
@@ -354,16 +262,18 @@ test_files:
354
262
  - spec/console.rb
355
263
  - spec/helpers/polyamorous_helper.rb
356
264
  - spec/helpers/ransack_helper.rb
265
+ - spec/polyamorous/activerecord_compatibility_spec.rb
266
+ - spec/polyamorous/join_association_spec.rb
267
+ - spec/polyamorous/join_dependency_spec.rb
268
+ - spec/polyamorous/join_spec.rb
357
269
  - spec/ransack/adapters/active_record/base_spec.rb
358
270
  - spec/ransack/adapters/active_record/context_spec.rb
359
271
  - spec/ransack/configuration_spec.rb
360
272
  - spec/ransack/helpers/form_builder_spec.rb
361
273
  - spec/ransack/helpers/form_helper_spec.rb
362
- - spec/ransack/join_association_spec.rb
363
- - spec/ransack/join_dependency_spec.rb
364
- - spec/ransack/join_spec.rb
365
274
  - spec/ransack/nodes/condition_spec.rb
366
275
  - spec/ransack/nodes/grouping_spec.rb
276
+ - spec/ransack/nodes/value_spec.rb
367
277
  - spec/ransack/predicate_spec.rb
368
278
  - spec/ransack/search_spec.rb
369
279
  - spec/ransack/translate_spec.rb
data/.travis.yml DELETED
@@ -1,49 +0,0 @@
1
- language: ruby
2
-
3
- sudo: false
4
-
5
- rvm:
6
- - 2.6.0
7
-
8
- services:
9
- - mysql
10
-
11
- env:
12
- - RAILS=6-0-stable DB=sqlite3
13
- - RAILS=6-0-stable DB=mysql
14
- - RAILS=6-0-stable DB=postgres
15
-
16
- - RAILS=v6.0.0 DB=sqlite3
17
- - RAILS=v6.0.0 DB=mysql
18
- - RAILS=v6.0.0 DB=postgres
19
-
20
- - RAILS=5-2-stable DB=sqlite3
21
- - RAILS=5-2-stable DB=mysql
22
- - RAILS=5-2-stable DB=postgres
23
-
24
- - RAILS=v5.2.1 DB=sqlite3
25
- - RAILS=v5.2.1 DB=mysql
26
- - RAILS=v5.2.1 DB=postgres
27
-
28
- - RAILS=v5.2.0 DB=sqlite3
29
- - RAILS=v5.2.0 DB=mysql
30
- - RAILS=v5.2.0 DB=postgres
31
-
32
- - RAILS=5-1-stable DB=sqlite3
33
- - RAILS=5-1-stable DB=mysql
34
- - RAILS=5-1-stable DB=postgres
35
-
36
- matrix:
37
- allow_failures:
38
- - env: RAILS=5-2-stable DB=sqlite3
39
- - env: RAILS=5-2-stable DB=mysql
40
- - env: RAILS=5-2-stable DB=postgres
41
- before_script:
42
- - mysql -e 'create database ransack collate utf8_general_ci;'
43
- - mysql -e 'use ransack;show variables like "%character%";show variables like "%collation%";'
44
- - psql -c 'create database ransack;' -U postgres
45
-
46
- addons:
47
- code_climate:
48
- repo_token: 8b701c4364d51a0217105e08c06922d600cec3d9e60d546a89e3ddfe46e0664e
49
- postgresql: "9.6"