mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Check for Rails.env instead of Rails
`Rails` constant is added by rails-html-sanitizer leading to bugs in non-Rails apps using ActiveRecord and ActionMailer
This commit is contained in:
parent
a2059068c0
commit
290e8e117f
1 changed files with 1 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
module ActiveRecord
|
||||
module ConnectionHandling
|
||||
RAILS_ENV = -> { (Rails.env if defined?(Rails)) || ENV["RAILS_ENV"] || ENV["RACK_ENV"] }
|
||||
RAILS_ENV = -> { (Rails.env if defined?(Rails.env)) || ENV["RAILS_ENV"] || ENV["RACK_ENV"] }
|
||||
DEFAULT_ENV = -> { RAILS_ENV.call || "default_env" }
|
||||
|
||||
# Establishes the connection to the database. Accepts a hash as input where
|
||||
|
|
Loading…
Reference in a new issue