Last active
September 21, 2015 09:00
-
-
Save tomykaira/2444b64c0377ee94a151 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if Rails.env.development? | |
class DisableAssetsLogger | |
def initialize(app) | |
@app = app | |
Rails.application.assets.logger = Logger.new('/dev/null') | |
end | |
def call(env) | |
previous_level = Rails.logger.level | |
Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0 | |
@app.call(env) | |
ensure | |
Rails.logger.level = previous_level | |
end | |
end | |
Rails.application.config.middleware.insert_before Rails::Rack::Logger, DisableAssetsLogger | |
Thread.new do | |
sleep 1 | |
Rails.application.config.action_mailer.default_url_options.merge!({ protocol: 'https', host: 'lvh.me', port: '8443' }) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment