ransack 2.1.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +32 -22
  4. data/CHANGELOG.md +60 -1
  5. data/CONTRIBUTING.md +11 -6
  6. data/Gemfile +21 -17
  7. data/README.md +56 -29
  8. data/lib/polyamorous/{activerecord_5.2.1_ruby_2 → activerecord_5.2_ruby_2}/join_association.rb +2 -9
  9. data/lib/polyamorous/{activerecord_5.2.1_ruby_2 → activerecord_5.2_ruby_2}/join_dependency.rb +25 -3
  10. data/lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb +11 -0
  11. data/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb +1 -0
  12. data/lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb +80 -0
  13. data/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb +1 -0
  14. data/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +74 -0
  15. data/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +93 -0
  16. data/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +1 -0
  17. data/lib/{polyamorous.rb → polyamorous/polyamorous.rb} +3 -3
  18. data/lib/ransack.rb +2 -2
  19. data/lib/ransack/adapters/active_record/base.rb +1 -0
  20. data/lib/ransack/adapters/active_record/context.rb +60 -68
  21. data/lib/ransack/adapters/active_record/ransack/constants.rb +17 -2
  22. data/lib/ransack/adapters/active_record/ransack/context.rb +2 -6
  23. data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +12 -5
  24. data/lib/ransack/adapters/active_record/ransack/translate.rb +1 -1
  25. data/lib/ransack/constants.rb +2 -3
  26. data/lib/ransack/context.rb +19 -18
  27. data/lib/ransack/helpers/form_builder.rb +5 -11
  28. data/lib/ransack/helpers/form_helper.rb +1 -1
  29. data/lib/ransack/locale/ar.yml +70 -0
  30. data/lib/ransack/locale/az.yml +1 -1
  31. data/lib/ransack/locale/ca.yml +70 -0
  32. data/lib/ransack/locale/es.yml +22 -22
  33. data/lib/ransack/locale/fa.yml +70 -0
  34. data/lib/ransack/locale/fi.yml +71 -0
  35. data/lib/ransack/locale/sk.yml +70 -0
  36. data/lib/ransack/locale/zh-CN.yml +12 -12
  37. data/lib/ransack/nodes/condition.rb +8 -0
  38. data/lib/ransack/nodes/grouping.rb +1 -1
  39. data/lib/ransack/predicate.rb +2 -1
  40. data/lib/ransack/search.rb +1 -0
  41. data/lib/ransack/translate.rb +115 -115
  42. data/lib/ransack/version.rb +1 -1
  43. data/ransack.gemspec +5 -21
  44. data/spec/helpers/polyamorous_helper.rb +3 -8
  45. data/spec/{ransack → polyamorous}/join_association_spec.rb +7 -0
  46. data/spec/{ransack → polyamorous}/join_dependency_spec.rb +18 -7
  47. data/spec/{ransack → polyamorous}/join_spec.rb +0 -0
  48. data/spec/ransack/adapters/active_record/base_spec.rb +8 -8
  49. data/spec/ransack/adapters/active_record/context_spec.rb +60 -17
  50. data/spec/ransack/helpers/form_helper_spec.rb +51 -51
  51. data/spec/ransack/predicate_spec.rb +54 -2
  52. data/spec/ransack/search_spec.rb +78 -13
  53. data/spec/spec_helper.rb +4 -0
  54. data/spec/support/schema.rb +13 -2
  55. metadata +29 -136
  56. data/lib/polyamorous/activerecord_5.0_ruby_2/join_association.rb +0 -2
  57. data/lib/polyamorous/activerecord_5.0_ruby_2/join_dependency.rb +0 -2
  58. data/lib/polyamorous/activerecord_5.1_ruby_2/join_association.rb +0 -32
  59. data/lib/polyamorous/activerecord_5.1_ruby_2/join_dependency.rb +0 -112
  60. data/lib/polyamorous/activerecord_5.2.0_ruby_2/join_association.rb +0 -32
  61. data/lib/polyamorous/activerecord_5.2.0_ruby_2/join_dependency.rb +0 -113
@@ -126,7 +126,7 @@ module Ransack
126
126
  (if ActiveRecord::Base.connection.adapter_name == "PostgreSQL"
127
127
  /"people"."name" ILIKE '%\\%\\.\\_\\\\%'/
128
128
  elsif ActiveRecord::Base.connection.adapter_name == "Mysql2"
129
- /`people`.`name` LIKE '%\\\\%\\\\.\\\\_\\\\\\\\%'/
129
+ /`people`.`name` LIKE '%\\\\%.\\\\_\\\\\\\\%'/
130
130
  else
131
131
  /"people"."name" LIKE '%%._\\%'/
132
132
  end) do
