Sha256: 73c780c715687bd7e6bf5ec1b2e7ae0ce930a4dc287e739be4dd8ed7331933f5

Contents?: true

Size: 484 Bytes

Versions: 10

Compression:

Stored size: 484 Bytes

Contents

class BooleanFieldType < FieldType
  attr_accessor :value

  def data=(data_hash)
    @value = data_hash.deep_symbolize_keys[:value]
  end

  def field_item_as_indexed_json_for_field_type(field_item, options = {})
    json = {}
    json[mapping_field_name] = field_item.data['boolean']
    json
  end

  def mapping
    { name: mapping_field_name, type: :string, analyzer: :snowball }
  end

  private

  def mapping_field_name
    "#{field_name.parameterize('_')}_boolean"
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cortex-plugins-core-0.5.0 app/models/boolean_field_type.rb
cortex-plugins-core-0.4.8 app/models/boolean_field_type.rb
cortex-plugins-core-0.4.7 app/models/boolean_field_type.rb
cortex-plugins-core-0.4.6 app/models/boolean_field_type.rb
cortex-plugins-core-0.4.5 app/models/boolean_field_type.rb
cortex-plugins-core-0.4.4 app/models/boolean_field_type.rb
cortex-plugins-core-0.4.3 app/models/boolean_field_type.rb
cortex-plugins-core-0.4.2 app/models/boolean_field_type.rb
cortex-plugins-core-0.4.1 app/models/boolean_field_type.rb
cortex-plugins-core-0.4.0 app/models/boolean_field_type.rb