module Replidog::Model::ClassMethodsWithReplidogSupport

Public Instance Methods

clear_active_connections!() click to toggle source
Calls superclass method
# File lib/replidog/model.rb, line 40
def clear_active_connections!
  super
  proxy_handler.clear_active_slave_connections! if replicated?
end
clear_all_connections!() click to toggle source
Calls superclass method
# File lib/replidog/model.rb, line 50
def clear_all_connections!
  super
  proxy_handler.clear_all_slave_connections! if replicated?
end
clear_reloadable_connections!() click to toggle source
Calls superclass method
# File lib/replidog/model.rb, line 45
def clear_reloadable_connections!
  super
  proxy_handler.clear_reloadable_slave_connections! if replicated?
end
connected?() click to toggle source
Calls superclass method
# File lib/replidog/model.rb, line 32
def connected?
  if replicated?
    connection.connected?
  else
    super
  end
end
connection() click to toggle source
Calls superclass method
# File lib/replidog/model.rb, line 22
def connection
  if replicated?
    proxy_handler.retrieve_proxy(self).tap do |proxy|
      proxy.current_model = self
    end
  else
    super
  end
end
establish_connection(spec = ENV["DATABASE_URL"]) click to toggle source
Calls superclass method
# File lib/replidog/model.rb, line 16
def establish_connection(spec = ENV["DATABASE_URL"])
  super
  proxy_handler.remove_connection(self)
  proxy_handler.establish_connection(connection_pool.spec, self)
end