ransack 1.8.4 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. checksums.yaml +5 -5
  2. data/.github/FUNDING.yml +3 -0
  3. data/.github/SECURITY.md +12 -0
  4. data/.github/workflows/cronjob.yml +102 -0
  5. data/.github/workflows/deploy.yml +35 -0
  6. data/.github/workflows/rubocop.yml +20 -0
  7. data/.github/workflows/test-deploy.yml +29 -0
  8. data/.github/workflows/test.yml +130 -0
  9. data/.gitignore +3 -0
  10. data/{lib/ransack/adapters/mongoid/3.2/.gitkeep → .nojekyll} +0 -0
  11. data/.rubocop.yml +44 -0
  12. data/CHANGELOG.md +352 -0
  13. data/CONTRIBUTING.md +25 -13
  14. data/Gemfile +26 -27
  15. data/README.md +65 -815
  16. data/Rakefile +1 -22
  17. data/bug_report_templates/test-ransack-scope-and-column-same-name.rb +78 -0
  18. data/bug_report_templates/test-ransacker-arel-present-predicate.rb +71 -0
  19. data/docs/.gitignore +19 -0
  20. data/docs/.nojekyll +0 -0
  21. data/docs/babel.config.js +3 -0
  22. data/docs/blog/2022-03-27-ransack-3.0.0.md +20 -0
  23. data/docs/docs/getting-started/_category_.json +4 -0
  24. data/docs/docs/getting-started/advanced-mode.md +46 -0
  25. data/docs/docs/getting-started/configuration.md +47 -0
  26. data/docs/docs/getting-started/search-matches.md +67 -0
  27. data/docs/docs/getting-started/simple-mode.md +284 -0
  28. data/docs/docs/getting-started/sorting.md +79 -0
  29. data/docs/docs/getting-started/using-predicates.md +282 -0
  30. data/docs/docs/going-further/_category_.json +4 -0
  31. data/docs/docs/going-further/acts-as-taggable-on.md +114 -0
  32. data/docs/docs/going-further/associations.md +70 -0
  33. data/docs/docs/going-further/custom-predicates.md +52 -0
  34. data/docs/docs/going-further/documentation.md +43 -0
  35. data/docs/docs/going-further/exporting-to-csv.md +49 -0
  36. data/docs/docs/going-further/external-guides.md +57 -0
  37. data/docs/docs/going-further/form-customisation.md +63 -0
  38. data/docs/docs/going-further/i18n.md +53 -0
  39. data/docs/docs/going-further/img/create_release.png +0 -0
  40. data/docs/docs/going-further/merging-searches.md +41 -0
  41. data/docs/docs/going-further/other-notes.md +428 -0
  42. data/docs/docs/going-further/polymorphic-search.md +40 -0
  43. data/docs/docs/going-further/ransackers.md +331 -0
  44. data/docs/docs/going-further/release_process.md +36 -0
  45. data/docs/docs/going-further/saving-queries.md +82 -0
  46. data/docs/docs/going-further/searching-postgres.md +57 -0
  47. data/docs/docs/going-further/wiki-contributors.md +82 -0
  48. data/docs/docs/intro.md +99 -0
  49. data/docs/docusaurus.config.js +120 -0
  50. data/docs/package.json +38 -0
  51. data/docs/sidebars.js +31 -0
  52. data/docs/src/components/HomepageFeatures/index.js +64 -0
  53. data/docs/src/components/HomepageFeatures/styles.module.css +11 -0
  54. data/docs/src/css/custom.css +39 -0
  55. data/docs/src/pages/index.module.css +23 -0
  56. data/docs/src/pages/markdown-page.md +7 -0
  57. data/docs/static/.nojekyll +0 -0
  58. data/docs/static/img/docusaurus.png +0 -0
  59. data/docs/static/img/favicon.ico +0 -0
  60. data/docs/static/img/logo.svg +1 -0
  61. data/docs/static/img/tutorial/docsVersionDropdown.png +0 -0
  62. data/docs/static/img/tutorial/localeDropdown.png +0 -0
  63. data/docs/static/img/undraw_docusaurus_mountain.svg +171 -0
  64. data/docs/static/img/undraw_docusaurus_react.svg +170 -0
  65. data/docs/static/img/undraw_docusaurus_tree.svg +40 -0
  66. data/docs/static/logo/ransack-h.png +0 -0
  67. data/docs/static/logo/ransack-h.svg +34 -0
  68. data/docs/static/logo/ransack-v.png +0 -0
  69. data/docs/static/logo/ransack-v.svg +34 -0
  70. data/docs/static/logo/ransack.png +0 -0
  71. data/docs/static/logo/ransack.svg +21 -0
  72. data/docs/yarn.lock +8436 -0
  73. data/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +70 -0
  74. data/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +92 -0
  75. data/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +11 -0
  76. data/lib/polyamorous/activerecord_7.0_ruby_2/join_association.rb +1 -0
  77. data/lib/polyamorous/activerecord_7.0_ruby_2/join_dependency.rb +1 -0
  78. data/lib/polyamorous/activerecord_7.0_ruby_2/reflection.rb +1 -0
  79. data/lib/polyamorous/activerecord_7.1_ruby_2/join_association.rb +1 -0
  80. data/lib/polyamorous/activerecord_7.1_ruby_2/join_dependency.rb +1 -0
  81. data/lib/polyamorous/activerecord_7.1_ruby_2/reflection.rb +1 -0
  82. data/lib/polyamorous/join.rb +70 -0
  83. data/lib/polyamorous/polyamorous.rb +24 -0
  84. data/lib/polyamorous/swapping_reflection_class.rb +11 -0
  85. data/lib/polyamorous/tree_node.rb +7 -0
  86. data/lib/polyamorous.rb +1 -0
  87. data/lib/ransack/adapters/active_record/base.rb +14 -3
  88. data/lib/ransack/adapters/active_record/context.rb +140 -196
  89. data/lib/ransack/adapters/active_record/ransack/constants.rb +19 -4
  90. data/lib/ransack/adapters/active_record/ransack/context.rb +9 -19
  91. data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +7 -7
  92. data/lib/ransack/adapters/active_record/ransack/translate.rb +1 -5
  93. data/lib/ransack/adapters/active_record/ransack/visitor.rb +23 -0
  94. data/lib/ransack/adapters/active_record.rb +0 -9
  95. data/lib/ransack/adapters.rb +2 -0
  96. data/lib/ransack/configuration.rb +52 -2
  97. data/lib/ransack/constants.rb +1 -5
  98. data/lib/ransack/context.rb +29 -24
  99. data/lib/ransack/helpers/form_builder.rb +12 -6
  100. data/lib/ransack/helpers/form_helper.rb +11 -3
  101. data/lib/ransack/helpers.rb +1 -1
  102. data/lib/ransack/locale/ar.yml +70 -0
  103. data/lib/ransack/locale/az.yml +70 -0
  104. data/lib/ransack/locale/bg.yml +70 -0
  105. data/lib/ransack/locale/ca.yml +70 -0
  106. data/lib/ransack/locale/el.yml +70 -0
  107. data/lib/ransack/locale/es.yml +22 -22
  108. data/lib/ransack/locale/fa.yml +70 -0
  109. data/lib/ransack/locale/fi.yml +71 -0
  110. data/lib/ransack/locale/nl.yml +4 -4
  111. data/lib/ransack/locale/ru.yml +70 -0
  112. data/lib/ransack/locale/sk.yml +70 -0
  113. data/lib/ransack/locale/sv.yml +70 -0
  114. data/lib/ransack/locale/tr.yml +70 -0
  115. data/lib/ransack/locale/zh-CN.yml +12 -12
  116. data/lib/ransack/nodes/attribute.rb +2 -2
  117. data/lib/ransack/nodes/condition.rb +7 -1
  118. data/lib/ransack/nodes/grouping.rb +3 -8
  119. data/lib/ransack/nodes/sort.rb +3 -3
  120. data/lib/ransack/nodes/value.rb +3 -3
  121. data/lib/ransack/predicate.rb +13 -20
  122. data/lib/ransack/search.rb +7 -4
  123. data/lib/ransack/translate.rb +115 -115
  124. data/lib/ransack/version.rb +1 -1
  125. data/lib/ransack/visitor.rb +1 -12
  126. data/lib/ransack.rb +7 -5
  127. data/ransack.gemspec +9 -25
  128. data/spec/blueprints/articles.rb +1 -1
  129. data/spec/blueprints/comments.rb +1 -1
  130. data/spec/blueprints/notes.rb +1 -1
  131. data/spec/blueprints/tags.rb +1 -1
  132. data/spec/console.rb +5 -5
  133. data/spec/helpers/polyamorous_helper.rb +13 -0
  134. data/spec/helpers/ransack_helper.rb +1 -1
  135. data/spec/polyamorous/activerecord_compatibility_spec.rb +15 -0
  136. data/spec/polyamorous/join_association_spec.rb +30 -0
  137. data/spec/polyamorous/join_dependency_spec.rb +81 -0
  138. data/spec/polyamorous/join_spec.rb +19 -0
  139. data/spec/ransack/adapters/active_record/base_spec.rb +105 -11
  140. data/spec/ransack/adapters/active_record/context_spec.rb +63 -24
  141. data/spec/ransack/configuration_spec.rb +24 -0
  142. data/spec/ransack/helpers/form_builder_spec.rb +3 -15
  143. data/spec/ransack/helpers/form_helper_spec.rb +135 -168
  144. data/spec/ransack/nodes/condition_spec.rb +13 -0
  145. data/spec/ransack/nodes/grouping_spec.rb +2 -2
  146. data/spec/ransack/nodes/value_spec.rb +115 -0
  147. data/spec/ransack/predicate_spec.rb +54 -2
  148. data/spec/ransack/search_spec.rb +266 -36
  149. data/spec/spec_helper.rb +14 -5
  150. data/spec/support/schema.rb +99 -21
  151. metadata +117 -187
  152. data/.travis.yml +0 -86
  153. data/lib/ransack/adapters/active_record/3.0/compat.rb +0 -179
  154. data/lib/ransack/adapters/active_record/3.0/context.rb +0 -203
  155. data/lib/ransack/adapters/active_record/3.1/context.rb +0 -212
  156. data/lib/ransack/adapters/active_record/3.2/context.rb +0 -44
  157. data/lib/ransack/adapters/active_record/compat.rb +0 -14
  158. data/lib/ransack/adapters/mongoid/attributes/attribute.rb +0 -37
  159. data/lib/ransack/adapters/mongoid/attributes/order_predications.rb +0 -17
  160. data/lib/ransack/adapters/mongoid/attributes/predications.rb +0 -141
  161. data/lib/ransack/adapters/mongoid/base.rb +0 -134
  162. data/lib/ransack/adapters/mongoid/context.rb +0 -212
  163. data/lib/ransack/adapters/mongoid/inquiry_hash.rb +0 -23
  164. data/lib/ransack/adapters/mongoid/ransack/constants.rb +0 -88
  165. data/lib/ransack/adapters/mongoid/ransack/context.rb +0 -60
  166. data/lib/ransack/adapters/mongoid/ransack/nodes/condition.rb +0 -27
  167. data/lib/ransack/adapters/mongoid/ransack/translate.rb +0 -13
  168. data/lib/ransack/adapters/mongoid/ransack/visitor.rb +0 -24
  169. data/lib/ransack/adapters/mongoid/table.rb +0 -35
  170. data/lib/ransack/adapters/mongoid.rb +0 -15
  171. data/spec/mongoid/adapters/mongoid/base_spec.rb +0 -314
  172. data/spec/mongoid/adapters/mongoid/context_spec.rb +0 -56
  173. data/spec/mongoid/configuration_spec.rb +0 -162
  174. data/spec/mongoid/dependencies_spec.rb +0 -8
  175. data/spec/mongoid/helpers/ransack_helper.rb +0 -11
  176. data/spec/mongoid/nodes/condition_spec.rb +0 -49
  177. data/spec/mongoid/nodes/grouping_spec.rb +0 -13
  178. data/spec/mongoid/predicate_spec.rb +0 -155
  179. data/spec/mongoid/search_spec.rb +0 -445
  180. data/spec/mongoid/support/mongoid.yml +0 -11
  181. data/spec/mongoid/support/schema.rb +0 -135
  182. data/spec/mongoid/translate_spec.rb +0 -14
  183. data/spec/mongoid_spec_helper.rb +0 -63
  184. data/spec/ransack/dependencies_spec.rb +0 -12
