require "devise"
require "devise_invitable"
require 'pundit'
require 'slim'
require 'jquery-rails'

module Subscribe
  class Engine < ::Rails::Engine
    isolate_namespace Subscribe

    config.generators do |g|
      g.test_framework :rspec, :view_specs => false
      g.template_engine :slim
    end

    #Monkey patch - Run migrations inside engine - consider removing in future versions and use rake subscribe:install:migrations instead
    
    initializer :append_migrations do |app|
      unless app.root.to_s.match root.to_s
        config.paths["db/migrate"].expanded.each do |expanded_path|
          app.config.paths["db/migrate"] << expanded_path
        end
      end
    end
  end
end
