Sha256: 667f5141b18117706142055c231d4a5980141696d97358300ae93eb75b7c24aa
Contents?: true
Size: 809 Bytes
Versions: 18
Compression:
Stored size: 809 Bytes
Contents
module KirguduBase module DynamicPages class Filter < ::KirguduBase::DynamicPages::Property mergeable_attributes :input_type, :events fixable_attributes :events validates_presence_of :input_type, :visible validates_inclusion_of :input_type, in: ::KirguduBase::DynamicPages::Enums::SUPPORTED_INPUT_TYPES validates_presence_of :data_source, if: :must_have_data_source? def initialize(options = {}) self.input_type = :text_edit self.events = {} super(options) end attr_accessor :input_type attr_accessor :events def events_for_json self.events ? self.events.map { |e| e.to_external_hash(nil) } : {} end def must_have_data_source? [:chosen_select, :select, :autocomplete_with_id, :autocomplete].include?(self.input_type) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems