chrono_model 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/chrono_model.gemspec +3 -2
- data/gemfiles/rails_5.1.gemfile +5 -0
- data/lib/active_record/connection_adapters/chronomodel_adapter.rb +3 -3
- data/lib/chrono_model/adapter.rb +1 -1
- data/lib/chrono_model/version.rb +1 -1
- data/spec/adapter_spec.rb +1 -1
- data/spec/support/helpers.rb +10 -2
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 576c9df58b2b91c8521458a12eaa036d687287fb
|
4
|
+
data.tar.gz: 4529a430a634516a8c3c1007589c05ba346e0aa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 369e1b1fc4874efb19b3b981a96727da8ea6c6cd34521ed746c2357481256c8344f64341b8e09fdebc97bac71dd235ad9fde66340e4c806b66e8aff4c0442f3f
|
7
|
+
data.tar.gz: 9788dea81eb29affaed8e83200b043bae597e14bbf0292fa908f3f5fc6d2d82da7fcad37d28ef2dda3fe46e53e6ab6443c95588b0f7a4b2d27b7ecc63d9c23e5
|
data/.travis.yml
CHANGED
data/chrono_model.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = ChronoModel::VERSION
|
17
17
|
|
18
|
-
gem.add_dependency 'activerecord', '>= 4.2.0', '< 5.
|
18
|
+
gem.add_dependency 'activerecord', '>= 4.2.0', '< 5.2.0'
|
19
19
|
gem.add_dependency "pg"
|
20
20
|
gem.add_dependency "multi_json"
|
21
21
|
|
@@ -27,4 +27,5 @@ Gem::Specification.new do |gem|
|
|
27
27
|
gem.add_development_dependency 'fuubar'
|
28
28
|
gem.add_development_dependency 'simplecov'
|
29
29
|
gem.add_development_dependency 'codeclimate-test-reporter'
|
30
|
-
end
|
30
|
+
end
|
31
|
+
|
@@ -16,15 +16,15 @@ module ActiveRecord
|
|
16
16
|
conn_params[:user] = conn_params.delete(:username) if conn_params[:username]
|
17
17
|
conn_params[:dbname] = conn_params.delete(:database) if conn_params[:database]
|
18
18
|
|
19
|
-
# Forward only valid config params to
|
19
|
+
# Forward only valid config params to PG::Connection.connect.
|
20
20
|
valid_conn_param_keys = if ActiveRecord::VERSION::MAJOR == 4
|
21
21
|
VALID_CONN_PARAMS
|
22
22
|
else
|
23
|
-
|
23
|
+
PG::Connection.conndefaults_hash.keys + [:requiressl]
|
24
24
|
end
|
25
25
|
conn_params.slice!(*valid_conn_param_keys)
|
26
26
|
|
27
|
-
# The postgres drivers don't allow the creation of an unconnected
|
27
|
+
# The postgres drivers don't allow the creation of an unconnected PG::Connection object,
|
28
28
|
# so just pass a nil connection object for the time being.
|
29
29
|
adapter = ChronoModel::Adapter.new(nil, logger, conn_params, config)
|
30
30
|
|
data/lib/chrono_model/adapter.rb
CHANGED
@@ -443,7 +443,7 @@ module ChronoModel
|
|
443
443
|
# there is no way to know which path will be restored when the
|
444
444
|
# transaction ends.
|
445
445
|
#
|
446
|
-
if @connection.transaction_status ==
|
446
|
+
if @connection.transaction_status == PG::Connection::PQTRANS_INERROR
|
447
447
|
@schema_search_path = nil
|
448
448
|
else
|
449
449
|
self.schema_search_path = old_path
|
data/lib/chrono_model/version.rb
CHANGED
data/spec/adapter_spec.rb
CHANGED
@@ -355,7 +355,7 @@ describe ChronoModel::Adapter do
|
|
355
355
|
|
356
356
|
assert = proc do
|
357
357
|
it { expect(subject & columns).to eq columns }
|
358
|
-
it { is_expected.to include(['id',
|
358
|
+
it { is_expected.to include(['id', pk_type]) }
|
359
359
|
end
|
360
360
|
|
361
361
|
with_temporal_table(&assert)
|
data/spec/support/helpers.rb
CHANGED
@@ -5,7 +5,7 @@ module ChronoTest::Helpers
|
|
5
5
|
base.extend DSL
|
6
6
|
base.instance_eval do
|
7
7
|
delegate :adapter, :to => ChronoTest
|
8
|
-
delegate :columns, :table, :to => DSL
|
8
|
+
delegate :columns, :table, :pk_type, :to => DSL
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -37,7 +37,15 @@ module ChronoTest::Helpers
|
|
37
37
|
@columns = block.call if block
|
38
38
|
@columns
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
|
+
def self.pk_type
|
42
|
+
@pk_type ||= if ActiveRecord::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR >= 1
|
43
|
+
'bigint'
|
44
|
+
else
|
45
|
+
'integer'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
delegate :columns, :table, :pk_type, :to => self
|
41
49
|
end
|
42
50
|
end
|
43
51
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chrono_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcello Barnaba
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-07-
|
12
|
+
date: 2017-07-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
version: 4.2.0
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 5.
|
23
|
+
version: 5.2.0
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
version: 4.2.0
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 5.
|
33
|
+
version: 5.2.0
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: pg
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -191,6 +191,7 @@ files:
|
|
191
191
|
- chrono_model.gemspec
|
192
192
|
- gemfiles/rails_4.2.gemfile
|
193
193
|
- gemfiles/rails_5.0.gemfile
|
194
|
+
- gemfiles/rails_5.1.gemfile
|
194
195
|
- lib/active_record/connection_adapters/chronomodel_adapter.rb
|
195
196
|
- lib/chrono_model.rb
|
196
197
|
- lib/chrono_model/adapter.rb
|
@@ -238,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
239
|
version: '0'
|
239
240
|
requirements: []
|
240
241
|
rubyforge_project:
|
241
|
-
rubygems_version: 2.5.1
|
242
|
+
rubygems_version: 2.4.5.1
|
242
243
|
signing_key:
|
243
244
|
specification_version: 4
|
244
245
|
summary: Temporal extensions (SCD Type II) for Active Record
|