master_slave_adapter_soundcloud 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/master_slave_adapter.rb +21 -4
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -252,10 +252,23 @@ module ActiveRecord
252
252
  :to => :master_connection
253
253
  delegate *ActiveRecord::ConnectionAdapters::SchemaStatements.instance_methods,
254
254
  :to => :master_connection
255
- # silly: :tables is commented in SchemaStatements.
256
- delegate :tables, :to => :master_connection
257
- # monkey patch from databasecleaner gem
258
- delegate :truncate_table, :to => :master_connection
255
+ # no clear interface contract:
256
+ delegate :tables, # commented in SchemaStatements
257
+ :truncate_table, # monkeypatching database_cleaner gem
258
+ :primary_key, # is Base#primary_key meant to be the contract?
259
+ :to => :master_connection
260
+ # ok, we might have missed more
261
+ def method_missing(name, *args, &blk)
262
+ master_connection.send(name.to_sym, *args, &blk).tap do
263
+ warn %Q{
264
+ You called the unsupported method '#{name}' on #{self.class.name}.
265
+ In order to help us improve master_slave_adapter, please report this
266
+ to: https://github.com/soundcloud/master_slave_adapter/issues
267
+
268
+ Thank you.
269
+ }
270
+ end
271
+ end
259
272
 
260
273
  # === determine read connection
261
274
  delegate :select_all,
@@ -351,6 +364,10 @@ module ActiveRecord
351
364
  logger.try(:info, msg)
352
365
  end
353
366
 
367
+ def warn(msg)
368
+ logger.try(:warn, msg)
369
+ end
370
+
354
371
  def debug(msg)
355
372
  logger.debug(msg) if logger && logger.debug?
356
373
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mauricio Linhares