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