lib/blacklight/engine.rb in blacklight-3.0.0pre3 vs lib/blacklight/engine.rb in blacklight-3.0.0pre4
- old
+ new
@@ -13,14 +13,14 @@
# Go ahead and innitialize Blacklight at the very end of the rails
# innitilization process.
# See: http://www.cowboycoded.com/2010/08/02/hooking-in-your-rails-3-engine-or-railtie-initializer-in-the-right-place/
initializer 'blacklight.init', :after=> :disable_dependency_loading do |app|
- # Note, check for configuration files before calling init,
- # otherwise we can't generate these files with the Generator
- # and we can't tell at this point if we are begin run as a generator
- # or not (at least, I didn't see a way)
- Blacklight.init if File.exists?(Blacklight.solr_file)
+ # Check for a blacklight_install envrionment variable - if set then blacklight
+ # is actively being installed and we should not attempt an init at this time.
+ if defined?(Rails::Server)
+ Blacklight.init
+ end
end
# This makes our rake tasks visible.
rake_tasks do
Dir.chdir(File.expand_path(File.join(File.dirname(__FILE__), '..'))) do