forked from apotonick/apotomo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
railtie.rb
24 lines (20 loc) · 833 Bytes
/
railtie.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require "rails/railtie"
module Apotomo
class Railtie < ::Rails::Railtie
rake_tasks do
load "apotomo/apotomo.rake"
end
# As we are a Railtie only, the routes won't be loaded automatically. Beside that, we want our
# route to be the very first (otherwise #resources might supersede it).
initializer 'apotomo.prepend_routes', :after => :add_routing_paths do |app|
app.routes_reloader.paths.unshift(File.dirname(__FILE__) + "/../../config/routes.rb")
end
# Include a lazy loader via has_widgets.
initializer 'apotomo.add_has_widgets' do |app|
ActionController::Base.extend Apotomo::Rails::ControllerMethodsLoader
end
initializer 'apotomo.setup_view_paths', :after => 'cells.setup_view_paths' do |app|
Apotomo::Widget.setup_view_paths!
end
end
end