Permalink
Browse files

Need to eager load all the models in development so that the proper m…

…ethods get defined
  • Loading branch information...
1 parent 7b6599d commit 724f0ae034b2ca72c5bbcd428dbfe5d06f9590b9 @radar committed Jan 30, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/searcher.rb
View
@@ -11,6 +11,7 @@ def self.classes
ActiveRecord::Base.extend(Searcher::ClassMethods)
ActiveSupport.on_load(:after_initialize) do
+ Dir[Rails.root + "app/models/**/*.rb"].each { |f| require f } if Rails.env.development?
Searcher.classes.each do |klass|
table = klass.arel_table
klass.searcher[:labels].each do |name, config|

0 comments on commit 724f0ae

Please sign in to comment.