@@ -145,7 +145,7 @@ module Ransack
145
145
  (if ActiveRecord::Base.connection.adapter_name == "PostgreSQL"
146
146
  /"people"."name" NOT ILIKE '%\\%\\.\\_\\\\%'/
147
147
  elsif ActiveRecord::Base.connection.adapter_name == "Mysql2"
148
- /`people`.`name` NOT LIKE '%\\\\%\\\\.\\\\_\\\\\\\\%'/
148
+ /`people`.`name` NOT LIKE '%\\\\%.\\\\_\\\\\\\\%'/
149
149
  else
150
150
  /"people"."name" NOT LIKE '%%._\\%'/
151
151
  end) do
@@ -159,6 +159,44 @@ module Ransack
159
159
  end
160
160
  end
161
161
 
162
+ describe 'i_cont' do
163
+ it_has_behavior 'wildcard escaping', :name_i_cont,
164
+ (if ActiveRecord::Base.connection.adapter_name == "PostgreSQL"
165
+ /"people"."name" ILIKE '%\\%\\.\\_\\\\%'/
166
+ elsif ActiveRecord::Base.connection.adapter_name == "Mysql2"
167
+ /LOWER\(`people`.`name`\) LIKE '%\\\\%.\\\\_\\\\\\\\%'/
168
+ else
169
+ /LOWER\("people"."name"\) LIKE '%%._\\%'/
170
+ end) do
171
+ subject { @s }
172
+ end
173
+
174
+ it 'generates a LIKE query with LOWER(column) and value surrounded by %' do
175
+ @s.name_i_cont = 'Ric'
176
+ field = "#{quote_table_name("people")}.#{quote_column_name("name")}"
177
+ expect(@s.result.to_sql).to match /[LOWER\(]?#{field}\)? I?LIKE '%ric%'/
178
+ end
179
+ end
180
+
181
+ describe 'not_i_cont' do
182
+ it_has_behavior 'wildcard escaping', :name_not_i_cont,
183
+ (if ActiveRecord::Base.connection.adapter_name == "PostgreSQL"
184
+ /"people"."name" NOT ILIKE '%\\%\\.\\_\\\\%'/
185
+ elsif ActiveRecord::Base.connection.adapter_name == "Mysql2"
186
+ /LOWER\(`people`.`name`\) NOT LIKE '%\\\\%.\\\\_\\\\\\\\%'/
187
+ else
188
+ /LOWER\("people"."name"\) NOT LIKE '%%._\\%'/
189
+ end) do
190
+ subject { @s }
191
+ end
192
+
193
+ it 'generates a NOT LIKE query with LOWER(column) and value surrounded by %' do
194
+ @s.name_not_i_cont = 'Ric'
195
+ field = "#{quote_table_name("people")}.#{quote_column_name("name")}"
196
+ expect(@s.result.to_sql).to match /[LOWER\(]?#{field}\)? NOT I?LIKE '%ric%'/
197
+ end
198
+ end
199
+
162
200
  describe 'start' do
163
201
  it 'generates a LIKE query with value followed by %' do
164
202
  @s.name_start = 'Er'
@@ -381,6 +419,20 @@ module Ransack
381
419
  end
382
420
  end
383
421
 
422
+ context "defining custom predicates" do
423
+ describe "with 'not_in' arel predicate" do
424
+ before do
425
+ Ransack.configure {|c| c.add_predicate "not_in_csv", arel_predicate: "not_in", formatter: proc { |v| v.split(",") } }
426
+ end
427
+
428
+ it 'generates a value IS NOT NULL query' do
429
+ @s.name_not_in_csv = ["a", "b"]
430
+ field = "#{quote_table_name("people")}.#{quote_column_name("name")}"
431
+ expect(@s.result.to_sql).to match /#{field} NOT IN \('a', 'b'\)/
432
+ end
433
+ end
434
+ end
435
+
384
436
  private
385
437
 
386
438
  def test_boolean_equality_for(boolean_value)
@@ -20,6 +20,12 @@ module Ransack
20
20
  Search.new(Person, name_eq: 'foobar')
21
21
  end
22
22
 
23
+ it 'strip leading & trailing whitespace before building' do
24
+ expect_any_instance_of(Search).to receive(:build)
25
+ .with({ 'name_eq' => 'foobar' })
26
+ Search.new(Person, name_eq: ' foobar ')
27
+ end
28
+
23
29
  it 'removes empty suffixed conditions before building' do
24
30
  expect_any_instance_of(Search).to receive(:build).with({})
25
31
  Search.new(Person, name_eq_any: [''])
@@ -109,6 +115,43 @@ module Ransack
109
115
  expect(s.result.to_sql).to include 'published'
110
116
  end
111
117
 
118
+ # The failure/oversight in Ransack::Nodes::Condition#arel_predicate or deeper is beyond my understanding of the structures
119
+ it 'preserves (inverts) default scope and conditions for negative subqueries' do
120
+ # the positive case (published_articles_title_eq) is
121
+ # SELECT "people".* FROM "people"
122
+ # LEFT OUTER JOIN "articles" ON "articles"."person_id" = "people"."id"
123
+ # AND "articles"."published" = 't'
124
+ # AND ('default_scope' = 'default_scope')
125
+ # WHERE "articles"."title" = 'Test' ORDER BY "people"."id" DESC
126
+ #
127
+ # negative case was
128
+ # SELECT "people".* FROM "people" WHERE "people"."id" NOT IN (
129
+ # SELECT "articles"."person_id" FROM "articles"
130
+ # WHERE "articles"."person_id" = "people"."id"
131
+ # AND NOT ("articles"."title" != 'Test')
132
+ # ) ORDER BY "people"."id" DESC
133
+ #
134
+ # Should have been like
135
+ # SELECT "people".* FROM "people" WHERE "people"."id" NOT IN (
136
+ # SELECT "articles"."person_id" FROM "articles"
137
+ # WHERE "articles"."person_id" = "people"."id"
138
+ # AND "articles"."title" = 'Test' AND "articles"."published" = 't' AND ('default_scope' = 'default_scope')
139
+ # ) ORDER BY "people"."id" DESC
140
+ #
141
+ # With tenanting (eg default_scope with column reference), NOT IN should be like
142
+ # SELECT "people".* FROM "people" WHERE "people"."tenant_id" = 'tenant_id' AND "people"."id" NOT IN (
143
+ # SELECT "articles"."person_id" FROM "articles"
144
+ # WHERE "articles"."person_id" = "people"."id"
145
+ # AND "articles"."tenant_id" = 'tenant_id'
146
+ # AND "articles"."title" = 'Test' AND "articles"."published" = 't' AND ('default_scope' = 'default_scope')
147
+ # ) ORDER BY "people"."id" DESC
148
+
149
+ pending("spec should pass, but I do not know how/where to fix lib code")
150
+ s = Search.new(Person, published_articles_title_not_eq: 'Test')
151
+ expect(s.result.to_sql).to include 'default_scope'
152
+ expect(s.result.to_sql).to include 'published'
153
+ end
154
+
112
155
  it 'discards empty conditions' do
113
156
  s = Search.new(Person, children_name_eq: '')
114
157
  condition = s.base[:children_name_eq]
@@ -220,6 +263,9 @@ module Ransack
220
263
  let(:children_people_name_field) {
221
264
  "#{quote_table_name("children_people")}.#{quote_column_name("name")}"
222
265
  }
266
+ let(:notable_type_field) {
267
+ "#{quote_table_name("notes")}.#{quote_column_name("notable_type")}"
268
+ }
223
269
  it 'evaluates conditions contextually' do
224
270
  s = Search.new(Person, children_name_eq: 'Ernie')
225
271
  expect(s.result).to be_an ActiveRecord::Relation
@@ -227,13 +273,34 @@ module Ransack
227
273
  children_people_name_field} = 'Ernie'/
228
274
  end
229
275
 
230
- # FIXME: Make this spec pass for Rails 4.1 / 4.2 / 5.0 and not just 4.0 by
231
- # commenting out lines 221 and 242 to run the test. Addresses issue #374.
232
- # https://github.com/activerecord-hackery/ransack/issues/374
233
- #
234
- it 'evaluates conditions for multiple `belongs_to` associations to the
235
- same table contextually' do
236
- skip "Make this spec pass for Rails >5.0"
276
+ it 'use appropriate table alias' do
277
+ skip "Rails 6 regressed here, but it's fixed in 6-0-stable since https://github.com/rails/rails/commit/f9ba52477ca288e7effa5f6794ae3df3f4e982bc" if ENV["RAILS"] == "v6.0.3"
278
+
279
+ s = Search.new(Person, {
280
+ name_eq: "person_name_query",
281
+ articles_title_eq: "person_article_title_query",
282
+ parent_name_eq: "parent_name_query",
283
+ parent_articles_title_eq: 'parents_article_title_query'
284
+ }).result
285
+
286
+ real_query = remove_quotes_and_backticks(s.to_sql)
287
+
288
+ expect(real_query)
289
+ .to match(%r{LEFT OUTER JOIN articles ON (\('default_scope' = 'default_scope'\) AND )?articles.person_id = people.id})
290
+ expect(real_query)
291
+ .to match(%r{LEFT OUTER JOIN articles articles_people ON (\('default_scope' = 'default_scope'\) AND )?articles_people.person_id = parents_people.id})
292
+
293
+ expect(real_query)
294
+ .to include "people.name = 'person_name_query'"
295
+ expect(real_query)
296
+ .to include "articles.title = 'person_article_title_query'"
297
+ expect(real_query)
298
+ .to include "parents_people.name = 'parent_name_query'"
299
+ expect(real_query)
300
+ .to include "articles_people.title = 'parents_article_title_query'"
301
+ end
302
+
303
+ it 'evaluates conditions for multiple `belongs_to` associations to the same table contextually' do
237
304
  s = Search.new(
238
305
  Recommendation,
239
306
  person_name_eq: 'Ernie',
@@ -248,7 +315,7 @@ module Ransack
248
315
  ON target_people_recommendations.id = recommendations.target_person_id
249
316
  LEFT OUTER JOIN people parents_people
250
317
  ON parents_people.id = target_people_recommendations.parent_id
251
- WHERE ((people.name = 'Ernie' AND parents_people.name = 'Test'))
318
+ WHERE (people.name = 'Ernie' AND parents_people.name = 'Test')
252
319
  SQL
253
320
  .squish
254
321
  expect(real_query).to eq expected_query
@@ -265,6 +332,7 @@ module Ransack
265
332
  s = Search.new(Note, notable_of_Person_type_name_eq: 'Ernie').result
266
333
  expect(s).to be_an ActiveRecord::Relation
267
334
  expect(s.to_sql).to match /#{people_name_field} = 'Ernie'/
335
+ expect(s.to_sql).to match /#{notable_type_field} = 'Person'/
268
336
  end
269
337
 
270
338
  it 'evaluates nested conditions' do
@@ -303,11 +371,8 @@ module Ransack
303
371
  { m: 'or', comments_body_cont: 'e', articles_comments_body_cont: 'e' }
304
372
  ]
305
373
  )
