mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 06:34:46 +02:00
Improve readability
This commit is contained in:
parent
aea4bf974a
commit
67a90c2ef1
9 changed files with 9 additions and 9 deletions
11
lib/gem_monkey_patches/i18n.rb
Normal file
11
lib/gem_monkey_patches/i18n.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
# 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
|
Loading…
Add table
Add a link
Reference in a new issue