Module: ActiveRecord::Type::Internal::Timezone

Included in:
Date, DateTime, Time
Defined in:
lib/active_record/type/internal/timezone.rb

Instance Method Summary collapse

Instance Method Details

#default_timezoneObject



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

Returns:



12
13
14
# File 'lib/active_record/type/internal/timezone.rb', line 12

def is_utc?
  default_timezone == :utc
end