306
- if ActiveRecord::VERSION::MAJOR == 3
307
- all_or_load, uniq_or_distinct = :all, :uniq
308
- else
309
- all_or_load, uniq_or_distinct = :load, :distinct
310
- end
374
+
375
+ all_or_load, uniq_or_distinct = :load, :distinct
311
376
  expect(s.result.send(all_or_load).size)
312
377
  .to eq(9000)
313
378
  expect(s.result(distinct: true).size)
@@ -1,9 +1,13 @@
1
1
  require 'machinist/active_record'
2
+ require 'polyamorous/polyamorous.rb'
2
3
  require 'sham'
3
4
  require 'faker'
4
5
  require 'ransack'
6
+ require 'action_controller'
7
+ require 'ransack/helpers'
5
8
  require 'pry'
6
9
  require 'simplecov'
10
+ require 'byebug'
7
11
 
8
12
  SimpleCov.start
9
13
  I18n.enforce_available_locales = false
@@ -13,7 +13,9 @@ when 'pg', 'postgres', 'postgresql'
13
13
  ActiveRecord::Base.establish_connection(
14
14
  adapter: 'postgresql',
15
15
  database: 'ransack',
16
- # username: 'postgres', # Uncomment the username option if you have set one
16
+ username: ENV.fetch("DATABASE_USERNAME") { "postgres" },
17
+ password: ENV.fetch("DATABASE_PASSWORD") { "" },
18
+ host: ENV.fetch("DATABASE_HOST") { "localhost" },
17
19
  min_messages: 'warning'
18
20
  )
