internetee-registry/lib/gem_ext/i18n.rb
Artur Beljajev 30ac973f96 Remove lib folder from autoload path
- Load extensions explicitly
2018-06-05 17:26:14 +03:00

11 lines
336 B
Ruby

# Don't raise error when nil
# http://stackoverflow.com/questions/9467034/rails-i18n-how-to-handle-case-of-a-nil-date-being-passed-ie-lnil
module I18n
class << self
alias_method :original_localize, :localize
def localize(object, options = {})
object.present? ? original_localize(object, options) : ''
end
end
end