lib/challah/engine.rb in challah-1.6.1 vs lib/challah/engine.rb in challah-2.0.0.beta1
- old
+ new
@@ -1,19 +1,19 @@
module Challah
class Engine < ::Rails::Engine
- initializer 'challah.router' do |app|
- app.routes_reloader.paths.insert(0, File.expand_path(File.join(File.dirname(__FILE__), 'routes.rb')))
+ initializer "challah.router" do |app|
+ app.routes_reloader.paths.insert(0, File.expand_path(File.join(File.dirname(__FILE__), "routes.rb")))
end
- initializer 'challah.active_record' do
+ initializer "challah.active_record" do
ActiveSupport.on_load :active_record do
Challah::Engine.setup_active_record!
end
end
- initializer 'challah.action_controller' do
+ initializer "challah.action_controller" do
ActiveSupport.on_load :action_controller do
Challah::Engine.setup_action_controller!
end
end
@@ -31,32 +31,19 @@
# Rails 5 API
if defined?(ActionController::API)
ActionController::API.send(:include, Challah::Controller)
end
-
- # Load any ActionController/Challah plugins
- Challah.plugins.values.each do |plugin|
- plugin.action_controller.each do |proc|
- proc.call
- end
- end
end
end
# Set up active record with Challah methods
def self.setup_active_record!
if defined?(ActiveRecord)
Challah.options[:logger] = ActiveRecord::Base.logger
ActiveRecord::Base.send(:include, Challah::Audit)
-
- # Load any ActiveRecord/Challah plugins
- Challah.plugins.values.each do |plugin|
- plugin.active_record.each do |proc|
- proc.call
- end
- end
end
end
+
end
end