lib/thinking_sphinx/configuration.rb in DrMark-thinking-sphinx-1.2.5 vs lib/thinking_sphinx/configuration.rb in DrMark-thinking-sphinx-1.2.6
- old
+ new
@@ -155,10 +155,12 @@
# Make sure all models are loaded - without reloading any that
# ActiveRecord::Base is already aware of (otherwise we start to hit some
# messy dependencies issues).
#
def load_models
- return if defined?(Rails) && Rails.configuration.cache_classes
+ return if defined?(Rails) &&
+ Rails.configuration.cache_classes &&
+ Rails::VERSION::STRING.to_f > 2.1
self.model_directories.each do |base|
Dir["#{base}**/*.rb"].each do |file|
model_name = file.gsub(/^#{base}([\w_\/\\]+)\.rb/, '\1')