composite_primary_keys 9.0.0.beta1 → 9.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e62c2248e714242837c9bd00862bd0411c02f00
4
- data.tar.gz: 587c5f4beabb743d14fd3d7febb134d2fdfa3ab5
3
+ metadata.gz: 407e2b2f6781c2f4dbc7e34e576942f3833dbb98
4
+ data.tar.gz: 189eb2e8ac24f2124288a15189fbab23d119bba5
5
5
  SHA512:
6
- metadata.gz: 82894133f71054b13e6fa8293e968fff35732cddd7b7856749d9b67b40a81798130f66974acb6561e137899feb591119cab35657b4b98eaf892a12a938dd5ccf
7
- data.tar.gz: d5605252ae0c73bef65b92993562032808e86d6ba192eda0e8c5f12681d9465679ab947b2a76b8a93e8423ef1ae673ce0611f66275d16611e7af9ceb4c8de03e
6
+ metadata.gz: 024d036a68642775e0763f05962303e5f4b4ccb5b60942820daa9e46fb82f16eb6f7bcd0bfe61bdcb383ebcfac2e3d74805c2e75184fdc488e8a20cef8cadab1
7
+ data.tar.gz: 5ce0de500d3c796b374716dcbe4a356930a3537490f6e6e26eecd59bce02bf0626abfc1e19c6b536736d06d689121881ed08cb47aa0a5e8eaf802f8d6ab18c26
@@ -1,5 +1,8 @@
1
- == 9.0.0.beta1 (2015-08-04)
2
- * Rails 5 support (Sammy Larbi)
1
+ == 9.0.0 (2016-07-06)
2
+ * Support connection_specification_name in rails5.0.0.rc1 (pocari)
3
+
4
+ == 9.0.0.beta1 (2016-04-16)
5
+ * Rails 5 beta support (Sammy Larbi)
3
6
 
4
7
  == 8.1.3 (2016-04-16)
5
8
 
@@ -12,7 +12,8 @@ module ActiveRecord
12
12
  def self.establish_connection(spec = nil)
13
13
  spec ||= ActiveRecord::ConnectionHandling::DEFAULT_ENV.call.to_sym
14
14
  resolver = ConnectionAdapters::ConnectionSpecification::Resolver.new configurations
15
- spec = resolver.spec(spec)
15
+ spec = resolver.spec(spec, self == Base ? "primary" : name)
16
+ self.connection_specification_name = spec.name
16
17
 
17
18
  # CPK
18
19
  load_cpk_adapter(spec.config[:adapter])
@@ -22,7 +23,7 @@ module ActiveRecord
22
23
  end
23
24
 
24
25
  remove_connection
25
- connection_handler.establish_connection self, spec
26
+ connection_handler.establish_connection spec
26
27
  end
27
28
 
28
29
  class << self
@@ -44,20 +45,20 @@ module ActiveRecord
44
45
  end
45
46
 
46
47
  def connection_pool
47
- connection_handler.retrieve_connection_pool(self)
48
+ connection_handler.retrieve_connection_pool(connection_specification_name)
48
49
  end
49
50
 
50
51
  def retrieve_connection
51
- connection_handler.retrieve_connection(self)
52
+ connection_handler.retrieve_connection(connection_specification_name)
52
53
  end
53
54
 
54
55
  # Returns true if Active Record is connected.
55
56
  def connected?
56
- connection_handler.connected?(self)
57
+ connection_handler.connected?(connection_specification_name)
57
58
  end
58
59
 
59
- def remove_connection(klass = self)
60
- connection_handler.remove_connection(klass)
60
+ def remove_connection(id = connection_specification_name)
61
+ connection_handler.remove_connection(id)
61
62
  end
62
63
 
63
64
  def clear_active_connections!
@@ -1,14 +1,14 @@
1
1
  module CompositePrimaryKeys
2
2
  module ActiveRecord
3
3
  module Batches
4
- def in_batches(of: 1000, start: nil, finish: nil, load: false)
4
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil)
5
5
  relation = self
6
6
  unless block_given?
7
7
  return BatchEnumerator.new(of: of, start: start, finish: finish, relation: self)
8
8
  end
9
9
 
10
- if logger && (arel.orders.present? || arel.taken.present?)
11
- logger.warn("Scoped order and limit are ignored, it's forced to be batch order and batch size")
10
+ if arel.orders.present? || arel.taken.present?
11
+ act_on_order_or_limit_ignored(error_on_ignore)
12
12
  end
13
13
 
14
14
  relation = relation.reorder(batch_order).limit(of)
@@ -3,6 +3,6 @@ module CompositePrimaryKeys
3
3
  MAJOR = 9
4
4
  MINOR = 0
5
5
  TINY = 0
6
- STRING = [MAJOR, MINOR, TINY, 'beta1'].join('.')
6
+ STRING = [MAJOR, MINOR, TINY].join('.')
7
7
  end
8
8
  end
@@ -1,7 +1,7 @@
1
1
  require File.expand_path('../abstract_unit', __FILE__)
2
2
 
3
3
  class TestHabtm < ActiveSupport::TestCase
4
- fixtures :suburbs, :restaurants, :restaurants_suburbs, :products
4
+ fixtures :suburbs, :restaurants, :restaurants_suburbs, :products, :groups, :employees
5
5
 
6
6
  def test_no_cpk
7
7
  # This test makes sure we don't break anything in standard rails by using CPK
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: composite_primary_keys
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.0.beta1
4
+ version: 9.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charlie Savage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-16 00:00:00.000000000 Z
11
+ date: 2016-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0.beta3
19
+ version: 5.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.0.beta3
26
+ version: 5.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sqlite3
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -274,9 +274,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
274
274
  version: 2.2.2
275
275
  required_rubygems_version: !ruby/object:Gem::Requirement
276
276
  requirements:
277
- - - ">"
277
+ - - ">="
278
278
  - !ruby/object:Gem::Version
279
- version: 1.3.1
279
+ version: '0'
280
280
  requirements: []
281
281
  rubyforge_project:
282
282
  rubygems_version: 2.5.1