ransack 1.7.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) 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/test.yml +120 -0
  5. data/.gitignore +3 -0
  6. data/CHANGELOG.md +463 -27
  7. data/CONTRIBUTING.md +52 -22
  8. data/Gemfile +24 -24
  9. data/README.md +453 -126
  10. data/Rakefile +6 -25
  11. data/lib/polyamorous/activerecord_5.2_ruby_2/join_association.rb +24 -0
  12. data/lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb +79 -0
  13. data/lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb +11 -0
  14. data/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb +1 -0
  15. data/lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb +80 -0
  16. data/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb +1 -0
  17. data/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +74 -0
  18. data/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +93 -0
  19. data/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +1 -0
  20. data/lib/polyamorous/join.rb +70 -0
  21. data/lib/polyamorous/polyamorous.rb +24 -0
  22. data/lib/polyamorous/swapping_reflection_class.rb +11 -0
  23. data/lib/polyamorous/tree_node.rb +7 -0
  24. data/lib/ransack/adapters/active_record/base.rb +27 -2
  25. data/lib/ransack/adapters/active_record/context.rb +213 -139
  26. data/lib/ransack/adapters/active_record/ransack/constants.rb +70 -55
  27. data/lib/ransack/adapters/active_record/ransack/context.rb +10 -18
  28. data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +42 -32
  29. data/lib/ransack/adapters/active_record/ransack/translate.rb +1 -5
  30. data/lib/ransack/adapters/active_record/ransack/visitor.rb +23 -0
  31. data/lib/ransack/adapters/active_record.rb +11 -10
  32. data/lib/ransack/adapters.rb +45 -23
  33. data/lib/ransack/configuration.rb +107 -4
  34. data/lib/ransack/constants.rb +13 -26
  35. data/lib/ransack/context.rb +45 -33
  36. data/lib/ransack/helpers/form_builder.rb +21 -12
  37. data/lib/ransack/helpers/form_helper.rb +75 -70
  38. data/lib/ransack/locale/ar.yml +70 -0
  39. data/lib/ransack/locale/az.yml +70 -0
  40. data/lib/ransack/locale/bg.yml +70 -0
  41. data/lib/ransack/locale/ca.yml +70 -0
  42. data/lib/ransack/locale/da.yml +70 -0
  43. data/lib/ransack/locale/el.yml +70 -0
  44. data/lib/ransack/locale/es.yml +22 -22
  45. data/lib/ransack/locale/fa.yml +70 -0
  46. data/lib/ransack/locale/fi.yml +71 -0
  47. data/lib/ransack/locale/id.yml +70 -0
  48. data/lib/ransack/locale/it.yml +70 -0
  49. data/lib/ransack/locale/ja.yml +70 -0
  50. data/lib/ransack/locale/nl.yml +4 -4
  51. data/lib/ransack/locale/pt-BR.yml +70 -0
  52. data/lib/ransack/locale/ru.yml +70 -0
  53. data/lib/ransack/locale/sk.yml +70 -0
  54. data/lib/ransack/locale/tr.yml +70 -0
  55. data/lib/ransack/locale/{zh.yml → zh-CN.yml} +13 -13
  56. data/lib/ransack/locale/zh-TW.yml +70 -0
  57. data/lib/ransack/nodes/attribute.rb +5 -2
  58. data/lib/ransack/nodes/bindable.rb +18 -6
  59. data/lib/ransack/nodes/condition.rb +85 -28
  60. data/lib/ransack/nodes/grouping.rb +17 -11
  61. data/lib/ransack/nodes/sort.rb +9 -5
  62. data/lib/ransack/nodes/value.rb +74 -68
  63. data/lib/ransack/nodes.rb +1 -1
  64. data/lib/ransack/predicate.rb +17 -20
  65. data/lib/ransack/search.rb +17 -8
  66. data/lib/ransack/translate.rb +115 -115
  67. data/lib/ransack/version.rb +1 -1
  68. data/lib/ransack/visitor.rb +1 -12
  69. data/lib/ransack.rb +9 -9
  70. data/logo/ransack-h.png +0 -0
  71. data/logo/ransack-h.svg +34 -0
  72. data/logo/ransack-v.png +0 -0
  73. data/logo/ransack-v.svg +34 -0
  74. data/logo/ransack.png +0 -0
  75. data/logo/ransack.svg +21 -0
  76. data/ransack.gemspec +7 -24
  77. data/spec/console.rb +4 -0
  78. data/spec/helpers/polyamorous_helper.rb +19 -0
  79. data/spec/polyamorous/join_association_spec.rb +35 -0
  80. data/spec/polyamorous/join_dependency_spec.rb +97 -0
  81. data/spec/polyamorous/join_spec.rb +19 -0
  82. data/spec/ransack/adapters/active_record/base_spec.rb +370 -75
  83. data/spec/ransack/adapters/active_record/context_spec.rb +72 -34
  84. data/spec/ransack/configuration_spec.rb +97 -14
  85. data/spec/ransack/helpers/form_builder_spec.rb +2 -11
  86. data/spec/ransack/helpers/form_helper_spec.rb +481 -113
  87. data/spec/ransack/nodes/condition_spec.rb +24 -0
  88. data/spec/ransack/nodes/grouping_spec.rb +56 -0
  89. data/spec/ransack/predicate_spec.rb +79 -5
  90. data/spec/ransack/search_spec.rb +207 -81
  91. data/spec/spec_helper.rb +8 -0
  92. data/spec/support/schema.rb +100 -42
  93. metadata +57 -184
  94. data/.travis.yml +0 -69
  95. data/lib/ransack/adapters/active_record/3.0/compat.rb +0 -179
  96. data/lib/ransack/adapters/active_record/3.0/context.rb +0 -201
  97. data/lib/ransack/adapters/active_record/3.1/context.rb +0 -215
  98. data/lib/ransack/adapters/active_record/3.2/context.rb +0 -44
  99. data/lib/ransack/adapters/active_record/compat.rb +0 -14
  100. data/lib/ransack/adapters/mongoid/3.2/.gitkeep +0 -0
  101. data/lib/ransack/adapters/mongoid/attributes/attribute.rb +0 -37
  102. data/lib/ransack/adapters/mongoid/attributes/order_predications.rb +0 -17
  103. data/lib/ransack/adapters/mongoid/attributes/predications.rb +0 -141
  104. data/lib/ransack/adapters/mongoid/base.rb +0 -130
  105. data/lib/ransack/adapters/mongoid/context.rb +0 -208
  106. data/lib/ransack/adapters/mongoid/inquiry_hash.rb +0 -23
  107. data/lib/ransack/adapters/mongoid/ransack/constants.rb +0 -88
  108. data/lib/ransack/adapters/mongoid/ransack/context.rb +0 -60
  109. data/lib/ransack/adapters/mongoid/ransack/nodes/condition.rb +0 -27
  110. data/lib/ransack/adapters/mongoid/ransack/translate.rb +0 -13
  111. data/lib/ransack/adapters/mongoid/ransack/visitor.rb +0 -24
  112. data/lib/ransack/adapters/mongoid/table.rb +0 -35
  113. data/lib/ransack/adapters/mongoid.rb +0 -13
  114. data/spec/mongoid/adapters/mongoid/base_spec.rb +0 -276
  115. data/spec/mongoid/adapters/mongoid/context_spec.rb +0 -56
  116. data/spec/mongoid/configuration_spec.rb +0 -102
  117. data/spec/mongoid/dependencies_spec.rb +0 -8
  118. data/spec/mongoid/helpers/ransack_helper.rb +0 -11
  119. data/spec/mongoid/nodes/condition_spec.rb +0 -34
  120. data/spec/mongoid/nodes/grouping_spec.rb +0 -13
  121. data/spec/mongoid/predicate_spec.rb +0 -155
  122. data/spec/mongoid/search_spec.rb +0 -446
  123. data/spec/mongoid/support/mongoid.yml +0 -6
  124. data/spec/mongoid/support/schema.rb +0 -128
  125. data/spec/mongoid/translate_spec.rb +0 -14
  126. data/spec/mongoid_spec_helper.rb +0 -59
  127. 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,23 +29,18 @@ 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
