Module: ActiveModel::Type::Helpers::Timezone
Do not use. This module is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
::ActiveModel::Type::Date ,
::ActiveModel::Type::DateTime ,
::ActiveModel::Type::Time ,
::ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Date ,
::ActiveRecord::ConnectionAdapters::PostgreSQL::OID::DateTime ,
::ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Timestamp ,
::ActiveRecord::ConnectionAdapters::PostgreSQL::OID::TimestampWithTimeZone ,
::ActiveRecord::Type::Date ,
::ActiveRecord::Type::DateTime ,
::ActiveRecord::Type::Time
| |
Defined in: | activemodel/lib/active_model/type/helpers/timezone.rb |
Instance Attribute Summary
- #is_utc? ⇒ Boolean readonly
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