fresh_connection 2.3.1 → 2.3.2
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: 0d6bb81775c1ffa074f52f58fad152f9d02d8498
         | 
| 4 | 
            +
              data.tar.gz: 622671bc7d23b5a88f92eb8f4430b5b15014d917
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 6a7de0aff8b2b35291005f1236bf5e6d87e4285a5d54b6619eebebf2a1edc5a83f750abfcc2795ee070edc7c97d4aec2796d5e5f3622d7293bdfab58ab829cdb
         | 
| 7 | 
            +
              data.tar.gz: 3799709992b9fbd0cb4c8cac11db8db34601fec8333dbe41bd25c51eeddadec36f5153a9fc39aa5548e373e8175e938760e471d11bae77edb04aecb63d63891b
         | 
| @@ -3,12 +3,62 @@ module FreshConnection | |
| 3 3 | 
             
                module ArAbstractAdapter
         | 
| 4 4 | 
             
                  def self.prepended(base)
         | 
| 5 5 | 
             
                    base.send :attr_writer, :replica_group
         | 
| 6 | 
            +
                    base.send :attr_accessor, :master_connection
         | 
| 6 7 | 
             
                  end
         | 
| 7 8 |  | 
| 8 9 | 
             
                  def log(*args)
         | 
| 9 10 | 
             
                    args[1] = "[#{@replica_group}] #{args[1]}" if defined?(@replica_group)
         | 
| 10 11 | 
             
                    super
         | 
| 11 12 | 
             
                  end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                  def query_cache
         | 
| 15 | 
            +
                    return @query_cache unless master_connection
         | 
| 16 | 
            +
                    master_connection.query_cache
         | 
| 17 | 
            +
                  end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                  def query_cache_enabled
         | 
| 20 | 
            +
                    return @query_cache_enabled unless master_connection
         | 
| 21 | 
            +
                    master_connection.query_cache_enabled
         | 
| 22 | 
            +
                  end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                  def cache(&block)
         | 
| 25 | 
            +
                    return super unless master_connection
         | 
| 26 | 
            +
                    master_connection.cache(&block)
         | 
| 27 | 
            +
                  end
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                  def enable_query_cache!
         | 
| 30 | 
            +
                    return super unless master_connection
         | 
| 31 | 
            +
                    master_connection.enable_query_cache!
         | 
| 32 | 
            +
                  end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                  def disable_query_cache!
         | 
| 35 | 
            +
                    return super unless master_connection
         | 
| 36 | 
            +
                    master_connection.disable_query_cache!
         | 
| 37 | 
            +
                  end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                  def uncached(&block)
         | 
| 40 | 
            +
                    return super unless master_connection
         | 
| 41 | 
            +
                    master_connection.uncached(&block)
         | 
| 42 | 
            +
                  end
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                  def clear_query_cache
         | 
| 45 | 
            +
                    return super unless master_connection
         | 
| 46 | 
            +
                    master_conection.clear_query_cache
         | 
| 47 | 
            +
                  end
         | 
| 48 | 
            +
             | 
| 49 | 
            +
                  def select_all(*args)
         | 
| 50 | 
            +
                    return super unless master_connection
         | 
| 51 | 
            +
                    @query_cache_enabled = master_connection.query_cache_enabled
         | 
| 52 | 
            +
                    super
         | 
| 53 | 
            +
                  end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
                  private
         | 
| 56 | 
            +
             | 
| 57 | 
            +
                  def cache_sql(*args)
         | 
| 58 | 
            +
                    return super unless master_connection
         | 
| 59 | 
            +
                    @query_cache = master_connection.query_cache
         | 
| 60 | 
            +
                    super
         | 
| 61 | 
            +
                  end
         | 
| 12 62 | 
             
                end
         | 
| 13 63 | 
             
              end
         | 
| 14 64 | 
             
            end
         | 
| @@ -6,15 +6,13 @@ module FreshConnection | |
| 6 6 | 
             
              module Extend
         | 
| 7 7 | 
             
                module ArBase
         | 
| 8 8 | 
             
                  def connection
         | 
| 9 | 
            -
                     | 
| 10 | 
            -
             | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
             | 
| 15 | 
            -
                     | 
| 16 | 
            -
                      super
         | 
| 17 | 
            -
                    end
         | 
| 9 | 
            +
                    master_c = super
         | 
| 10 | 
            +
                    return master_c unless FreshConnection::AccessControl.replica_access?
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                    replica_c = replica_connection
         | 
| 13 | 
            +
                    replica_c.master_connection = master_c
         | 
| 14 | 
            +
                    replica_c.replica_group = replica_group if logger && logger.debug?
         | 
| 15 | 
            +
                    replica_c
         | 
| 18 16 | 
             
                  end
         | 
| 19 17 |  | 
| 20 18 | 
             
                  def read_master
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: fresh_connection
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 2.3. | 
| 4 | 
            +
              version: 2.3.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Tsukasa OISHI
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2017- | 
| 11 | 
            +
            date: 2017-06-27 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activerecord
         | 
| @@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 246 246 | 
             
                  version: '0'
         | 
| 247 247 | 
             
            requirements: []
         | 
| 248 248 | 
             
            rubyforge_project: 
         | 
| 249 | 
            -
            rubygems_version: 2.5. | 
| 249 | 
            +
            rubygems_version: 2.4.5.1
         | 
| 250 250 | 
             
            signing_key: 
         | 
| 251 251 | 
             
            specification_version: 4
         | 
| 252 252 | 
             
            summary: FreshConnection supports connections with configured replica servers.
         |