lib/octopus.rb in ar-octopus-0.7.0 vs lib/octopus.rb in ar-octopus-0.8.0

- old
+ new

@@ -16,11 +16,11 @@ def self.config @config ||= begin file_name = Octopus.directory() + "/config/shards.yml" - if File.exists?(file_name) + if File.exists?(file_name) || File.symlink?(file_name) config ||= HashWithIndifferentAccess.new(YAML.load(ERB.new(File.read(file_name)).result))[Octopus.env()] else config ||= HashWithIndifferentAccess.new end @@ -62,16 +62,16 @@ def self.environments @environments ||= config['environments'] || ['production'] end - def self.rails31? - ActiveRecord::VERSION::MAJOR == 3 && ActiveRecord::VERSION::MINOR == 1 + def self.rails3? + ActiveRecord::VERSION::MAJOR <= 3 end - def self.rails32? - ActiveRecord::VERSION::MAJOR == 3 && ActiveRecord::VERSION::MINOR == 2 + def self.rails4? + ActiveRecord::VERSION::MAJOR >= 4 end def self.rails? defined?(Rails) end @@ -105,11 +105,8 @@ if defined?(::Rails) require "octopus/railtie" end -if Octopus.rails32? - require "octopus/rails3.2/persistence" -end require "octopus/proxy" require "octopus/scope_proxy"