33
- belongs_to :parent, :class_name => 'Person', :foreign_key => :parent_id
34
- has_many :children, :class_name => 'Person', :foreign_key => :parent_id
32
+ default_scope { order(id: :desc) }
33
+ belongs_to :parent, class_name: 'Person', foreign_key: :parent_id
34
+ has_many :children, class_name: 'Person', foreign_key: :parent_id
35
35
  has_many :articles
36
- if ActiveRecord::VERSION::MAJOR == 3
37
- has_many :published_articles, conditions: { published: true }, class_name: "Article"
38
- else
39
- has_many :published_articles, ->{ where(published: true) }, class_name: "Article"
40
- end
36
+ has_many :story_articles
37
+
38
+ has_many :published_articles, ->{ where(published: true) },
39
+ class_name: "Article"
41
40
  has_many :comments
42
- has_many :authored_article_comments, :through => :articles,
43
- :source => :comments, :foreign_key => :person_id
44
- has_many :notes, :as => :notable
41
+ has_many :authored_article_comments, through: :articles,
42
+ source: :comments, foreign_key: :person_id
43
+ has_many :notes, as: :notable
45
44
 
46
45
  scope :restricted, lambda { where("restricted = 1") }
47
46
  scope :active, lambda { where("active = 1") }
@@ -50,30 +49,53 @@ class Person < ActiveRecord::Base
50
49
  of_age ? where("age >= ?", 18) : where("age < ?", 18)
