Class: Spotlight::CustomField

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
FriendlyId
Defined in:
app/models/spotlight/custom_field.rb

Instance Method Summary collapse

Instance Method Details

#configured_to_display?Boolean

Returns:

  • (Boolean)


35
36
37
38
39
40
41
# File 'app/models/spotlight/custom_field.rb', line 35

def configured_to_display?
  if index_fields_config && index_fields_config["enabled"]
    view_types.any? do |view|
      index_fields_config[view.to_s]
    end
  end
end

#labelObject



22
23
24
25
# File 'app/models/spotlight/custom_field.rb', line 22

def label
  return configuration["label"] unless (field && exhibit)
  exhibit.blacklight_configuration.index_fields.fetch(field, configuration)['label']
end

#label=(label) ⇒ Object



13
14
15
16
17
18
19
20
# File 'app/models/spotlight/custom_field.rb', line 13

def label=(label)
  configuration["label"] = label
  if (field && exhibit)
    conf = exhibit.blacklight_configuration
    conf.index_fields.fetch(field, configuration)['label'] = label
    conf.save!
  end
end

#short_descriptionObject



31
32
33
# File 'app/models/spotlight/custom_field.rb', line 31

def short_description
  configuration["short_description"]
end

#short_description=(short_description) ⇒ Object



27
28
29
# File 'app/models/spotlight/custom_field.rb', line 27

def short_description=(short_description)
  configuration["short_description"] = short_description
end