Sha256: b07da79ab493514ff2577619fd083d67d2bcf75e66343b9e5c5bc1c490f5bd71
Contents?: true
Size: 523 Bytes
Versions: 12
Compression:
Stored size: 523 Bytes
Contents
module Spotlight # A configurable solr filter for the exhibit class Filter < ActiveRecord::Base belongs_to :exhibit validates :field, :value, presence: true def to_hash return {} unless field { field => cast_value } end private def cast_value return value unless field if field.ends_with? Spotlight::Engine.config.solr_fields.boolean_suffix ActiveRecord::Type::Boolean.new.type_cast_from_database(value) else value end end end end
Version data entries
12 entries across 12 versions & 1 rubygems