51
50
  }
52
51
 
53
- ransacker :reversed_name, :formatter => proc { |v| v.reverse } do |parent|
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
+
55
+ alias_attribute :full_name, :name
56
+
57
+ ransack_alias :term, :name_or_email
58
+ ransack_alias :daddy, :parent_name
59
+
60
+ ransacker :reversed_name, formatter: proc { |v| v.reverse } do |parent|
54
61
  parent.table[:name]
55
62
  end
56
63
 
57
- ransacker :array_users,
64
+ ransacker :array_people_ids,
58
65
  formatter: proc { |v| Person.first(2).map(&:id) } do |parent|
59
66
  parent.table[:id]
60
67
  end
61
68
 
62
- ransacker :array_names,
69
+ ransacker :array_where_people_ids,
70
+ formatter: proc { |v| Person.where(id: v).map(&:id) } do |parent|
71
+ parent.table[:id]
72
+ end
73
+
74
+ ransacker :array_people_names,
63
75
  formatter: proc { |v| Person.first(2).map { |p| p.id.to_s } } do |parent|
64
76
  parent.table[:name]
65
77
  end
66
78
 
79
+ ransacker :array_where_people_names,
80
+ formatter: proc { |v| Person.where(id: v).map { |p| p.id.to_s } } do |parent|
81
+ parent.table[:name]
82
+ end
83
+
67
84
  ransacker :doubled_name do |parent|
68
85
  Arel::Nodes::InfixOperation.new(
69
86
  '||', parent.table[:name], parent.table[:name]
70
87
  )
71
88
  end
72
89
 
90
+
73
91
  ransacker :sql_literal_id do
74
92
  Arel.sql('people.id')
75
93
  end
76
94
 
95
+ ransacker :name_case_insensitive, type: :string do
96
+ arel_table[:name].lower
97
+ end
98
+
77
99
  ransacker :with_arguments, args: [:parent, :ransacker_args] do |parent, args|
78
100
  min, max = args
79
101
  query = <<-SQL
@@ -84,14 +106,16 @@ class Person < ActiveRecord::Base
84
106
  GROUP BY articles.person_id
85
107
  )
86
108
  SQL
109
+ .squish
87
110
  Arel.sql(query)
88
111
  end
89
112
 
113
+
90
114
  def self.ransackable_attributes(auth_object = nil)
91
115
  if auth_object == :admin
92
- column_names + _ransackers.keys - ['only_sort']
116
+ super - ['only_sort']
93
117
  else
94
- column_names + _ransackers.keys - ['only_sort', 'only_admin']
118
+ super - ['only_sort', 'only_admin']
95
119
  end
96
120
  end
97
121
 
