diff options
-rw-r--r-- | activesupport/lib/active_support/log_subscriber.rb | 5 | ||||
-rw-r--r-- | railties/test/generators/plugin_new_generator_test.rb | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/log_subscriber.rb b/activesupport/lib/active_support/log_subscriber.rb index 21a04a9152..c4b64bd1a6 100644 --- a/activesupport/lib/active_support/log_subscriber.rb +++ b/activesupport/lib/active_support/log_subscriber.rb @@ -53,10 +53,9 @@ module ActiveSupport class << self def logger - if defined?(Rails) && Rails.respond_to?(:logger) - @logger ||= Rails.logger + @logger ||= if defined?(Rails) && Rails.respond_to?(:logger) + Rails.logger end - @logger end attr_writer :logger diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb index 48425cbf81..ac71fb5884 100644 --- a/railties/test/generators/plugin_new_generator_test.rb +++ b/railties/test/generators/plugin_new_generator_test.rb @@ -124,7 +124,7 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase run_generator [destination_root, "--skip_active_record"] assert_no_file "test/dummy/config/database.yml" assert_file "test/test_helper.rb" do |contents| - assert_no_match /ActiveRecord/, contents + assert_no_match(/ActiveRecord/, contents) end end |