Class: Sunspot::TypeField

Inherits:
Object
  • Object
show all
Defined in:
lib/sunspot/field.rb

Overview

:nodoc:

Constant Summary collapse

MODULAR_MODEL_MARK =
'\:\:'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.instanceObject



249
250
251
# File 'lib/sunspot/field.rb', line 249

def instance
  @instance ||= new
end

Instance Method Details

#indexed_nameObject



254
255
256
# File 'lib/sunspot/field.rb', line 254

def indexed_name
  'type'
end

#to_indexed(clazz) ⇒ Object



258
259
260
# File 'lib/sunspot/field.rb', line 258

def to_indexed(clazz)
  clazz.name
end

#to_solr_conditional(value) ⇒ Object



262
263
264
# File 'lib/sunspot/field.rb', line 262

def to_solr_conditional(value)
  value.include?(MODULAR_MODEL_MARK) ? "\"#{value}\"" : value
end