@@ -102,20 +126,23 @@ class Person < ActiveRecord::Base
102
126
  column_names + _ransackers.keys - ['only_search', 'only_admin']
103
127
  end
104
128
  end
129
+ end
105
130
 
131
+ class Musician < Person
106
132
  end
107
133
 
108
134
  class Article < ActiveRecord::Base
109
135
  belongs_to :person
110
136
  has_many :comments
111
137
  has_and_belongs_to_many :tags
112
- has_many :notes, :as => :notable
138
+ has_many :notes, as: :notable
113
139
 
114
- if ActiveRecord::VERSION::STRING >= '3.1'
115
- default_scope { where("'default_scope' = 'default_scope'") }
116
- else # Rails 3.0 does not accept a block
117
- default_scope where("'default_scope' = 'default_scope'")
118
- end
140
+ alias_attribute :content, :body
141
+
142
+ default_scope { where("'default_scope' = 'default_scope'") }
143
+ end
144
+
145
+ class StoryArticle < Article
119
146
  end
120
147
 
121
148
  class Recommendation < ActiveRecord::Base
@@ -139,6 +166,8 @@ end
139
166
  class Comment < ActiveRecord::Base
140
167
  belongs_to :article
141
168
  belongs_to :person
169
+
170
+ default_scope { where(disabled: false) }
142
171
  end
143
172
 
144
173
  class Tag < ActiveRecord::Base
@@ -146,7 +175,7 @@ class Tag < ActiveRecord::Base
146
175
  end
147
176
 
148
177
  class Note < ActiveRecord::Base
149
- belongs_to :notable, :polymorphic => true
178
+ belongs_to :notable, polymorphic: true
150
179
  end
151
180
 
152
181
  module Schema
@@ -154,7 +183,7 @@ module Schema
154
183
  ActiveRecord::Migration.verbose = false
155
184
 
156
185
  ActiveRecord::Schema.define do
157
- create_table :people, :force => true do |t|
186
+ create_table :people, force: true do |t|
158
187
  t.integer :parent_id
159
188
  t.string :name
160
189
  t.string :email
@@ -171,36 +200,38 @@ module Schema
171
200
  t.timestamps null: false
172
201
  end
173
202
 
174
- create_table :articles, :force => true do |t|
203
+ create_table :articles, force: true do |t|
175
204
  t.integer :person_id
176
205
  t.string :title
177
206
  t.text :subject_header
178
207
  t.text :body
208
+ t.string :type
179
209
  t.boolean :published, default: true
180
210
  end
181
211
 
182
- create_table :comments, :force => true do |t|
212
+ create_table :comments, force: true do |t|
183
213
  t.integer :article_id
184
214
  t.integer :person_id
185
215
  t.text :body
216
+ t.boolean :disabled, default: false
186
217
  end
187
218
 
188
- create_table :tags, :force => true do |t|
219
+ create_table :tags, force: true do |t|
189
220
  t.string :name
190
221
  end
191
222
 
192
- create_table :articles_tags, :force => true, :id => false do |t|
223
+ create_table :articles_tags, force: true, id: false do |t|
193
224
  t.integer :article_id
194
225
  t.integer :tag_id
195
226
  end
196
227
 
197
- create_table :notes, :force => true do |t|
228
+ create_table :notes, force: true do |t|
198
229
  t.integer :notable_id
199
230
  t.string :notable_type
200
231
  t.string :note
201
232
  end
202
233
 
203
- create_table :recommendations, :force => true do |t|
234
+ create_table :recommendations, force: true do |t|
204
235
  t.integer :person_id
205
236
  t.integer :target_person_id
206
237
  t.integer :article_id
@@ -209,22 +240,49 @@ module Schema
209
240
 
210
241
  10.times do
211
242
  person = Person.make
212
- Note.make(:notable => person)
243
+ Note.make(notable: person)
213
244
  3.times do
214
- article = Article.make(:person => person)
245
+ article = Article.make(person: person)
215
246
  3.times do
216
247
  article.tags = [Tag.make, Tag.make, Tag.make]
217
248
  end
218
- Note.make(:notable => article)
249
+ Note.make(notable: article)
219
250
  10.times do