@@ -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
@@ -25,26 +29,14 @@ else
25
29
  end
26
30
 
27
31
  class Person < ActiveRecord::Base
28
- if ::ActiveRecord::VERSION::MAJOR == 3
29
- default_scope order('id DESC')
30
- else
31
- default_scope { order(id: :desc) }
32
- end
32
+ default_scope { order(id: :desc) }
33
33
  belongs_to :parent, class_name: 'Person', foreign_key: :parent_id
34
34
  has_many :children, class_name: 'Person', foreign_key: :parent_id
35
35
  has_many :articles
36
- if ActiveRecord::VERSION::MAJOR == 3
37
- if RUBY_VERSION >= '2.3'
38
- has_many :published_articles, class_name: "Article",
39
- conditions: "published = 't'"
40
- else
41
- has_many :published_articles, class_name: "Article",
42
- conditions: { published: true }
43
- end
44
- else
45
- has_many :published_articles, ->{ where(published: true) },
36
+ has_many :story_articles
37
+
38
+ has_many :published_articles, ->{ where(published: true) },
46
39
  class_name: "Article"
47
- end
48
40
  has_many :comments
49
41
  has_many :authored_article_comments, through: :articles,
50
42
  source: :comments, foreign_key: :person_id
@@ -57,6 +49,9 @@ class Person < ActiveRecord::Base
57
49
  of_age ? where("age >= ?", 18) : where("age < ?", 18)
