lib/verdict/railtie.rb in verdict-0.6.2 vs lib/verdict/railtie.rb in verdict-0.6.3
- old
+ new
@@ -1,10 +1,11 @@
class Verdict::Railtie < Rails::Railtie
initializer "experiments.configure_rails_initialization" do |app|
Verdict.default_logger = Rails.logger
- Verdict.directory = Rails.root.join('app', 'experiments')
- app.config.eager_load_paths -= [Verdict.directory.to_s]
+ Verdict.directory ||= Rails.root.join('app', 'experiments')
+ app.config.eager_load_paths -= Dir[Verdict.directory.to_s]
+
# Re-freeze eager load paths to ensure they blow up if modified at runtime, as Rails does
app.config.eager_load_paths.freeze
end
config.to_prepare do