220
- Comment.make(:article => article, :person => person)
251
+ Comment.make(article: article, person: person)
221
252
  end
222
253
  end
223
254
  end
224
255
 
225
256
  Comment.make(
226
- :body => 'First post!',
227
- :article => Article.make(:title => 'Hello, world!')
228
- )
257
+ body: 'First post!',
258
+ article: Article.make(title: 'Hello, world!')
259
+ )
260
+ end
261
+ end
262
+
263
+ module SubDB
264
+ class Base < ActiveRecord::Base
265
+ self.abstract_class = true
266
+ establish_connection(
267
+ adapter: 'sqlite3',
268
+ database: ':memory:'
269
+ )
270
+ end
271
+
272
+ class OperationHistory < Base
273
+ end
274
+
275
+ module Schema
276
+ def self.create
277
+ s = ::ActiveRecord::Schema.new
278
+ s.instance_variable_set(:@connection, SubDB::Base.connection)
279
+ s.verbose = false
280
+ s.define({}) do
281
+ create_table :operation_histories, force: true do |t|
282
+ t.string :operation_type
283
+ t.integer :people_id
284
+ end
285
+ end
286
+ end
229
287
  end
230
288
  end
metadata CHANGED
@@ -1,59 +1,46 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ransack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernie Miller
8
8
  - Ryan Bigg
9
9
  - Jon Atack
10
+ - Sean Carroll
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2015-08-20 00:00:00.000000000 Z
14
+ date: 2020-12-21 00:00:00.000000000 Z
14
15
  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
16
  - !ruby/object:Gem::Dependency
30
17
  name: activerecord
31
18
  requirement: !ruby/object:Gem::Requirement
32
19
  requirements:
33
20
  - - ">="
34
21
  - !ruby/object:Gem::Version
35
- version: '3.0'
22
+ version: 5.2.4
36
23
  type: :runtime
37
24
  prerelease: false
38
25
  version_requirements: !ruby/object:Gem::Requirement
39
26
  requirements:
40
27
  - - ">="
41
28
  - !ruby/object:Gem::Version
42
- version: '3.0'
29
+ version: 5.2.4
43
30
  - !ruby/object:Gem::Dependency
44
31
  name: activesupport
45
32
  requirement: !ruby/object:Gem::Requirement
46
33
  requirements:
47
34
  - - ">="
48
35
  - !ruby/object:Gem::Version
49
- version: '3.0'
36
+ version: 5.2.4
50
37
  type: :runtime
51
38
  prerelease: false
52
39
  version_requirements: !ruby/object:Gem::Requirement
53
40
  requirements:
54
41
  - - ">="
55
42
  - !ruby/object:Gem::Version
56
- version: '3.0'
43
+ version: 5.2.4
57
44
  - !ruby/object:Gem::Dependency
58
45
  name: i18n
59
46
  requirement: !ruby/object:Gem::Requirement
@@ -68,180 +55,81 @@ dependencies:
68
55
  - - ">="
69
56
  - !ruby/object:Gem::Version
70
57
  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.2'
78
- type: :runtime
79
- prerelease: false
80
- version_requirements: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - "~>"
83
- - !ruby/object:Gem::Version
84
- version: '1.2'
85
- - !ruby/object:Gem::Dependency
86
- name: rspec
87
- requirement: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - "~>"
90
- - !ruby/object:Gem::Version
91
- version: '2'
92
- type: :development
93
- prerelease: false
94
- version_requirements: !ruby/object:Gem::Requirement
95
- requirements:
96
- - - "~>"
97
- - !ruby/object:Gem::Version
98
- version: '2'
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.18
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.18
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.9.12.2
176
- type: :development
177
- prerelease: false
178
- version_requirements: !ruby/object:Gem::Requirement
179
- requirements:
180
- - - '='
181
- - !ruby/object:Gem::Version
182
- version: 0.9.12.2
183
58
  description: Ransack is the successor to the MetaSearch gem. It improves and expands
184
59
  upon MetaSearch's functionality, but does not have a 100%-compatible API.
185
60
  email:
186
61
  - ernie@erniemiller.org
187
62
  - radarlistener@gmail.com
188
63
  - jonnyatack@gmail.com