58
50
  }
59
51
 
52
+ scope :sort_by_reverse_name_asc, lambda { order(Arel.sql("REVERSE(name) ASC")) }
53
+ scope :sort_by_reverse_name_desc, lambda { order("REVERSE(name) DESC") }
54
+
60
55
  alias_attribute :full_name, :name
61
56
 
62
57
  ransack_alias :term, :name_or_email
@@ -96,6 +91,10 @@ class Person < ActiveRecord::Base
96
91
  Arel.sql('people.id')
97
92
  end
98
93
 
94
+ ransacker :name_case_insensitive, type: :string do
95
+ arel_table[:name].lower
96
+ end
97
+
99
98
  ransacker :with_arguments, args: [:parent, :ransacker_args] do |parent, args|
100
99
  min, max = args
101
100
  query = <<-SQL
@@ -138,13 +137,51 @@ class Article < ActiveRecord::Base
138
137
 
139
138
  alias_attribute :content, :body
140
139
 
141
- if ::ActiveRecord::VERSION::STRING >= '3.1'
142
- default_scope { where("'default_scope' = 'default_scope'") }
143
- else # Rails 3.0 does not accept a block
144
- default_scope where("'default_scope' = 'default_scope'")
140
+ default_scope { where("'default_scope' = 'default_scope'") }
141
+ scope :latest_comment_cont, lambda { |msg|
142
+ join = <<-SQL
143
+ (LEFT OUTER JOIN (
144
+ SELECT
145
+ comments.*,
146
+ row_number() OVER (PARTITION BY comments.article_id ORDER BY comments.id DESC) AS rownum
147
+ FROM comments
148
+ ) AS latest_comment
149
+ ON latest_comment.article_id = article.id
150
+ AND latest_comment.rownum = 1
151
+ )
152
+ SQL
153
+ .squish
154
+
155
+ joins(join).where("latest_comment.body ILIKE ?", "%#{msg}%")
156
+ }
157
+
158
+ ransacker :title_type, formatter: lambda { |tuples|
159
+ title, type = JSON.parse(tuples)
160
+ Arel::Nodes::Grouping.new(
161
+ [
162
+ Arel::Nodes.build_quoted(title),
163
+ Arel::Nodes.build_quoted(type)
164
+ ]
165
+ )
166
+ } do |_parent|
167
+ articles = Article.arel_table
168
+ Arel::Nodes::Grouping.new(
169
+ %i[title type].map do |field|
170
+ Arel::Nodes::NamedFunction.new(
171
+ 'COALESCE',
172
+ [
173
+ Arel::Nodes::NamedFunction.new('TRIM', [articles[field]]),
174
+ Arel::Nodes.build_quoted('')
175
+ ]
176
+ )
177
+ end
178
+ )
145
179
  end
