Class: Sunspot::Rails::Util

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

Class Method Summary collapse

Class Method Details

.index_relevant_attribute_changed?(object) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
# File 'lib/sunspot/rails/util.rb', line 11

def index_relevant_attribute_changed?( object )
  class_key = object.class.to_s.underscore.to_sym
  ignore_attributes = (sunspot_options[class_key][:ignore_attribute_changes_of] || [])
  !(object.changes.symbolize_keys.keys - ignore_attributes).blank?
end

.sunspot_optionsObject



7
8
9
# File 'lib/sunspot/rails/util.rb', line 7

def sunspot_options
  @sunspot_options ||= {}
end