diff --git a/lib/master_slave_adapter.rb b/lib/master_slave_adapter.rb index 7793b6e..11ceabb 100644 --- a/lib/master_slave_adapter.rb +++ b/lib/master_slave_adapter.rb @@ -257,6 +257,18 @@ def execute(*args) :truncate_table, # monkeypatching database_cleaner gem :primary_key, # is Base#primary_key meant to be the contract? :to => :master_connection + # ok, we might have missed more + def method_missing(name, *args, &blk) + master_connection.send(name.to_sym, *args, &blk).tap do + warn %Q{ + You called the unsupported method '#{name}' on #{self.class.name}. + In order to help us improve master_slave_adapter, please report this + to: https://github.com/soundcloud/master_slave_adapter/issues + + Thank you. + } + end + end # === determine read connection delegate :select_all, @@ -352,6 +364,10 @@ def info(msg) logger.try(:info, msg) end + def warn(msg) + logger.try(:warn, msg) + end + def debug(msg) logger.debug(msg) if logger && logger.debug? end