activerecord_pg_stuff 0.2.0 → 0.2.1

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
2
  SHA1:
3
- metadata.gz: 0a74e9ffd6c02c6912d7ef455e31425fdfbe19b0
4
- data.tar.gz: dedb60e87ec990e25177ebb59df69ba36217f8d4
3
+ metadata.gz: 5f6ae0dfe81636024c26490c0a630b15ccb92589
4
+ data.tar.gz: 3e514094b47c7ccce963d437aea9f35ec0659a43
5
5
  SHA512:
6
- metadata.gz: bac00e46e4bbcfdd35a953b1d0e1c666cc2bb18a832efd7339702e68826a82cd0fca7aa7818633e5148a2631b98f01d1ff1f4bc44fe40d3cc543e05340f345ca
7
- data.tar.gz: 8c8f62c55499ce6ae9567e0311913444e6cb3c7a7929ff3dabdb64f7d0fd44604dbfe0776b1fe081d3a1552ed8789890bc91c649795ea989469f2b0f8b5f7426
6
+ metadata.gz: 5b4440d63ab554d2e4ce1062223a55c51a07c89fad7cffffbda274046fcd2e245810951527367e0df221e3d79dadf3f6a271d7c66687b502e3d0e59f441cb533
7
+ data.tar.gz: d0a8da2311f8e2e40825dfece91443197a72383137e691e5911ec59ecb87d73ba074f3038b8af885a991f0237be300ec0109ea4f040ca2ff933dcfec311785be
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.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -0,0 +1,4 @@
1
+ host: "localhost"
2
+ adapter: "postgresql"
3
+ encoding: utf-8
4
+ database: "test"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord_pg_stuff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
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,16 +105,20 @@ 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
121
+ - spec/database.yml
104
122
  - spec/lib/connection_temporary_table_spec.rb
105
123
  - spec/lib/relation_pivot_spec.rb
106
124
  - spec/lib/relation_temporary_table_spec.rb
@@ -125,12 +143,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
143
  version: '0'
126
144
  requirements: []
127
145
  rubyforge_project:
128
- rubygems_version: 2.4.5.1
146
+ rubygems_version: 2.4.5.3
129
147
  signing_key:
130
148
  specification_version: 4
131
149
  summary: Adds support for working with temporary tables and pivot tables (PostgreSQL
132
150
  only)
133
151
  test_files:
152
+ - spec/database.yml
134
153
  - spec/lib/connection_temporary_table_spec.rb
135
154
  - spec/lib/relation_pivot_spec.rb
136
155
  - spec/lib/relation_temporary_table_spec.rb