envoy-activerecord_pg_stuff 0.0.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.travis.yml +4 -0
- data/Appraisals +7 -0
- data/activerecord_pg_stuff.gemspec +1 -0
- data/gemfiles/activerecord_5.1.gemfile +7 -0
- data/gemfiles/activerecord_5.2.gemfile +7 -0
- data/lib/activerecord_pg_stuff/relation/temporary_table.rb +9 -3
- data/lib/activerecord_pg_stuff/version.rb +1 -1
- data/spec/database.yml +4 -0
- data/spec/spec_helper.rb +1 -1
- metadata +22 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6d7105567a0beb30af6b4bdb2baf26b3accf1687
|
4
|
+
data.tar.gz: e2112afbae138ef38c09b9459a91651e8f8bdfb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d7ee38ead4183bad5c056b5c36df59641eb415638d0f3556dae1e2e17df6a4b0fb4c1e70a1acb269ec463c68431b198a7344e605ba3de9c86392ee2ee76212d
|
7
|
+
data.tar.gz: e2343f5e5abf0f326c3293406417c0ac137a6a2476813cb808fdb21b2092e0792d35e9e46dd32d5c58129f6e88c995a221e0461417d5c78fc687d89bb29a4034
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Appraisals
ADDED
@@ -27,14 +27,20 @@ module ActiveRecordPgStuff
|
|
27
27
|
def temporary_table
|
28
28
|
tname = "temporary_#{self.table.name}_#{self.object_id}"
|
29
29
|
self.klass.connection.with_temporary_table tname, self.to_sql do |name|
|
30
|
-
dec
|
31
|
-
|
30
|
+
dec = Decorator.new self.klass, name
|
31
|
+
if activerecord52?
|
32
|
+
rel = ActiveRecord::Relation.new dec
|
33
|
+
else
|
34
|
+
rel = ActiveRecord::Relation.new dec, dec.arel_table, dec.predicate_builder, {}
|
35
|
+
end
|
32
36
|
rel.readonly!
|
33
37
|
yield rel
|
34
38
|
end
|
35
39
|
end
|
36
40
|
|
41
|
+
def activerecord52?
|
42
|
+
ActiveRecord.gem_version >= Gem::Version.new("5.2.x")
|
43
|
+
end
|
37
44
|
end
|
38
|
-
|
39
45
|
end
|
40
46
|
end
|
data/spec/database.yml
ADDED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: envoy-activerecord_pg_stuff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Galinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: appraisal
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
description: " Adds support for working with temporary tables and pivot tables (PostgreSQL
|
84
98
|
only) "
|
85
99
|
email:
|
@@ -91,17 +105,21 @@ files:
|
|
91
105
|
- ".gitignore"
|
92
106
|
- ".rspec"
|
93
107
|
- ".travis.yml"
|
108
|
+
- Appraisals
|
94
109
|
- Gemfile
|
95
110
|
- LICENSE.txt
|
96
111
|
- README.md
|
97
112
|
- Rakefile
|
98
113
|
- activerecord_pg_stuff.gemspec
|
114
|
+
- gemfiles/activerecord_5.1.gemfile
|
115
|
+
- gemfiles/activerecord_5.2.gemfile
|
99
116
|
- lib/activerecord_pg_stuff.rb
|
100
117
|
- lib/activerecord_pg_stuff/connection/temporary_table.rb
|
101
118
|
- lib/activerecord_pg_stuff/relation/pivot.rb
|
102
119
|
- lib/activerecord_pg_stuff/relation/temporary_table.rb
|
103
120
|
- lib/activerecord_pg_stuff/version.rb
|
104
121
|
- lib/envoy/activerecord_pg_stuff.rb
|
122
|
+
- spec/database.yml
|
105
123
|
- spec/lib/connection_temporary_table_spec.rb
|
106
124
|
- spec/lib/relation_pivot_spec.rb
|
107
125
|
- spec/lib/relation_temporary_table_spec.rb
|
@@ -126,12 +144,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
144
|
version: '0'
|
127
145
|
requirements: []
|
128
146
|
rubyforge_project:
|
129
|
-
rubygems_version: 2.
|
147
|
+
rubygems_version: 2.5.2
|
130
148
|
signing_key:
|
131
149
|
specification_version: 4
|
132
150
|
summary: Adds support for working with temporary tables and pivot tables (PostgreSQL
|
133
151
|
only)
|
134
152
|
test_files:
|
153
|
+
- spec/database.yml
|
135
154
|
- spec/lib/connection_temporary_table_spec.rb
|
136
155
|
- spec/lib/relation_pivot_spec.rb
|
137
156
|
- spec/lib/relation_temporary_table_spec.rb
|