Module: ActiveScaffold::Bridges::CalendarDateSelect::CalendarDateSelectBridge

Defined in:
lib/active_scaffold/bridges/calendar_date_select/as_cds_bridge.rb

Instance Method Summary collapse

Instance Method Details

#initialize(model_id) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/active_scaffold/bridges/calendar_date_select/as_cds_bridge.rb', line 5

def initialize(model_id)
  initialize_without_calendar_date_select(model_id)

  calendar_date_select_fields = _columns.collect { |c| c.name.to_sym if %i[date datetime].include?(c.type) }.compact
  # check to see if file column was used on the model
  return if calendar_date_select_fields.empty?

  # automatically set the forum_ui to a file column
  calendar_date_select_fields.each { |field| columns[field].form_ui = :calendar_date_select }
end