Class: ActiveGraph::Shared::TypeConverters::DateConverter
Overview
Converts Java long types to Date objects. Must be timezone UTC.
Class Method Summary
collapse
converted?, #supports_array?
Class Method Details
.convert_type ⇒ Object
114
115
116
|
# File 'lib/active_graph/shared/type_converters.rb', line 114
def convert_type
Date
end
|
.db_type ⇒ Object
118
119
120
|
# File 'lib/active_graph/shared/type_converters.rb', line 118
def db_type
Date
end
|
.to_ruby(value) ⇒ Object
Also known as:
to_db
122
123
124
|
# File 'lib/active_graph/shared/type_converters.rb', line 122
def to_ruby(value)
value.respond_to?(:to_date) ? value.to_date : Time.at(value).utc.to_date
end
|