19
21
  else
@@ -29,6 +31,8 @@ class Person < ActiveRecord::Base
29
31
  belongs_to :parent, class_name: 'Person', foreign_key: :parent_id
30
32
  has_many :children, class_name: 'Person', foreign_key: :parent_id
31
33
  has_many :articles
34
+ has_many :story_articles
35
+
32
36
  has_many :published_articles, ->{ where(published: true) },
33
37
  class_name: "Article"
34
38
  has_many :comments
@@ -43,7 +47,7 @@ class Person < ActiveRecord::Base
43
47
  of_age ? where("age >= ?", 18) : where("age < ?", 18)
44
48
  }
45
49
 
46
- scope :sort_by_reverse_name_asc, lambda { order("REVERSE(name) ASC") }
50
+ scope :sort_by_reverse_name_asc, lambda { order(Arel.sql("REVERSE(name) ASC")) }
47
51
  scope :sort_by_reverse_name_desc, lambda { order("REVERSE(name) DESC") }
48
52
 
49
53
  alias_attribute :full_name, :name
@@ -136,6 +140,9 @@ class Article < ActiveRecord::Base
136
140
  default_scope { where("'default_scope' = 'default_scope'") }
137
141
  end
138
142
 
143
+ class StoryArticle < Article
144
+ end
145
+
139
146
  class Recommendation < ActiveRecord::Base