146
180
  end
147
181
 
182
+ class StoryArticle < Article
183
+ end
184
+
148
185
  class Recommendation < ActiveRecord::Base
149
186
  belongs_to :person
150
187
  belongs_to :target_person, class_name: 'Person'
@@ -166,6 +203,8 @@ end
166
203
  class Comment < ActiveRecord::Base
167
204
  belongs_to :article
168
205
  belongs_to :person
206
+
207
+ default_scope { where(disabled: false) }
169
208
  end
170
209
 
171
210
  class Tag < ActiveRecord::Base
@@ -176,6 +215,11 @@ class Note < ActiveRecord::Base
176
215
  belongs_to :notable, polymorphic: true
177
216
  end
178
217
 
218
+ class Account < ActiveRecord::Base
219
+ belongs_to :agent_account, class_name: "Account"
220
+ belongs_to :trade_account, class_name: "Account"
221
+ end
222
+
179
223
  module Schema
180
224
  def self.create
181
225
  ActiveRecord::Migration.verbose = false
@@ -203,6 +247,7 @@ module Schema
203
247
  t.string :title
204
248
  t.text :subject_header
205
249
  t.text :body
250
+ t.string :type
206
251
  t.boolean :published, default: true
207
252
  end
208
253
 
@@ -210,6 +255,7 @@ module Schema
210
255
  t.integer :article_id
211
256
  t.integer :person_id
212
257
  t.text :body
258
+ t.boolean :disabled, default: false
213
259
  end
214
260
 
215
261
  create_table :tags, force: true do |t|
@@ -232,6 +278,11 @@ module Schema
232
278
  t.integer :target_person_id
233
279
  t.integer :article_id
234
280
  end
281
+
282
+ create_table :accounts, force: true do |t|
283
+ t.belongs_to :agent_account
284
+ t.belongs_to :trade_account
285
+ end
235
286
  end
236
287
 
237
288
  10.times do
@@ -255,3 +306,30 @@ module Schema
255
306
  )
256
307
  end
257
308
  end
