1
0
Fork 0
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:
Matthew Draper 2015-12-06 04:59:09 +10:30
parent c5e5b94c8a
commit 0d8b3c2e7f

View file

@ -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