lib/octopus.rb in ar-octopus-0.9.0 vs lib/octopus.rb in ar-octopus-0.9.1

- old
+ new

@@ -100,14 +100,18 @@ def self.rails42? rails4? && ActiveRecord::VERSION::MINOR == 2 end - def self.rails5? - ActiveRecord::VERSION::MAJOR == 5 + def self.rails50? + ActiveRecord::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR == 0 end + def self.rails51? + ActiveRecord::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR == 1 + end + attr_writer :logger def self.logger if defined?(Rails.logger) @logger ||= Rails.logger @@ -150,15 +154,15 @@ yield end end def self.fully_replicated(&_block) - old_fully_replicated = Thread.current[Octopus::Proxy::FULLY_REPLICATED_KEY] - Thread.current[Octopus::Proxy::FULLY_REPLICATED_KEY] = true + old_fully_replicated = Thread.current[Octopus::ProxyConfig::FULLY_REPLICATED_KEY] + Thread.current[Octopus::ProxyConfig::FULLY_REPLICATED_KEY] = true yield ensure - Thread.current[Octopus::Proxy::FULLY_REPLICATED_KEY] = old_fully_replicated + Thread.current[Octopus::ProxyConfig::FULLY_REPLICATED_KEY] = old_fully_replicated end end require 'octopus/exception' @@ -168,19 +172,20 @@ require 'octopus/model' require 'octopus/migration' require 'octopus/association' require 'octopus/collection_association' -require 'octopus/has_and_belongs_to_many_association' unless Octopus.rails41? || Octopus.rails5? +require 'octopus/has_and_belongs_to_many_association' unless Octopus.rails41? || Octopus.rails50? || Octopus.rails51? require 'octopus/association_shard_tracking' require 'octopus/persistence' require 'octopus/log_subscriber' require 'octopus/abstract_adapter' require 'octopus/singular_association' require 'octopus/finder_methods' require 'octopus/railtie' if defined?(::Rails::Railtie) +require 'octopus/proxy_config' require 'octopus/proxy' require 'octopus/collection_proxy' require 'octopus/relation_proxy' require 'octopus/scope_proxy'