Class: Refinery::PagesGenerator

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

Instance Method Summary collapse

Instance Method Details

#append_load_seed_dataObject



17
18
19
20
21
22
23
24
25
26
# File 'pages/lib/generators/refinery/pages/pages_generator.rb', line 17

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 Pages extension
Refinery::Pages::Engine.load_seed
    EOH
  end
end

#generate_pages_initializerObject



12
13
14
15
# File 'pages/lib/generators/refinery/pages/pages_generator.rb', line 12

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

#rake_dbObject



8
9
10
# File 'pages/lib/generators/refinery/pages/pages_generator.rb', line 8

def rake_db
  rake "refinery_pages:install:migrations" unless self.options[:skip_migrations]
end