chrono_model 0.10.0 → 0.10.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: 67617b7e3802061ce8bff217ddbed05e33dea83e
4
- data.tar.gz: 0e0172b002fe5f355461acb4c643ce8867394058
3
+ metadata.gz: 576c9df58b2b91c8521458a12eaa036d687287fb
4
+ data.tar.gz: 4529a430a634516a8c3c1007589c05ba346e0aa3
5
5
  SHA512:
6
- metadata.gz: f1b8ad21da3c8a9856c7865f1586a45760552c4d8b60e2999ff98ba5ea91d62f75ecf573ba0fdc3df5c7c048b7f9245b2a0427d2d2d5c1c005a12d84315a45c3
7
- data.tar.gz: 1b94a4c721bc99472464b6160fd99c3e4e7ca66fddb893bfc538d83863dbd1ecdd30624f49ce020643dddce44f6d79d7ecbe1d0d10f415f18eb91a47a1710721
6
+ metadata.gz: 369e1b1fc4874efb19b3b981a96727da8ea6c6cd34521ed746c2357481256c8344f64341b8e09fdebc97bac71dd235ad9fde66340e4c806b66e8aff4c0442f3f
7
+ data.tar.gz: 9788dea81eb29affaed8e83200b043bae597e14bbf0292fa908f3f5fc6d2d82da7fcad37d28ef2dda3fe46e53e6ab6443c95588b0f7a4b2d27b7ecc63d9c23e5
data/.travis.yml CHANGED
@@ -6,6 +6,7 @@ rvm:
6
6
  gemfile:
7
7
  - gemfiles/rails_4.2.gemfile
8
8
  - gemfiles/rails_5.0.gemfile
9
+ - gemfiles/rails_5.1.gemfile
9
10
 
10
11
  matrix:
11
12
  exclude:
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.1.0'
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
+
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "activerecord", "~> 5.1.0"
4
+
5
+ gemspec :path => "../"
@@ -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 PGconn.connect.
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
- PGconn.conndefaults_hash.keys + [:requiressl]
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 PGconn object,
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
 
@@ -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 == PGconn::PQTRANS_INERROR
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
@@ -1,3 +1,3 @@
1
1
  module ChronoModel
2
- VERSION = "0.10.0"
2
+ VERSION = "0.10.1"
3
3
  end
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', 'integer']) }
358
+ it { is_expected.to include(['id', pk_type]) }
359
359
  end
360
360
 
361
361
  with_temporal_table(&assert)
@@ -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
- delegate :columns, :table, :to => self
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.0
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-05 00:00:00.000000000 Z
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.1.0
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.1.0
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