Skip to content

Instantly share code, notes, and snippets.

@bartocc
Created July 6, 2010 08:02
Show Gist options
  • Save bartocc/465140 to your computer and use it in GitHub Desktop.
Save bartocc/465140 to your computer and use it in GitHub Desktop.
gem 'sunspot_rails', :require => 'sunspot/rails'
# in config/initializers
Sunspot.session = Sunspot::Rails.build_session
Sunspot::Adapters::InstanceAdapter.register(Sunspot::Rails::Adapters::ActiveRecordInstanceAdapter, ActiveRecord::Base)
Sunspot::Adapters::DataAccessor.register(Sunspot::Rails::Adapters::ActiveRecordDataAccessor, ActiveRecord::Base)
ActiveRecord::Base.module_eval { include(Sunspot::Rails::Searchable) }
ActionController::Base.module_eval { include(Sunspot::Rails::RequestLifecycle) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment