class ActiveReporter::Dimension::Time::Set

Public Instance Methods

cast(value) click to toggle source
# File lib/active_reporter/dimension/time.rb, line 84
def cast(value)
  case ActiveReporter.database_type
  when :postgres
    "CAST(#{super} AS timestamp with time zone)"
  when :sqlite
    "DATETIME(#{super})"
  else
    "CAST(#{super} AS DATETIME)"
  end
end
parse(value) click to toggle source
# File lib/active_reporter/dimension/time.rb, line 80
def parse(value)
  ::Time.zone.parse(value.to_s.gsub('"', ''))
end