Skip to content

Commit

Permalink
Removing cache check - double-adding classes has no downside beyond a…
Browse files Browse the repository at this point in the history
… little extra time, and removes window for bugs/Rails version inconsistencies.
  • Loading branch information
pat committed Dec 21, 2009
1 parent 8b48e0f commit 3f0d4e7
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/thinking_sphinx/context.rb
Expand Up @@ -7,7 +7,7 @@ def initialize

def prepare
load_models
add_indexed_models if cached?
add_indexed_models
end

def define_indexes
Expand All @@ -33,14 +33,6 @@ def superclass_indexed_models

private

def cached?
return true if defined?(Merb)

defined?(Rails) &&
Rails::VERSION::STRING.to_f > 2.1 &&
Rails.configuration.cache_classes
end

def add_indexed_models
Object.subclasses_of(ActiveRecord::Base).each do |klass|
add_indexed_model klass if klass.has_sphinx_indexes?
Expand Down

0 comments on commit 3f0d4e7

Please sign in to comment.