lib/supernova/solr_indexer.rb in supernova-0.3.0 vs lib/supernova/solr_indexer.rb in supernova-0.3.1

- old
+ new

@@ -2,10 +2,12 @@ class Supernova::SolrIndexer attr_accessor :options, :db, :ids attr_writer :index_file_path + include Supernova::Solr + class << self def field_definitions @field_definitions ||= {} end @@ -22,15 +24,18 @@ @table_name = name if name != :only_return @table_name end def method_missing(*args) - criteria = Supernova::SolrCriteria.new(self.clazz).attribute_mapping(self.field_definitions) - if criteria.respond_to?(args.first) - criteria.send(*args) + if search_scope.respond_to?(args.first) + search_scope.send(*args) else super end + end + + def search_scope + Supernova::SolrCriteria.new(self.clazz).attribute_mapping(self.field_definitions) end end FIELD_SUFFIX_MAPPING = { :raw => nil, \ No newline at end of file