Visitar URL original
Ignore un-existence of database.yml by maxmeyer · Pull Request #460 · stringer-rss/stringer · GitHub
Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix issue raised by rubocop
  • Loading branch information
maxmeyer committed Sep 27, 2017
commit 61d45aea85311a1b92535daab12776fe19ad3c2a
14 changes: 7 additions & 7 deletions config/unicorn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
else
YAML.load(ERB.new(File.read("config/database.yml")).result)[env]
end
ActiveRecord::Base.establish_connection(config)
level = if ENV["LOG_LEVEL"] == "info"
Logger::INFO
else
Logger::DEBUG
end

case ENV["LOG_LEVEL"]
when "info"
ActiveRecord::Base.logger.level = Logger::INFO
else
ActiveRecord::Base.logger.level = Logger::DEBUG
end
ActiveRecord::Base.establish_connection(config)
ActiveRecord::Base.logger.level = level
end
end