torque-postgresql 2.2.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/torque/postgresql/adapter/database_statements.rb +12 -1
- data/lib/torque/postgresql/adapter/oid/enum_set.rb +1 -1
- data/lib/torque/postgresql/adapter/oid.rb +0 -3
- data/lib/torque/postgresql/adapter/quoting.rb +14 -19
- data/lib/torque/postgresql/adapter/schema_creation.rb +1 -2
- data/lib/torque/postgresql/adapter/schema_definitions.rb +0 -37
- data/lib/torque/postgresql/adapter/schema_dumper.rb +0 -40
- data/lib/torque/postgresql/adapter/schema_statements.rb +0 -15
- data/lib/torque/postgresql/adapter.rb +0 -9
- data/lib/torque/postgresql/associations/belongs_to_many_association.rb +5 -3
- data/lib/torque/postgresql/associations/{association.rb → foreign_association.rb} +1 -4
- data/lib/torque/postgresql/associations/preloader/association.rb +53 -26
- data/lib/torque/postgresql/associations/preloader/loader_query.rb +36 -0
- data/lib/torque/postgresql/associations/preloader.rb +1 -0
- data/lib/torque/postgresql/associations.rb +6 -1
- data/lib/torque/postgresql/attributes/builder/period.rb +6 -2
- data/lib/torque/postgresql/config.rb +2 -11
- data/lib/torque/postgresql/reflection/abstract_reflection.rb +5 -7
- data/lib/torque/postgresql/relation.rb +10 -12
- data/lib/torque/postgresql/schema_cache.rb +2 -1
- data/lib/torque/postgresql/version.rb +1 -1
- data/lib/torque-postgresql.rb +0 -1
- data/spec/models/question_select.rb +2 -0
- data/spec/schema.rb +147 -147
- data/spec/spec_helper.rb +7 -6
- data/spec/tests/arel_spec.rb +29 -7
- data/spec/tests/belongs_to_many_spec.rb +14 -0
- data/spec/tests/enum_set_spec.rb +7 -5
- data/spec/tests/enum_spec.rb +1 -84
- data/spec/tests/interval_spec.rb +2 -1
- metadata +49 -57
- data/lib/torque/range.rb +0 -20
- data/spec/tests/range_spec.rb +0 -36
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torque-postgresql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Silva
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '7.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '7.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pg
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,40 +124,34 @@ dependencies:
|
|
124
124
|
requirements:
|
125
125
|
- - "~>"
|
126
126
|
- !ruby/object:Gem::Version
|
127
|
-
version: '
|
127
|
+
version: '6.2'
|
128
128
|
- - ">="
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
130
|
+
version: 6.2.1
|
131
131
|
type: :development
|
132
132
|
prerelease: false
|
133
133
|
version_requirements: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
135
|
- - "~>"
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version: '
|
137
|
+
version: '6.2'
|
138
138
|
- - ">="
|
139
139
|
- !ruby/object:Gem::Version
|
140
|
-
version:
|
140
|
+
version: 6.2.1
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
142
|
name: faker
|
143
143
|
requirement: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
145
|
- - "~>"
|
146
146
|
- !ruby/object:Gem::Version
|
147
|
-
version: '
|
148
|
-
- - ">="
|
149
|
-
- !ruby/object:Gem::Version
|
150
|
-
version: 1.5.0
|
147
|
+
version: '2.20'
|
151
148
|
type: :development
|
152
149
|
prerelease: false
|
153
150
|
version_requirements: !ruby/object:Gem::Requirement
|
154
151
|
requirements:
|
155
152
|
- - "~>"
|
156
153
|
- !ruby/object:Gem::Version
|
157
|
-
version: '
|
158
|
-
- - ">="
|
159
|
-
- !ruby/object:Gem::Version
|
160
|
-
version: 1.5.0
|
154
|
+
version: '2.20'
|
161
155
|
description: Add support to complex resources of PostgreSQL, like data types, array
|
162
156
|
associations, and auxiliary statements (CTE)
|
163
157
|
email:
|
@@ -195,14 +189,15 @@ files:
|
|
195
189
|
- lib/torque/postgresql/arel/select_manager.rb
|
196
190
|
- lib/torque/postgresql/arel/visitors.rb
|
197
191
|
- lib/torque/postgresql/associations.rb
|
198
|
-
- lib/torque/postgresql/associations/association.rb
|
199
192
|
- lib/torque/postgresql/associations/association_scope.rb
|
200
193
|
- lib/torque/postgresql/associations/belongs_to_many_association.rb
|
201
194
|
- lib/torque/postgresql/associations/builder.rb
|
202
195
|
- lib/torque/postgresql/associations/builder/belongs_to_many.rb
|
203
196
|
- lib/torque/postgresql/associations/builder/has_many.rb
|
197
|
+
- lib/torque/postgresql/associations/foreign_association.rb
|
204
198
|
- lib/torque/postgresql/associations/preloader.rb
|
205
199
|
- lib/torque/postgresql/associations/preloader/association.rb
|
200
|
+
- lib/torque/postgresql/associations/preloader/loader_query.rb
|
206
201
|
- lib/torque/postgresql/attributes.rb
|
207
202
|
- lib/torque/postgresql/attributes/builder.rb
|
208
203
|
- lib/torque/postgresql/attributes/builder/enum.rb
|
@@ -238,7 +233,6 @@ files:
|
|
238
233
|
- lib/torque/postgresql/relation/merger.rb
|
239
234
|
- lib/torque/postgresql/schema_cache.rb
|
240
235
|
- lib/torque/postgresql/version.rb
|
241
|
-
- lib/torque/range.rb
|
242
236
|
- spec/en.yml
|
243
237
|
- spec/factories/authors.rb
|
244
238
|
- spec/factories/comments.rb
|
@@ -285,14 +279,13 @@ files:
|
|
285
279
|
- spec/tests/lazy_spec.rb
|
286
280
|
- spec/tests/period_spec.rb
|
287
281
|
- spec/tests/quoting_spec.rb
|
288
|
-
- spec/tests/range_spec.rb
|
289
282
|
- spec/tests/relation_spec.rb
|
290
283
|
- spec/tests/table_inheritance_spec.rb
|
291
284
|
homepage: https://github.com/crashtech/torque-postgresql
|
292
285
|
licenses:
|
293
286
|
- MIT
|
294
287
|
metadata: {}
|
295
|
-
post_install_message:
|
288
|
+
post_install_message:
|
296
289
|
rdoc_options: []
|
297
290
|
require_paths:
|
298
291
|
- lib
|
@@ -300,64 +293,63 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
300
293
|
requirements:
|
301
294
|
- - ">="
|
302
295
|
- !ruby/object:Gem::Version
|
303
|
-
version: 2.
|
296
|
+
version: 2.7.2
|
304
297
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
305
298
|
requirements:
|
306
299
|
- - ">="
|
307
300
|
- !ruby/object:Gem::Version
|
308
301
|
version: 1.8.11
|
309
302
|
requirements: []
|
310
|
-
rubygems_version: 3.2.
|
311
|
-
signing_key:
|
303
|
+
rubygems_version: 3.2.15
|
304
|
+
signing_key:
|
312
305
|
specification_version: 4
|
313
306
|
summary: ActiveRecord extension to access PostgreSQL advanced resources
|
314
307
|
test_files:
|
315
|
-
- spec/
|
308
|
+
- spec/en.yml
|
309
|
+
- spec/factories/authors.rb
|
310
|
+
- spec/factories/comments.rb
|
311
|
+
- spec/factories/item.rb
|
312
|
+
- spec/factories/posts.rb
|
313
|
+
- spec/factories/tags.rb
|
314
|
+
- spec/factories/texts.rb
|
315
|
+
- spec/factories/users.rb
|
316
|
+
- spec/factories/videos.rb
|
317
|
+
- spec/mocks/cache_query.rb
|
318
|
+
- spec/mocks/create_table.rb
|
316
319
|
- spec/models/activity.rb
|
320
|
+
- spec/models/activity_book.rb
|
321
|
+
- spec/models/activity_post/sample.rb
|
322
|
+
- spec/models/activity_post.rb
|
317
323
|
- spec/models/author.rb
|
318
324
|
- spec/models/author_journalist.rb
|
319
325
|
- spec/models/comment.rb
|
320
326
|
- spec/models/course.rb
|
321
|
-
- spec/models/post.rb
|
322
|
-
- spec/models/text.rb
|
323
|
-
- spec/models/user.rb
|
324
|
-
- spec/models/activity_book.rb
|
325
|
-
- spec/models/activity_post.rb
|
326
327
|
- spec/models/geometry.rb
|
327
328
|
- spec/models/guest_comment.rb
|
328
|
-
- spec/models/tag.rb
|
329
|
-
- spec/models/time_keeper.rb
|
330
|
-
- spec/models/video.rb
|
331
329
|
- spec/models/item.rb
|
330
|
+
- spec/models/post.rb
|
332
331
|
- spec/models/question.rb
|
333
332
|
- spec/models/question_select.rb
|
334
|
-
- spec/
|
335
|
-
- spec/
|
336
|
-
- spec/
|
337
|
-
- spec/
|
338
|
-
- spec/
|
339
|
-
- spec/
|
340
|
-
- spec/
|
341
|
-
- spec/
|
342
|
-
- spec/tests/geometric_builder_spec.rb
|
343
|
-
- spec/tests/enum_spec.rb
|
344
|
-
- spec/tests/range_spec.rb
|
345
|
-
- spec/tests/table_inheritance_spec.rb
|
346
|
-
- spec/tests/collector_spec.rb
|
347
|
-
- spec/tests/distinct_on_spec.rb
|
348
|
-
- spec/tests/interval_spec.rb
|
349
|
-
- spec/tests/lazy_spec.rb
|
350
|
-
- spec/tests/quoting_spec.rb
|
351
|
-
- spec/tests/relation_spec.rb
|
333
|
+
- spec/models/tag.rb
|
334
|
+
- spec/models/text.rb
|
335
|
+
- spec/models/time_keeper.rb
|
336
|
+
- spec/models/user.rb
|
337
|
+
- spec/models/video.rb
|
338
|
+
- spec/schema.rb
|
339
|
+
- spec/spec_helper.rb
|
340
|
+
- spec/tests/arel_spec.rb
|
352
341
|
- spec/tests/auxiliary_statement_spec.rb
|
353
342
|
- spec/tests/belongs_to_many_spec.rb
|
343
|
+
- spec/tests/collector_spec.rb
|
344
|
+
- spec/tests/distinct_on_spec.rb
|
354
345
|
- spec/tests/enum_set_spec.rb
|
346
|
+
- spec/tests/enum_spec.rb
|
347
|
+
- spec/tests/geometric_builder_spec.rb
|
355
348
|
- spec/tests/has_many_spec.rb
|
356
349
|
- spec/tests/insert_all_spec.rb
|
357
|
-
- spec/tests/
|
350
|
+
- spec/tests/interval_spec.rb
|
351
|
+
- spec/tests/lazy_spec.rb
|
358
352
|
- spec/tests/period_spec.rb
|
359
|
-
- spec/
|
360
|
-
- spec/
|
361
|
-
- spec/
|
362
|
-
- spec/spec_helper.rb
|
363
|
-
- spec/schema.rb
|
353
|
+
- spec/tests/quoting_spec.rb
|
354
|
+
- spec/tests/relation_spec.rb
|
355
|
+
- spec/tests/table_inheritance_spec.rb
|
data/lib/torque/range.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
module Torque
|
2
|
-
module Range
|
3
|
-
def intersection(other)
|
4
|
-
raise ArgumentError, 'value must be a Range' unless other.kind_of?(Range)
|
5
|
-
|
6
|
-
new_min = self.cover?(other.min) ? other.min : other.cover?(min) ? min : nil
|
7
|
-
new_max = self.cover?(other.max) ? other.max : other.cover?(max) ? max : nil
|
8
|
-
|
9
|
-
new_min && new_max ? new_min..new_max : nil
|
10
|
-
end
|
11
|
-
alias_method :&, :intersection
|
12
|
-
|
13
|
-
def union(other)
|
14
|
-
raise ArgumentError, 'value must be a Range' unless other.kind_of?(Range)
|
15
|
-
|
16
|
-
([min, other.min].min)..([max, other.max].max)
|
17
|
-
end
|
18
|
-
alias_method :|, :union
|
19
|
-
end
|
20
|
-
end
|
data/spec/tests/range_spec.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
RSpec.xdescribe 'Range' do
|
4
|
-
let(:sample) { (5..15) }
|
5
|
-
|
6
|
-
it 'has intersection' do
|
7
|
-
expect { sample.intersection(10) }.to raise_error(ArgumentError, /Range/)
|
8
|
-
|
9
|
-
result = sample & (10..15)
|
10
|
-
expect(result).to be_a(Range)
|
11
|
-
expect(result.min).to be_eql(10)
|
12
|
-
expect(result.max).to be_eql(15)
|
13
|
-
|
14
|
-
result = sample & (15..20)
|
15
|
-
expect(result).to be_a(Range)
|
16
|
-
expect(result.min).to be_eql(15)
|
17
|
-
expect(result.max).to be_eql(15)
|
18
|
-
|
19
|
-
result = sample & (0..10)
|
20
|
-
expect(result).to be_a(Range)
|
21
|
-
expect(result.min).to be_eql(5)
|
22
|
-
expect(result.max).to be_eql(10)
|
23
|
-
|
24
|
-
result = sample & (-10..0)
|
25
|
-
expect(result).to be_nil
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'has union' do
|
29
|
-
expect { sample.union(10) }.to raise_error(ArgumentError, /Range/)
|
30
|
-
|
31
|
-
result = sample | (0..10)
|
32
|
-
expect(result).to be_a(Range)
|
33
|
-
expect(result.min).to be_eql(0)
|
34
|
-
expect(result.max).to be_eql(15)
|
35
|
-
end
|
36
|
-
end
|