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:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 407e2b2f6781c2f4dbc7e34e576942f3833dbb98
         | 
| 4 | 
            +
              data.tar.gz: 189eb2e8ac24f2124288a15189fbab23d119bba5
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 024d036a68642775e0763f05962303e5f4b4ccb5b60942820daa9e46fb82f16eb6f7bcd0bfe61bdcb383ebcfac2e3d74805c2e75184fdc488e8a20cef8cadab1
         | 
| 7 | 
            +
              data.tar.gz: 5ce0de500d3c796b374716dcbe4a356930a3537490f6e6e26eecd59bce02bf0626abfc1e19c6b536736d06d689121881ed08cb47aa0a5e8eaf802f8d6ab18c26
         | 
    
        data/History.rdoc
    CHANGED
    
    
    
        data/lib/composite_primary_keys/connection_adapters/abstract/connection_specification_changes.rb
    CHANGED
    
    | @@ -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  | 
| 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( | 
| 48 | 
            +
                    connection_handler.retrieve_connection_pool(connection_specification_name)
         | 
| 48 49 | 
             
                  end
         | 
| 49 50 |  | 
| 50 51 | 
             
                  def retrieve_connection
         | 
| 51 | 
            -
                    connection_handler.retrieve_connection( | 
| 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?( | 
| 57 | 
            +
                    connection_handler.connected?(connection_specification_name)
         | 
| 57 58 | 
             
                  end
         | 
| 58 59 |  | 
| 59 | 
            -
                  def remove_connection( | 
| 60 | 
            -
                    connection_handler.remove_connection( | 
| 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  | 
| 11 | 
            -
                       | 
| 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)
         | 
    
        data/test/test_habtm.rb
    CHANGED
    
    | @@ -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 | 
| 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- | 
| 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 | 
| 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 | 
| 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:  | 
| 279 | 
            +
                  version: '0'
         | 
| 280 280 | 
             
            requirements: []
         | 
| 281 281 | 
             
            rubyforge_project: 
         | 
| 282 282 | 
             
            rubygems_version: 2.5.1
         |