64
+ - sfcarroll@gmail.com
189
65
  executables: []
190
66
  extensions: []
191
67
  extra_rdoc_files: []
192
68
  files:
69
+ - ".github/FUNDING.yml"
70
+ - ".github/SECURITY.md"
71
+ - ".github/workflows/test.yml"
193
72
  - ".gitignore"
194
- - ".travis.yml"
195
73
  - CHANGELOG.md
196
74
  - CONTRIBUTING.md
197
75
  - Gemfile
198
76
  - LICENSE
199
77
  - README.md
200
78
  - Rakefile
79
+ - lib/polyamorous/activerecord_5.2_ruby_2/join_association.rb
80
+ - lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb
81
+ - lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb
82
+ - lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb
83
+ - lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb
84
+ - lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb
85
+ - lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb
86
+ - lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb
87
+ - lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb
88
+ - lib/polyamorous/join.rb
89
+ - lib/polyamorous/polyamorous.rb
90
+ - lib/polyamorous/swapping_reflection_class.rb
91
+ - lib/polyamorous/tree_node.rb
201
92
  - lib/ransack.rb
202
93
  - lib/ransack/adapters.rb
203
94
  - 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
95
  - lib/ransack/adapters/active_record/base.rb
209
- - lib/ransack/adapters/active_record/compat.rb
210
96
  - lib/ransack/adapters/active_record/context.rb
211
97
  - lib/ransack/adapters/active_record/ransack/constants.rb
212
98
  - lib/ransack/adapters/active_record/ransack/context.rb
213
99
  - lib/ransack/adapters/active_record/ransack/nodes/condition.rb
214
100
  - lib/ransack/adapters/active_record/ransack/translate.rb
215
101
  - 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
102
  - lib/ransack/configuration.rb
231
103
  - lib/ransack/constants.rb
232
104
  - lib/ransack/context.rb
233
105
  - lib/ransack/helpers.rb
234
106
  - lib/ransack/helpers/form_builder.rb
235
107
  - lib/ransack/helpers/form_helper.rb
108
+ - lib/ransack/locale/ar.yml
109
+ - lib/ransack/locale/az.yml
110
+ - lib/ransack/locale/bg.yml
111
+ - lib/ransack/locale/ca.yml
236
112
  - lib/ransack/locale/cs.yml
113
+ - lib/ransack/locale/da.yml
237
114
  - lib/ransack/locale/de.yml
115
+ - lib/ransack/locale/el.yml
238
116
  - lib/ransack/locale/en.yml
239
117
  - lib/ransack/locale/es.yml
118
+ - lib/ransack/locale/fa.yml
119
+ - lib/ransack/locale/fi.yml
240
120
  - lib/ransack/locale/fr.yml
241
121
  - lib/ransack/locale/hu.yml
122
+ - lib/ransack/locale/id.yml
123
+ - lib/ransack/locale/it.yml
124
+ - lib/ransack/locale/ja.yml
242
125
  - lib/ransack/locale/nl.yml
126
+ - lib/ransack/locale/pt-BR.yml
243
127
  - lib/ransack/locale/ro.yml
244
- - lib/ransack/locale/zh.yml
128
+ - lib/ransack/locale/ru.yml
129
+ - lib/ransack/locale/sk.yml
130
+ - lib/ransack/locale/tr.yml
131
+ - lib/ransack/locale/zh-CN.yml
132
+ - lib/ransack/locale/zh-TW.yml
245
133
  - lib/ransack/naming.rb
246
134
  - lib/ransack/nodes.rb
247
135
  - lib/ransack/nodes/attribute.rb
@@ -257,6 +145,12 @@ files:
257
145
  - lib/ransack/translate.rb
258
146
  - lib/ransack/version.rb
259
147
  - lib/ransack/visitor.rb
148
+ - logo/ransack-h.png
149
+ - logo/ransack-h.svg
150
+ - logo/ransack-v.png
151
+ - logo/ransack-v.svg
152
+ - logo/ransack.png
153
+ - logo/ransack.svg
260
154
  - ransack.gemspec
261
155
  - spec/blueprints/articles.rb
262
156
  - spec/blueprints/comments.rb