309
+
310
+ module SubDB
311
+ class Base < ActiveRecord::Base
312
+ self.abstract_class = true
313
+ establish_connection(
314
+ adapter: 'sqlite3',
315
+ database: ':memory:'
316
+ )
317
+ end
318
+
319
+ class OperationHistory < Base
320
+ end
321
+
322
+ module Schema
323
+ def self.create
324
+ s = ::ActiveRecord::Schema.new
325
+ s.instance_variable_set(:@connection, SubDB::Base.connection)
326
+ s.verbose = false
327
+ s.define({}) do
328
+ create_table :operation_histories, force: true do |t|
329
+ t.string :operation_type
330
+ t.integer :people_id
331
+ end
332
+ end
333
+ end
334
+ end
335
+ end
metadata CHANGED
@@ -1,59 +1,47 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ransack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.4
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernie Miller
8
8
  - Ryan Bigg
9
9
  - Jon Atack
10
- autorequire:
10
+ - Sean Carroll
11
+ - David Rodríguez
12
+ autorequire:
11
13
  bindir: bin
12
14
  cert_chain: []
13
- date: 2017-10-09 00:00:00.000000000 Z
15
+ date: 2022-05-25 00:00:00.000000000 Z
14
16
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: actionpack
17
- requirement: !ruby/object:Gem::Requirement
18
- requirements:
19
- - - ">="
20
- - !ruby/object:Gem::Version
21
- version: '3.0'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- version: '3.0'
29
17
  - !ruby/object:Gem::Dependency
30
18
  name: activerecord
31
19
  requirement: !ruby/object:Gem::Requirement
32
20
  requirements:
33
21
  - - ">="
34
22
  - !ruby/object:Gem::Version
35
- version: '3.0'
23
+ version: 6.1.5
36
24
  type: :runtime
37
25
  prerelease: false
38
26
  version_requirements: !ruby/object:Gem::Requirement
39
27
  requirements:
40
28
  - - ">="
41
29
  - !ruby/object:Gem::Version
42
- version: '3.0'
30
+ version: 6.1.5
43
31
  - !ruby/object:Gem::Dependency
44
32
  name: activesupport
45
33
  requirement: !ruby/object:Gem::Requirement
46
34
  requirements:
47
35
  - - ">="
48
36
  - !ruby/object:Gem::Version
49
- version: '3.0'
37
+ version: 6.1.5
50
38
  type: :runtime
51
39
  prerelease: false
52
40
  version_requirements: !ruby/object:Gem::Requirement
53
41
  requirements:
54
42
  - - ">="
55
43
  - !ruby/object:Gem::Version
56
- version: '3.0'
44
+ version: 6.1.5
57
45
  - !ruby/object:Gem::Dependency
58
46
  name: i18n
59
47
  requirement: !ruby/object:Gem::Requirement
@@ -68,176 +56,131 @@ dependencies:
68
56
  - - ">="
69
57
  - !ruby/object:Gem::Version
70
58
  version: '0'
71
- - !ruby/object:Gem::Dependency
72
- name: polyamorous
73
- requirement: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: '1.3'
78
- type: :runtime
79
- prerelease: false
80
- version_requirements: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - "~>"
83
- - !ruby/object:Gem::Version
84
- version: '1.3'
85
- - !ruby/object:Gem::Dependency
86
- name: rspec
87
- requirement: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - "~>"
90
- - !ruby/object:Gem::Version
91
- version: '3'
92
- type: :development
93
- prerelease: false
94
- version_requirements: !ruby/object:Gem::Requirement
95
- requirements:
96
- - - "~>"
97
- - !ruby/object:Gem::Version
98
- version: '3'
99
- - !ruby/object:Gem::Dependency
100
- name: machinist
101
- requirement: !ruby/object:Gem::Requirement
102
- requirements:
103
- - - "~>"
104
- - !ruby/object:Gem::Version
105
- version: 1.0.6
106
- type: :development
107
- prerelease: false
108
- version_requirements: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - "~>"
111
- - !ruby/object:Gem::Version
112
- version: 1.0.6
113
- - !ruby/object:Gem::Dependency
114
- name: faker
115
- requirement: !ruby/object:Gem::Requirement
116
- requirements:
117
- - - "~>"
118
- - !ruby/object:Gem::Version
119
- version: 0.9.5
120
- type: :development
121
- prerelease: false
122
- version_requirements: !ruby/object:Gem::Requirement
123
- requirements:
124
- - - "~>"
125
- - !ruby/object:Gem::Version
126
- version: 0.9.5
127
- - !ruby/object:Gem::Dependency
128
- name: sqlite3
129
- requirement: !ruby/object:Gem::Requirement
130
- requirements:
131
- - - "~>"
132
- - !ruby/object:Gem::Version
133
- version: 1.3.3
134
- type: :development
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- requirements:
138
- - - "~>"
139
- - !ruby/object:Gem::Version
140
- version: 1.3.3
141
- - !ruby/object:Gem::Dependency
142
- name: pg
143
- requirement: !ruby/object:Gem::Requirement
144
- requirements:
145
- - - ">="
146
- - !ruby/object:Gem::Version
147
- version: '0'
148
- type: :development
149
- prerelease: false
150
- version_requirements: !ruby/object:Gem::Requirement
151
- requirements:
152
- - - ">="
153
- - !ruby/object:Gem::Version
154
- version: '0'
155
- - !ruby/object:Gem::Dependency
156
- name: mysql2
157
- requirement: !ruby/object:Gem::Requirement
158
- requirements:
159
- - - '='
160
- - !ruby/object:Gem::Version
161
- version: 0.3.20
162
- type: :development
163
- prerelease: false
164
- version_requirements: !ruby/object:Gem::Requirement
165
- requirements:
166
- - - '='
167
- - !ruby/object:Gem::Version
168
- version: 0.3.20
169
- - !ruby/object:Gem::Dependency
170
- name: pry
171
- requirement: !ruby/object:Gem::Requirement
172
- requirements:
173
- - - '='
174
- - !ruby/object:Gem::Version
175
- version: '0.10'
176
- type: :development
177
- prerelease: false
178
- version_requirements: !ruby/object:Gem::Requirement
179
- requirements:
180
- - - '='
181
- - !ruby/object:Gem::Version
182
- version: '0.10'
183
59
  description: Ransack is the successor to the MetaSearch gem. It improves and expands
