mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Shrink a couple of deprecation warnings to one-liners
The previous spelling seemed a bit too generous with the whitespace, and looked out of place when amongst others.
This commit is contained in:
parent
c5e5b94c8a
commit
0d8b3c2e7f
1 changed files with 8 additions and 18 deletions
|
@ -47,15 +47,10 @@ module Mime
|
|||
def const_missing(sym)
|
||||
ext = sym.downcase
|
||||
if Mime[ext]
|
||||
ActiveSupport::Deprecation.warn <<-eow
|
||||
Accessing mime types via constants is deprecated. Please change:
|
||||
|
||||
`Mime::#{sym}`
|
||||
|
||||
to:
|
||||
|
||||
`Mime[:#{ext}]`
|
||||
eow
|
||||
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
||||
Accessing mime types via constants is deprecated.
|
||||
Please change `Mime::#{sym}` to `Mime[:#{ext}]`.
|
||||
MSG
|
||||
Mime[ext]
|
||||
else
|
||||
super
|
||||
|
@ -65,15 +60,10 @@ to:
|
|||
def const_defined?(sym, inherit = true)
|
||||
ext = sym.downcase
|
||||
if Mime[ext]
|
||||
ActiveSupport::Deprecation.warn <<-eow
|
||||
Accessing mime types via constants is deprecated. Please change:
|
||||
|
||||
`Mime.const_defined?(#{sym})`
|
||||
|
||||
to:
|
||||
|
||||
`Mime[:#{ext}]`
|
||||
eow
|
||||
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
||||
Accessing mime types via constants is deprecated.
|
||||
Please change `Mime.const_defined?(#{sym})` to `Mime[:#{ext}]`.
|
||||
MSG
|
||||
true
|
||||
else
|
||||
super
|
||||
|
|
Loading…
Reference in a new issue