Skip to content

Commit

Permalink
Only log if theres a logger
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9051 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Mar 17, 2008
1 parent fbf41c7 commit 75d98db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion activerecord/lib/active_record/fixtures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,9 @@ def try_to_load_dependency(file_name)

# Let's warn in case this is a subdependency, otherwise
# subdependency error messages are totally cryptic
ActiveRecord::Base.logger.warn("Unable to load #{file_name}, underlying cause #{e.message} \n\n #{e.backtrace.join("\n")}")
if ActiveRecord::Base.logger
ActiveRecord::Base.logger.warn("Unable to load #{file_name}, underlying cause #{e.message} \n\n #{e.backtrace.join("\n")}")
end
end

def require_fixture_classes(table_names = nil)
Expand Down

0 comments on commit 75d98db

Please sign in to comment.