Class: Refinery::MenusGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/refinery/menus/menus_generator.rb

Instance Method Summary collapse

Instance Method Details

#append_load_seed_dataObject



13
14
15
16
17
18
19
20
21
# File 'lib/generators/refinery/menus/menus_generator.rb', line 13

def append_load_seed_data
  create_file 'db/seeds.rb' unless File.exists?(File.join(destination_root, 'db', 'seeds.rb'))
  append_file 'db/seeds.rb', :verbose => true do
          <<-EOH
  # Added by Refinery CMS Page Menus extension
  Refinery::Menus::Engine.load_seed
          EOH
  end
end

#generate_menus_initializerObject



5
6
7
# File 'lib/generators/refinery/menus/menus_generator.rb', line 5

def generate_menus_initializer
  template "config/initializers/refinery/menus.rb.erb", File.join(destination_root, "config", "initializers", "refinery", "menus.rb")
end

#rake_dbObject



9
10
11
# File 'lib/generators/refinery/menus/menus_generator.rb', line 9

def rake_db
  rake("refinery_menus:install:migrations")
end