Sha256: 56ad7a0fcf36075a6314c6fb48b1c0ebbc28c82c431ab769bb41ca6a3273a888
Contents?: true
Size: 798 Bytes
Versions: 83
Compression:
Stored size: 798 Bytes
Contents
module Sunspot # # A TextFieldSetup encapsulates a regular (or composite) setup, and exposes # the #field() method returning text fields instead of attribute fields. # class TextFieldSetup #:nodoc: def initialize(setup) @setup = setup end # # Return a text field with the given name. Duck-type compatible with # Setup and CompositeSetup, but return text fields instead. # def field(name) fields = @setup.text_fields(name) if fields if fields.length == 1 fields.first else raise( Sunspot::UnrecognizedFieldError, "The text field with name #{name} has incompatible configurations for the classes #{@setup.type_names.join(', ')}" ) end end end end end
Version data entries
83 entries across 83 versions & 15 rubygems