Class: ContentsCore::ItemDatetime

Inherits:
Item show all
Defined in:
app/models/contents_core/item_datetime.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Item

#as_json, #attr_id, #class_name, #config, #data_type, #editable, #on_after_initialize, #on_before_create, #opt_input, #process_data, #set, #to_s, types, #update_data, #validate_item

Class Method Details

.permitted_attributesObject



10
11
12
# File 'app/models/contents_core/item_datetime.rb', line 10

def self.permitted_attributes
  [ :data_datetime ]
end

.type_nameObject



14
15
16
# File 'app/models/contents_core/item_datetime.rb', line 14

def self.type_name
  'datetime'
end

Instance Method Details

#initObject



5
6
7
8
# File 'app/models/contents_core/item_datetime.rb', line 5

def init
  self.data = Time.now unless self.data
  self
end