rom-rb / rom-rails

Rails integration for Ruby Object Mapper
http://rom-rb.org
MIT License
159 stars 51 forks source link

Do not output log messages twice when ActiveRecord present #98

Closed Cervajz closed 5 years ago

Cervajz commented 6 years ago

ActiveRecord creates its own console output to STDERR and STDOUT and it looks like the #logger_outputs_to? does not catch that. The result is is having the log messages twice in rails console.

More info: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/railtie.rb#L58

Cervajz commented 6 years ago

@radar It's strange that ActiveSupport::Logger.logger_outputs_to?(::Rails.logger, STDERR, STDOUT) does not work.

Or at least not in my case - I use RoR 5.2.1 and ROM together with AR as I am in the middle of migration.