Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Fixed bug caused by 'postgres'.classify returning 'Postgre'
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
dkubb committed May 26, 2010
1 parent e26d404 commit e6fe66a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dm-rails/setup.rb
Expand Up @@ -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
Expand Down

1 comment on commit e6fe66a

@snusnu
Copy link
Member

@snusnu snusnu commented on e6fe66a May 26, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Holy crap, no idea why I used #classify in the first place

Please sign in to comment.