aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-08-20 11:06:09 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-08-20 11:06:09 -0300
commit3a1edcff09fb7ff9c7246d71525f4c23c61e113d (patch)
treea2fbdb24390c4b044c8dbf1a0663225718d1b12b /activerecord/lib
parentb6f5b48b4063eaaea0a823ca08c8fd270128ab42 (diff)
parent2e6b798c101cb130b34dab326be939be1b8815f1 (diff)
downloadrails-3a1edcff09fb7ff9c7246d71525f4c23c61e113d.tar.gz
rails-3a1edcff09fb7ff9c7246d71525f4c23c61e113d.tar.bz2
rails-3a1edcff09fb7ff9c7246d71525f4c23c61e113d.zip
Merge pull request #16145 from phoet/patch-2
don't log errors when all is fine
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/fixtures.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index 4306b36ae1..727f12103a 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -870,11 +870,11 @@ module ActiveRecord
def try_to_load_dependency(file_name)
require_dependency file_name
rescue LoadError => e
- # Let's hope the developer has included it
- # Let's warn in case this is a subdependency, otherwise
- # subdependency error messages are totally cryptic
- if ActiveRecord::Base.logger
- ActiveRecord::Base.logger.warn("Unable to load #{file_name}, underlying cause #{e.message} \n\n #{e.backtrace.join("\n")}")
+ unless fixture_class_names.key?(file_name.pluralize)
+ if ActiveRecord::Base.logger
+ ActiveRecord::Base.logger.warn("Unable to load #{file_name}, make sure you added it to ActiveSupport::TestCase.set_fixture_class")
+ ActiveRecord::Base.logger.warn("underlying cause #{e.message} \n\n #{e.backtrace.join("\n")}")
+ end
end
end