From e6fe66af0b3f3439c79c918b3d6925b1d97e64bf Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Wed, 26 May 2010 00:48:53 -0700 Subject: [PATCH] Fixed bug caused by 'postgres'.classify returning 'Postgre' * String#classify should not be used anyway. DM gems are trying to stay away from using any monkey patched methods when at all possible. This allows us to cherry pick in the minimal number of methods from AS, polluting the least amount of ruby core/stdlib gems. I realize this is somewhat futile with dm-rails, given that it will run inside Rails and have the full AS gem required. If any of this code is extracted into a dm-config base gem, then this approach *will* make things easier working with other frameworks. --- lib/dm-rails/setup.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dm-rails/setup.rb b/lib/dm-rails/setup.rb index eb48e2b..9582fdd 100644 --- a/lib/dm-rails/setup.rb +++ b/lib/dm-rails/setup.rb @@ -32,7 +32,7 @@ def self.setup_log_listener(adapter_name) # FIXME Setting DataMapper::Logger.new($stdout, :off) alone won't work because the #log # method is currently only available in DO and needs an explicit DO Logger instantiated. # We turn the logger :off because ActiveSupport::Notifications handles displaying log messages - do_adapter = DataObjects.const_get(adapter_name.classify) + do_adapter = DataObjects.const_get(ActiveSupport::Inflector.camelize(adapter_name)) do_adapter.logger = DataObjects::Logger.new($stdout, :off) end end