Module: ActiveRecord::Type::Internal::Timezone
Instance Method Summary collapse
- #==(other) ⇒ Object
- #default_timezone ⇒ Object
- #initialize(timezone: nil, **kwargs) ⇒ Object
- #is_utc? ⇒ Boolean
Instance Method Details
#==(other) ⇒ Object
20 21 22 |
# File 'lib/active_record/type/internal/timezone.rb', line 20 def ==(other) super(other) && timezone == other.timezone end |
#default_timezone ⇒ Object
16 17 18 |
# File 'lib/active_record/type/internal/timezone.rb', line 16 def default_timezone @timezone || ActiveRecord.default_timezone end |
#initialize(timezone: nil, **kwargs) ⇒ Object
7 8 9 10 |
# File 'lib/active_record/type/internal/timezone.rb', line 7 def initialize(timezone: nil, **kwargs) super(**kwargs) @timezone = timezone end |
#is_utc? ⇒ Boolean
12 13 14 |
# File 'lib/active_record/type/internal/timezone.rb', line 12 def is_utc? default_timezone == :utc end |