Class: PageflowChart::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/pageflow_chart/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#install_migrationsObject



17
18
19
# File 'lib/generators/pageflow_chart/install/install_generator.rb', line 17

def install_migrations
  rake 'pageflow_chart:install:migrations'
end

#mount_engineObject



13
14
15
# File 'lib/generators/pageflow_chart/install/install_generator.rb', line 13

def mount_engine
  route("mount Pageflow::Chart::Engine, at: '/charts'\n")
end

#register_pluginObject



5
6
7
8
9
10
11
# File 'lib/generators/pageflow_chart/install/install_generator.rb', line 5

def register_plugin
  inject_into_file('config/initializers/pageflow.rb',
                   after: "Pageflow.configure do |config|\n") do

    "  config.page_types.register(Pageflow::Chart.page_type)\n"
  end
end