184
60
  upon MetaSearch's functionality, but does not have a 100%-compatible API.
185
61
  email:
186
62
  - ernie@erniemiller.org
187
63
  - radarlistener@gmail.com
188
64
  - jonnyatack@gmail.com
65
+ - sfcarroll@gmail.com
189
66
  executables: []
190
67
  extensions: []
191
68
  extra_rdoc_files: []
192
69
  files:
70
+ - ".github/FUNDING.yml"
71
+ - ".github/SECURITY.md"
72
+ - ".github/workflows/cronjob.yml"
73
+ - ".github/workflows/deploy.yml"
74
+ - ".github/workflows/rubocop.yml"
75
+ - ".github/workflows/test-deploy.yml"
76
+ - ".github/workflows/test.yml"
193
77
  - ".gitignore"
194
- - ".travis.yml"
78
+ - ".nojekyll"
79
+ - ".rubocop.yml"
195
80
  - CHANGELOG.md
196
81
  - CONTRIBUTING.md
197
82
  - Gemfile
198
83
  - LICENSE
199
84
  - README.md
200
85
  - Rakefile
86
+ - bug_report_templates/test-ransack-scope-and-column-same-name.rb
87
+ - bug_report_templates/test-ransacker-arel-present-predicate.rb
88
+ - docs/.gitignore
89
+ - docs/.nojekyll
90
+ - docs/babel.config.js
91
+ - docs/blog/2022-03-27-ransack-3.0.0.md
92
+ - docs/docs/getting-started/_category_.json
93
+ - docs/docs/getting-started/advanced-mode.md
94
+ - docs/docs/getting-started/configuration.md
95
+ - docs/docs/getting-started/search-matches.md
96
+ - docs/docs/getting-started/simple-mode.md
97
+ - docs/docs/getting-started/sorting.md
98
+ - docs/docs/getting-started/using-predicates.md
99
+ - docs/docs/going-further/_category_.json
100
+ - docs/docs/going-further/acts-as-taggable-on.md
101
+ - docs/docs/going-further/associations.md
102
+ - docs/docs/going-further/custom-predicates.md
103
+ - docs/docs/going-further/documentation.md
104
+ - docs/docs/going-further/exporting-to-csv.md
105
+ - docs/docs/going-further/external-guides.md
106
+ - docs/docs/going-further/form-customisation.md
107
+ - docs/docs/going-further/i18n.md
108
+ - docs/docs/going-further/img/create_release.png
109
+ - docs/docs/going-further/merging-searches.md
110
+ - docs/docs/going-further/other-notes.md
111
+ - docs/docs/going-further/polymorphic-search.md
112
+ - docs/docs/going-further/ransackers.md
113
+ - docs/docs/going-further/release_process.md
114
+ - docs/docs/going-further/saving-queries.md
115
+ - docs/docs/going-further/searching-postgres.md
116
+ - docs/docs/going-further/wiki-contributors.md
117
+ - docs/docs/intro.md
118
+ - docs/docusaurus.config.js
119
+ - docs/package.json
120
+ - docs/sidebars.js
121
+ - docs/src/components/HomepageFeatures/index.js
122
+ - docs/src/components/HomepageFeatures/styles.module.css
123
+ - docs/src/css/custom.css
124
+ - docs/src/pages/index.module.css
125
+ - docs/src/pages/markdown-page.md
126
+ - docs/static/.nojekyll
127
+ - docs/static/img/docusaurus.png
128
+ - docs/static/img/favicon.ico
129
+ - docs/static/img/logo.svg
130
+ - docs/static/img/tutorial/docsVersionDropdown.png
131
+ - docs/static/img/tutorial/localeDropdown.png
132
+ - docs/static/img/undraw_docusaurus_mountain.svg
133
+ - docs/static/img/undraw_docusaurus_react.svg
134
+ - docs/static/img/undraw_docusaurus_tree.svg
135
+ - docs/static/logo/ransack-h.png
136
+ - docs/static/logo/ransack-h.svg
137
+ - docs/static/logo/ransack-v.png
138
+ - docs/static/logo/ransack-v.svg
139
+ - docs/static/logo/ransack.png
140
+ - docs/static/logo/ransack.svg
141
+ - docs/yarn.lock
142
+ - lib/polyamorous.rb
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
201
156
  - lib/ransack.rb