140
147
  belongs_to :person
141
148
  belongs_to :target_person, class_name: 'Person'
@@ -157,6 +164,8 @@ end
157
164
  class Comment < ActiveRecord::Base
158
165
  belongs_to :article
159
166
  belongs_to :person
167
+
168
+ default_scope { where(disabled: false) }
160
169
  end
161
170
 
162
171
  class Tag < ActiveRecord::Base
@@ -194,6 +203,7 @@ module Schema
194
203
  t.string :title
195
204
  t.text :subject_header
196
205
  t.text :body
206
+ t.string :type
197
207
  t.boolean :published, default: true
198
208
  end
199
209
 
@@ -201,6 +211,7 @@ module Schema
201
211
  t.integer :article_id
202
212
  t.integer :person_id
203
213
  t.text :body
214
+ t.boolean :disabled, default: false
204
215
  end
205
216
 
206
217
  create_table :tags, force: true do |t|
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: 2.1.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernie Miller
@@ -11,50 +11,36 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-10-26 00:00:00.000000000 Z
14
+ date: 2020-11-27 00:00:00.000000000 Z
15
15
  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
16
  - !ruby/object:Gem::Dependency
31
17
  name: activerecord
32
18
  requirement: !ruby/object:Gem::Requirement
33
19
  requirements:
34
20
  - - ">="
35
21
  - !ruby/object:Gem::Version
36
- version: '5.0'
22
+ version: 5.2.4
37
23
  type: :runtime
38
24
  prerelease: false
39
25
  version_requirements: !ruby/object:Gem::Requirement
40
26
  requirements:
41
27
  - - ">="
42
28
  - !ruby/object:Gem::Version
43
- version: '5.0'
29
+ version: 5.2.4
44
30
  - !ruby/object:Gem::Dependency
45
31
  name: activesupport
46
32
  requirement: !ruby/object:Gem::Requirement
47
33
  requirements:
48
34
  - - ">="
49
35
  - !ruby/object:Gem::Version
50
- version: '5.0'
36
+ version: 5.2.4
51
37
  type: :runtime
52
38
  prerelease: false
53
39
  version_requirements: !ruby/object:Gem::Requirement
54
40
  requirements:
55
41
  - - ">="
56
42
  - !ruby/object:Gem::Version
57
- version: '5.0'
43
+ version: 5.2.4
58
44
  - !ruby/object:Gem::Dependency
59
45
  name: i18n
60
46
  requirement: !ruby/object:Gem::Requirement
@@ -69,104 +55,6 @@ dependencies:
69
55
  - - ">="
70
56
  - !ruby/object:Gem::Version
71
57
  version: '0'
