Class: SpreeCmCommissioner::DynamicField

Inherits:
Base
  • Object
show all
Defined in:
app/models/spree_cm_commissioner/dynamic_field.rb

Instance Method Summary collapse

Instance Method Details

#multiple_selectObject



23
24
25
26
27
# File 'app/models/spree_cm_commissioner/dynamic_field.rb', line 23

def multiple_select
  return nil unless selection?

  configurations['multiple_select'] == true
end

#multiple_select=(value) ⇒ Object



29
30
31
32
# File 'app/models/spree_cm_commissioner/dynamic_field.rb', line 29

def multiple_select=(value)
  self.configurations ||= {}
  self.configurations['multiple_select'] = ActiveModel::Type::Boolean.new.cast(value)
end

#requires_dynamic_field_options?Boolean



19
20
21
# File 'app/models/spree_cm_commissioner/dynamic_field.rb', line 19

def requires_dynamic_field_options?
  checkbox? || radio? || selection?
end