202
157
  - lib/ransack/adapters.rb
203
158
  - lib/ransack/adapters/active_record.rb
204
- - lib/ransack/adapters/active_record/3.0/compat.rb
205
- - lib/ransack/adapters/active_record/3.0/context.rb
206
- - lib/ransack/adapters/active_record/3.1/context.rb
207
- - lib/ransack/adapters/active_record/3.2/context.rb
208
159
  - lib/ransack/adapters/active_record/base.rb
209
- - lib/ransack/adapters/active_record/compat.rb
210
160
  - lib/ransack/adapters/active_record/context.rb
211
161
  - lib/ransack/adapters/active_record/ransack/constants.rb
212
162
  - lib/ransack/adapters/active_record/ransack/context.rb
213
163
  - lib/ransack/adapters/active_record/ransack/nodes/condition.rb
214
164
  - lib/ransack/adapters/active_record/ransack/translate.rb
215
165
  - lib/ransack/adapters/active_record/ransack/visitor.rb
216
- - lib/ransack/adapters/mongoid.rb
217
- - lib/ransack/adapters/mongoid/3.2/.gitkeep
218
- - lib/ransack/adapters/mongoid/attributes/attribute.rb
219
- - lib/ransack/adapters/mongoid/attributes/order_predications.rb
220
- - lib/ransack/adapters/mongoid/attributes/predications.rb
221
- - lib/ransack/adapters/mongoid/base.rb
222
- - lib/ransack/adapters/mongoid/context.rb
223
- - lib/ransack/adapters/mongoid/inquiry_hash.rb
224
- - lib/ransack/adapters/mongoid/ransack/constants.rb
225
- - lib/ransack/adapters/mongoid/ransack/context.rb
226
- - lib/ransack/adapters/mongoid/ransack/nodes/condition.rb
227
- - lib/ransack/adapters/mongoid/ransack/translate.rb
228
- - lib/ransack/adapters/mongoid/ransack/visitor.rb
229
- - lib/ransack/adapters/mongoid/table.rb
230
166
  - lib/ransack/configuration.rb
231
167
  - lib/ransack/constants.rb
232
168
  - lib/ransack/context.rb
233
169
  - lib/ransack/helpers.rb
234
170
  - lib/ransack/helpers/form_builder.rb
235
171
  - lib/ransack/helpers/form_helper.rb
172
+ - lib/ransack/locale/ar.yml
173
+ - lib/ransack/locale/az.yml
174
+ - lib/ransack/locale/bg.yml
175
+ - lib/ransack/locale/ca.yml
236
176
  - lib/ransack/locale/cs.yml
237
177
  - lib/ransack/locale/da.yml
238
178
  - lib/ransack/locale/de.yml
179
+ - lib/ransack/locale/el.yml
239
180
  - lib/ransack/locale/en.yml
240
181
  - lib/ransack/locale/es.yml
182
+ - lib/ransack/locale/fa.yml
183
+ - lib/ransack/locale/fi.yml
241
184
  - lib/ransack/locale/fr.yml
242
185
  - lib/ransack/locale/hu.yml
243
186
  - lib/ransack/locale/id.yml
@@ -246,6 +189,10 @@ files:
246
189
  - lib/ransack/locale/nl.yml
247
190
  - lib/ransack/locale/pt-BR.yml
248
191
  - lib/ransack/locale/ro.yml
192
+ - lib/ransack/locale/ru.yml
193
+ - lib/ransack/locale/sk.yml
194
+ - lib/ransack/locale/sv.yml
195
+ - lib/ransack/locale/tr.yml
249
196
  - lib/ransack/locale/zh-CN.yml
250
197
  - lib/ransack/locale/zh-TW.yml
251
198
  - lib/ransack/naming.rb
@@ -270,28 +217,20 @@ files:
270
217
  - spec/blueprints/people.rb
271
218
  - spec/blueprints/tags.rb
272
219
  - spec/console.rb
220
+ - spec/helpers/polyamorous_helper.rb
273
221
  - spec/helpers/ransack_helper.rb
