123456789_123456789_123456789_123456789_123456789_

Module: ActiveModel::Type::Helpers::Timezone

Do not use. This module is for internal use only.

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#is_utc?Boolean (readonly)

[ GitHub ]

  
# File 'activemodel/lib/active_model/type/helpers/timezone.rb', line 9

def is_utc?
  if default = ::Time.zone_default
    default.name == "UTC"
  else
    true
  end
end

Instance Method Details

#default_timezone

[ GitHub ]

  
# File 'activemodel/lib/active_model/type/helpers/timezone.rb', line 17

def default_timezone
  is_utc? ? :utc : :local
end