@@ -264,24 +158,14 @@ files:
264
158
  - spec/blueprints/people.rb
265
159
  - spec/blueprints/tags.rb
266
160
  - spec/console.rb
161
+ - spec/helpers/polyamorous_helper.rb
267
162
  - spec/helpers/ransack_helper.rb
268
- - spec/mongoid/adapters/mongoid/base_spec.rb
269
- - spec/mongoid/adapters/mongoid/context_spec.rb
270
- - spec/mongoid/configuration_spec.rb
271
- - spec/mongoid/dependencies_spec.rb
272
- - spec/mongoid/helpers/ransack_helper.rb
273
- - spec/mongoid/nodes/condition_spec.rb
274
- - spec/mongoid/nodes/grouping_spec.rb
275
- - spec/mongoid/predicate_spec.rb
276
- - spec/mongoid/search_spec.rb
277
- - spec/mongoid/support/mongoid.yml
278
- - spec/mongoid/support/schema.rb
279
- - spec/mongoid/translate_spec.rb
280
- - spec/mongoid_spec_helper.rb
163
+ - spec/polyamorous/join_association_spec.rb
164
+ - spec/polyamorous/join_dependency_spec.rb
165
+ - spec/polyamorous/join_spec.rb
281
166
  - spec/ransack/adapters/active_record/base_spec.rb
282
167
  - spec/ransack/adapters/active_record/context_spec.rb
283
168
  - spec/ransack/configuration_spec.rb
284
- - spec/ransack/dependencies_spec.rb
285
169
  - spec/ransack/helpers/form_builder_spec.rb
286
170
  - spec/ransack/helpers/form_helper_spec.rb
287
171
  - spec/ransack/nodes/condition_spec.rb
@@ -304,15 +188,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
304
188
  requirements:
305
189
  - - ">="
306
190
  - !ruby/object:Gem::Version
307
- version: '1.9'
191
+ version: '2.3'
308
192
  required_rubygems_version: !ruby/object:Gem::Requirement
309
193
  requirements:
310
194
  - - ">="
311
195
  - !ruby/object:Gem::Version
312
196
  version: '0'
313
197
  requirements: []
314
- rubyforge_project: ransack
315
- rubygems_version: 2.4.8
198
+ rubygems_version: 3.0.3
316
199
  signing_key:
317
200
  specification_version: 4
318
201
  summary: Object-based searching for Active Record and Mongoid (currently).
@@ -323,24 +206,14 @@ test_files:
323
206
  - spec/blueprints/people.rb
324
207
  - spec/blueprints/tags.rb
325
208
  - spec/console.rb
209
+ - spec/helpers/polyamorous_helper.rb
326
210
  - spec/helpers/ransack_helper.rb
327
- - spec/mongoid/adapters/mongoid/base_spec.rb
328
- - spec/mongoid/adapters/mongoid/context_spec.rb
329
- - spec/mongoid/configuration_spec.rb
330
- - spec/mongoid/dependencies_spec.rb
331
- - spec/mongoid/helpers/ransack_helper.rb
332
- - spec/mongoid/nodes/condition_spec.rb
333
- - spec/mongoid/nodes/grouping_spec.rb
334
- - spec/mongoid/predicate_spec.rb
335
- - spec/mongoid/search_spec.rb
336
- - spec/mongoid/support/mongoid.yml
337
- - spec/mongoid/support/schema.rb
338
- - spec/mongoid/translate_spec.rb
339
- - spec/mongoid_spec_helper.rb
211
+ - spec/polyamorous/join_association_spec.rb
212
+ - spec/polyamorous/join_dependency_spec.rb
213
+ - spec/polyamorous/join_spec.rb
340
214
  - spec/ransack/adapters/active_record/base_spec.rb
341
215
  - spec/ransack/adapters/active_record/context_spec.rb
342
216
  - spec/ransack/configuration_spec.rb
343
- - spec/ransack/dependencies_spec.rb
344
217
  - spec/ransack/helpers/form_builder_spec.rb
345
218
  - spec/ransack/helpers/form_helper_spec.rb
346
219
  - spec/ransack/nodes/condition_spec.rb