Module: ActiveModel::Form::DateTimeAttribute

Defined in:
lib/active_model/form/attributes.rb

Class Method Summary collapse

Class Method Details

.number?Boolean

Returns:

  • (Boolean)

120
121
122
# File 'lib/active_model/form/attributes.rb', line 120

def self.number?
  false
end

.parse(v) ⇒ Object


108
109
110
111
112
113
114
# File 'lib/active_model/form/attributes.rb', line 108

def self.parse(v)
  if v.compact.present?
    DateTime.new(*v)
  else
    nil
  end
end

.typeObject


116
117
118
# File 'lib/active_model/form/attributes.rb', line 116

def self.type
  :timestamp
end