updated checks of environment with Rails.env by Rails.env methods

This commit is contained in:
Akshay
2014-08-18 12:12:48 +05:30
parent efb8dec951
commit b4e38e5646
8 changed files with 11 additions and 11 deletions

View File

@@ -42,7 +42,7 @@ module DiscourseHub
end
def self.hub_base_url
if Rails.env == 'production'
if Rails.env.production?
'http://api.discourse.org/api'
else
ENV['HUB_BASE_URL'] || 'http://local.hub:3000/api'

View File

@@ -58,7 +58,7 @@ module Import
rescue SystemExit
log "Restore process was cancelled!"
rollback
rescue Exception => ex
rescue => ex
log "EXCEPTION: " + ex.message
log ex.backtrace.join("\n")
rollback

View File

@@ -1,7 +1,7 @@
module Scheduler
module Deferrable
def initialize
@async = Rails.env != "test"
@async = !Rails.env.test?
@queue = Queue.new
@mutex = Mutex.new
@thread = nil