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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: c18cbc0760d633bf2b08c75c2e5214850e96e3cbd1ab2ed51780d1c74bd4d1ca
4
- data.tar.gz: d0b95e484e4cacef2320858897b3fc3e7c952a143a2cca1e3c64da2a8fd21b9b
2
+ SHA1:
3
+ metadata.gz: 6d7105567a0beb30af6b4bdb2baf26b3accf1687
4
+ data.tar.gz: e2112afbae138ef38c09b9459a91651e8f8bdfb6
5
5
  SHA512:
6
- metadata.gz: d41c171a9c30cec7242e7802b8deca95fbf09f2940294bf515e28cd9e658cabd4bb871a99a208fdc265904989e9d2d4d1d50e61c36e4d17c3780ef0c99a27d28
7
- data.tar.gz: c6dcfea289587a81b84a4f44eaa900945ddde5d0dd4c5cac6b7d729dfe8585a16c6a7d5d7f8c6275c82fb6ec5a72aa1fc36ad4c79012f15bb0ee128565adb057
6
+ metadata.gz: 6d7ee38ead4183bad5c056b5c36df59641eb415638d0f3556dae1e2e17df6a4b0fb4c1e70a1acb269ec463c68431b198a7344e605ba3de9c86392ee2ee76212d
7
+ data.tar.gz: e2343f5e5abf0f326c3293406417c0ac137a6a2476813cb808fdb21b2092e0792d35e9e46dd32d5c58129f6e88c995a221e0461417d5c78fc687d89bb29a4034
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ gemfiles/*.gemfile.lock
@@ -1,6 +1,10 @@
1
1
  rvm:
2
2
  - 2.2.2
3
3
 
4
+ gemfile:
5
+ - gemfiles/activerecord_5.1.gemfile
6
+ - gemfiles/activerecord_5.2.gemfile
7
+
4
8
  env:
5
9
  global:
6
10
  - DATABASE_URL=postgresql://postgres@localhost
@@ -0,0 +1,7 @@
1
+ appraise "activerecord-5.1" do
2
+ gem "activerecord", "~> 5.1.6"
3
+ end
4
+
5
+ appraise "activerecord-5.2" do
6
+ gem "activerecord", "~> 5.2.1"
7
+ end
@@ -24,4 +24,5 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "rake"
25
25
  spec.add_development_dependency "rspec"
26
26
  spec.add_development_dependency "pg"
27
+ spec.add_development_dependency "appraisal"
27
28
  end
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 5.1.6"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 5.2.1"
6
+
7
+ gemspec path: "../"
@@ -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 = Decorator.new self.klass, name
31
- rel = ActiveRecord::Relation.new dec, table: dec.arel_table
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
@@ -1,3 +1,3 @@
1
1
  module ActiveRecordPgStuff
2
- VERSION = "0.0.3"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -0,0 +1,4 @@
1
+ host: "localhost"
2
+ adapter: "postgresql"
3
+ encoding: utf-8
4
+ database: "test"
@@ -1,5 +1,5 @@
1
1
  Bundler.require(:test)
2
- require 'rspec'
2
+ require 'rspec/autorun'
3
3
  require 'logger'
4
4
  require File.expand_path("../../lib/activerecord_pg_stuff", __FILE__)
5
5
 
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.3
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-05 00:00:00.000000000 Z
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.7.7
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