72
- - !ruby/object:Gem::Dependency
73
- name: rspec
74
- requirement: !ruby/object:Gem::Requirement
75
- requirements:
76
- - - "~>"
77
- - !ruby/object:Gem::Version
78
- version: '3'
79
- type: :development
80
- prerelease: false
81
- version_requirements: !ruby/object:Gem::Requirement
82
- requirements:
83
- - - "~>"
84
- - !ruby/object:Gem::Version
85
- version: '3'
86
- - !ruby/object:Gem::Dependency
87
- name: machinist
88
- requirement: !ruby/object:Gem::Requirement
89
- requirements:
90
- - - "~>"
91
- - !ruby/object:Gem::Version
92
- version: 1.0.6
93
- type: :development
94
- prerelease: false
95
- version_requirements: !ruby/object:Gem::Requirement
96
- requirements:
97
- - - "~>"
98
- - !ruby/object:Gem::Version
99
- version: 1.0.6
100
- - !ruby/object:Gem::Dependency
101
- name: faker
102
- requirement: !ruby/object:Gem::Requirement
103
- requirements:
104
- - - "~>"
105
- - !ruby/object:Gem::Version
106
- version: 0.9.5
107
- type: :development
108
- prerelease: false
109
- version_requirements: !ruby/object:Gem::Requirement
110
- requirements:
111
- - - "~>"
112
- - !ruby/object:Gem::Version
113
- version: 0.9.5
114
- - !ruby/object:Gem::Dependency
115
- name: sqlite3
116
- requirement: !ruby/object:Gem::Requirement
117
- requirements:
118
- - - "~>"
119
- - !ruby/object:Gem::Version
120
- version: 1.3.3
121
- type: :development
122
- prerelease: false
123
- version_requirements: !ruby/object:Gem::Requirement
124
- requirements:
125
- - - "~>"
126
- - !ruby/object:Gem::Version
127
- version: 1.3.3
128
- - !ruby/object:Gem::Dependency
129
- name: pg
130
- requirement: !ruby/object:Gem::Requirement
131
- requirements:
132
- - - "~>"
133
- - !ruby/object:Gem::Version
134
- version: '0.21'
135
- type: :development
136
- prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - "~>"
140
- - !ruby/object:Gem::Version
141
- version: '0.21'
142
- - !ruby/object:Gem::Dependency
143
- name: mysql2
144
- requirement: !ruby/object:Gem::Requirement
145
- requirements:
146
- - - '='
147
- - !ruby/object:Gem::Version
148
- version: 0.3.20
149
- type: :development
150
- prerelease: false
151
- version_requirements: !ruby/object:Gem::Requirement
152
- requirements:
153
- - - '='
154
- - !ruby/object:Gem::Version
155
- version: 0.3.20
156
- - !ruby/object:Gem::Dependency
157
- name: pry
158
- requirement: !ruby/object:Gem::Requirement
159
- requirements:
160
- - - '='
161
- - !ruby/object:Gem::Version
162
- version: '0.10'
163
- type: :development
164
- prerelease: false
165
- version_requirements: !ruby/object:Gem::Requirement
166
- requirements:
167
- - - '='
168
- - !ruby/object:Gem::Version
169
- version: '0.10'
170
58
  description: Ransack is the successor to the MetaSearch gem. It improves and expands
171
59
  upon MetaSearch's functionality, but does not have a 100%-compatible API.
172
60
  email:
@@ -186,16 +74,17 @@ files:
186
74
  - LICENSE
187
75
  - README.md
188
76
  - Rakefile
189
- - lib/polyamorous.rb
190
- - lib/polyamorous/activerecord_5.0_ruby_2/join_association.rb
191
- - lib/polyamorous/activerecord_5.0_ruby_2/join_dependency.rb
192
- - lib/polyamorous/activerecord_5.1_ruby_2/join_association.rb
193
- - lib/polyamorous/activerecord_5.1_ruby_2/join_dependency.rb
194
- - lib/polyamorous/activerecord_5.2.0_ruby_2/join_association.rb
195
- - lib/polyamorous/activerecord_5.2.0_ruby_2/join_dependency.rb
196
- - lib/polyamorous/activerecord_5.2.1_ruby_2/join_association.rb
197
- - lib/polyamorous/activerecord_5.2.1_ruby_2/join_dependency.rb
77
+ - lib/polyamorous/activerecord_5.2_ruby_2/join_association.rb
78
+ - lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb
79
+ - lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb
80
+ - lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb
81
+ - lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb
82
+ - lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb
83
+ - lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb
84
+ - lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb
85
+ - lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb
198
86
  - lib/polyamorous/join.rb
87
+ - lib/polyamorous/polyamorous.rb
199
88
  - lib/polyamorous/swapping_reflection_class.rb
200
89
  - lib/polyamorous/tree_node.rb
