lib/cm_admin/models/form_field.rb in cm-admin-0.7.7 vs lib/cm_admin/models/form_field.rb in cm-admin-0.7.8
- old
+ new
@@ -1,8 +1,8 @@
module CmAdmin
module Models
class FormField
- attr_accessor :field_name, :label, :header, :input_type, :collection, :custom_value, :disabled, :collection_method
+ attr_accessor :field_name, :label, :header, :input_type, :collection, :disabled, :helper_method
VALID_INPUT_TYPES = [:integer, :decimal, :string, :single_select, :multi_select, :date, :date_time, :text, :single_file_upload, :multi_file_upload, :hidden, :rich_text].freeze
def initialize(field_name, input_type, attributes = {})
raise ArgumentError, "Kindly select a valid filter type like #{VALID_INPUT_TYPES.sort.to_sentence(last_word_connector: ', or ')} instead of #{input_type} for column #{field_name}" unless VALID_INPUT_TYPES.include?(input_type.to_sym)
@field_name = field_name