Module: DbCharmer::ActiveRecord::MasterSlaveRouting::ClassMethods

Defined in:
lib/db_charmer/rails2/active_record/master_slave_routing.rb,
lib/db_charmer/rails3/active_record/master_slave_routing.rb

Constant Summary collapse

SLAVE_METHODS =
[ :find_by_sql, :count_by_sql ]
MASTER_METHODS =

I don’t know any methods in AR::Base that change data directly w/o going to the relation object

[ ]

Instance Method Summary collapse

Instance Method Details

#find(*args, &block) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/db_charmer/rails2/active_record/master_slave_routing.rb', line 29

def find(*args, &block)
  options = args.last
  if options.is_a?(Hash) && options[:lock]
    on_master { super(*args, &block) }
  else
    super(*args, &block)
  end
end