lib/octopus.rb in ar-octopus-0.0.25 vs lib/octopus.rb in ar-octopus-0.0.26

- old
+ new

@@ -45,10 +45,15 @@ end def self.rails? defined?(Rails) end + + def self.using(shard, &block) + ActiveRecord::Base.hijack_initializer() + ActiveRecord::Base.connection.run_queries_on_shard(shard, &block) + end end require "octopus/model" require "octopus/migration" @@ -64,7 +69,6 @@ require "octopus/rails2/persistence" end require "octopus/proxy" require "octopus/scope_proxy" -require "octopus/controller"