274
- - spec/mongoid/adapters/mongoid/base_spec.rb
275
- - spec/mongoid/adapters/mongoid/context_spec.rb
276
- - spec/mongoid/configuration_spec.rb
277
- - spec/mongoid/dependencies_spec.rb
278
- - spec/mongoid/helpers/ransack_helper.rb
279
- - spec/mongoid/nodes/condition_spec.rb
280
- - spec/mongoid/nodes/grouping_spec.rb
281
- - spec/mongoid/predicate_spec.rb
282
- - spec/mongoid/search_spec.rb
283
- - spec/mongoid/support/mongoid.yml
284
- - spec/mongoid/support/schema.rb
285
- - spec/mongoid/translate_spec.rb
286
- - spec/mongoid_spec_helper.rb
222
+ - spec/polyamorous/activerecord_compatibility_spec.rb
223
+ - spec/polyamorous/join_association_spec.rb
224
+ - spec/polyamorous/join_dependency_spec.rb
225
+ - spec/polyamorous/join_spec.rb
287
226
  - spec/ransack/adapters/active_record/base_spec.rb
288
227
  - spec/ransack/adapters/active_record/context_spec.rb
289
228
  - spec/ransack/configuration_spec.rb
290
- - spec/ransack/dependencies_spec.rb
291
229
  - spec/ransack/helpers/form_builder_spec.rb
292
230
  - spec/ransack/helpers/form_helper_spec.rb
293
231
  - spec/ransack/nodes/condition_spec.rb
294
232
  - spec/ransack/nodes/grouping_spec.rb
233
+ - spec/ransack/nodes/value_spec.rb
295
234
  - spec/ransack/predicate_spec.rb
296
235
  - spec/ransack/search_spec.rb
297
236
  - spec/ransack/translate_spec.rb
@@ -302,7 +241,7 @@ homepage: https://github.com/activerecord-hackery/ransack
302
241
  licenses:
303
242
  - MIT
304
243
  metadata: {}
305
- post_install_message:
244
+ post_install_message:
306
245
  rdoc_options: []
307
246
  require_paths:
308
247
  - lib
@@ -310,18 +249,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
310
249
  requirements:
311
250
  - - ">="
312
251
  - !ruby/object:Gem::Version
313
- version: '1.9'
252
+ version: '2.7'
314
253
  required_rubygems_version: !ruby/object:Gem::Requirement
315
254
  requirements:
316
255
  - - ">="
317
256
  - !ruby/object:Gem::Version
318
257
  version: '0'
319
258
  requirements: []
320
- rubyforge_project: ransack
321
- rubygems_version: 2.6.13
322
- signing_key:
259
+ rubygems_version: 3.3.14
260
+ signing_key:
323
261
  specification_version: 4
324
- summary: Object-based searching for Active Record and Mongoid (currently).
262
+ summary: Object-based searching for Active Record.
325
263
  test_files:
326
264
  - spec/blueprints/articles.rb
327
265
  - spec/blueprints/comments.rb
@@ -329,28 +267,20 @@ test_files:
329
267
  - spec/blueprints/people.rb
330
268
  - spec/blueprints/tags.rb
331
269
  - spec/console.rb
270
+ - spec/helpers/polyamorous_helper.rb
332
271
  - spec/helpers/ransack_helper.rb
333
- - spec/mongoid/adapters/mongoid/base_spec.rb
334
- - spec/mongoid/adapters/mongoid/context_spec.rb
335
- - spec/mongoid/configuration_spec.rb
336
- - spec/mongoid/dependencies_spec.rb
337
- - spec/mongoid/helpers/ransack_helper.rb
338
- - spec/mongoid/nodes/condition_spec.rb
339
- - spec/mongoid/nodes/grouping_spec.rb
340
- - spec/mongoid/predicate_spec.rb
341
- - spec/mongoid/search_spec.rb
342
- - spec/mongoid/support/mongoid.yml
343
- - spec/mongoid/support/schema.rb
344
- - spec/mongoid/translate_spec.rb
345
- - spec/mongoid_spec_helper.rb
272
+ - spec/polyamorous/activerecord_compatibility_spec.rb
273
+ - spec/polyamorous/join_association_spec.rb
274
+ - spec/polyamorous/join_dependency_spec.rb
275
+ - spec/polyamorous/join_spec.rb
346
276
  - spec/ransack/adapters/active_record/base_spec.rb
347
277
  - spec/ransack/adapters/active_record/context_spec.rb
348
278
  - spec/ransack/configuration_spec.rb
349
- - spec/ransack/dependencies_spec.rb
350
279
  - spec/ransack/helpers/form_builder_spec.rb
351
280
  - spec/ransack/helpers/form_helper_spec.rb
352
281
  - spec/ransack/nodes/condition_spec.rb
353
282
  - spec/ransack/nodes/grouping_spec.rb
283
+ - spec/ransack/nodes/value_spec.rb
354
284
  - spec/ransack/predicate_spec.rb
355
285
  - spec/ransack/search_spec.rb
356
286
  - spec/ransack/translate_spec.rb