Class: ActiveGraph::Shared::TypeConverters::TimeConverter
Class Method Summary
collapse
converted?, #supports_array?
Class Method Details
.convert_type ⇒ Object
178
179
180
|
# File 'lib/active_graph/shared/type_converters.rb', line 178
def convert_type
Time
end
|
.db_type ⇒ Object
182
183
184
|
# File 'lib/active_graph/shared/type_converters.rb', line 182
def db_type
Time
end
|
.to_ruby(value) ⇒ Object
Also known as:
to_db
186
187
188
|
# File 'lib/active_graph/shared/type_converters.rb', line 186
def to_ruby(value)
value.respond_to?(:to_time) ? value.to_time : Time.at(value).utc
end
|