Class: ActionBlocks::DateFieldBuilder

Inherits:
FieldBlock show all
Defined in:
lib/action_blocks/builders/model_builder.rb

Instance Attribute Summary

Attributes inherited from FieldBlock

#field_type, #parent_model

Attributes inherited from BaseBuilder

#dsl_delegate, #id

Instance Method Summary collapse

Methods inherited from FieldBlock

#key, #match_requirements, #select_requirements

Methods inherited from BlockType

#is_block?, #type

Methods inherited from BaseBuilder

#after_build, #after_load, array_fields, block_type, builds, builds_many, delegate_class, #evaluate, #freeze, includes_scheme_helpers, #initialize, #is_block?, #key, references, sets, sets_many, #ui_reference, #valid?

Constructor Details

This class inherits a constructor from ActionBlocks::BaseBuilder

Instance Method Details

#before_build(parent, *args) ⇒ Object



538
539
540
541
# File 'lib/action_blocks/builders/model_builder.rb', line 538

def before_build(parent, *args)
  super(parent, *args)
  @field_type = 'date'
end

#hashify(user) ⇒ Object



543
544
545
546
547
548
# File 'lib/action_blocks/builders/model_builder.rb', line 543

def hashify(user)
  {
    type: :date,
    id: @id
  }
end