lib/erd/railtie.rb in erd-0.2.0 vs lib/erd/railtie.rb in erd-0.3.0

- old
+ new

@@ -3,13 +3,15 @@ module Erd autoload :Migrator, 'erd/migrator' class Railtie < ::Rails::Railtie #:nodoc: - config.to_prepare do - if Rails.env.development? - Rails.application.routes.append do - mount Erd::Engine, :at => '/erd' + initializer 'erd' do |app| + ActiveSupport.on_load(:after_initialize) do + if Rails.env.development? + Rails.application.routes.append do + mount Erd::Engine, :at => '/erd' + end end end end end end