201
90
  - lib/ransack.rb
@@ -214,14 +103,18 @@ files:
214
103
  - lib/ransack/helpers.rb
215
104
  - lib/ransack/helpers/form_builder.rb
216
105
  - lib/ransack/helpers/form_helper.rb
106
+ - lib/ransack/locale/ar.yml
217
107
  - lib/ransack/locale/az.yml
218
108
  - lib/ransack/locale/bg.yml
109
+ - lib/ransack/locale/ca.yml
219
110
  - lib/ransack/locale/cs.yml
220
111
  - lib/ransack/locale/da.yml
221
112
  - lib/ransack/locale/de.yml
222
113
  - lib/ransack/locale/el.yml
223
114
  - lib/ransack/locale/en.yml
224
115
  - lib/ransack/locale/es.yml
116
+ - lib/ransack/locale/fa.yml
117
+ - lib/ransack/locale/fi.yml
225
118
  - lib/ransack/locale/fr.yml
226
119
  - lib/ransack/locale/hu.yml
227
120
  - lib/ransack/locale/id.yml
@@ -231,6 +124,7 @@ files:
231
124
  - lib/ransack/locale/pt-BR.yml
232
125
  - lib/ransack/locale/ro.yml
233
126
  - lib/ransack/locale/ru.yml
127
+ - lib/ransack/locale/sk.yml
234
128
  - lib/ransack/locale/tr.yml
235
129
  - lib/ransack/locale/zh-CN.yml
236
130
  - lib/ransack/locale/zh-TW.yml
@@ -264,14 +158,14 @@ files:
264
158
  - spec/console.rb
265
159
  - spec/helpers/polyamorous_helper.rb
266
160
  - spec/helpers/ransack_helper.rb
161
+ - spec/polyamorous/join_association_spec.rb
162
+ - spec/polyamorous/join_dependency_spec.rb
163
+ - spec/polyamorous/join_spec.rb
267
164
  - spec/ransack/adapters/active_record/base_spec.rb
268
165
  - spec/ransack/adapters/active_record/context_spec.rb
269
166
  - spec/ransack/configuration_spec.rb
270
167
  - spec/ransack/helpers/form_builder_spec.rb
271
168
  - spec/ransack/helpers/form_helper_spec.rb
272
- - spec/ransack/join_association_spec.rb
273
- - spec/ransack/join_dependency_spec.rb
274
- - spec/ransack/join_spec.rb
275
169
  - spec/ransack/nodes/condition_spec.rb
276
170
  - spec/ransack/nodes/grouping_spec.rb
277
171
  - spec/ransack/predicate_spec.rb
@@ -292,15 +186,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
292
186
  requirements:
293
187
  - - ">="
294
188
  - !ruby/object:Gem::Version
295
- version: '1.9'
189
+ version: '2.3'
296
190
  required_rubygems_version: !ruby/object:Gem::Requirement
297
191
  requirements:
298
192
  - - ">="
299
193
  - !ruby/object:Gem::Version
300
194
  version: '0'
301
195
  requirements: []
302
- rubyforge_project: ransack
303
- rubygems_version: 2.7.6
196
+ rubygems_version: 3.0.3
304
197
  signing_key:
305
198
  specification_version: 4
306
199
  summary: Object-based searching for Active Record and Mongoid (currently).
@@ -313,14 +206,14 @@ test_files:
313
206
  - spec/console.rb
314
207
  - spec/helpers/polyamorous_helper.rb
315
208
  - spec/helpers/ransack_helper.rb
209
+ - spec/polyamorous/join_association_spec.rb
210
+ - spec/polyamorous/join_dependency_spec.rb
211
+ - spec/polyamorous/join_spec.rb
316
212
  - spec/ransack/adapters/active_record/base_spec.rb
317
213
  - spec/ransack/adapters/active_record/context_spec.rb
318
214
  - spec/ransack/configuration_spec.rb
319
215
  - spec/ransack/helpers/form_builder_spec.rb
320
216
  - spec/ransack/helpers/form_helper_spec.rb
321
- - spec/ransack/join_association_spec.rb
322
- - spec/ransack/join_dependency_spec.rb
323
- - spec/ransack/join_spec.rb
324
217
  - spec/ransack/nodes/condition_spec.rb
325
218
  - spec/ransack/nodes/grouping_spec.rb
326
219
  - spec/ransack/predicate_spec.rb