Class: Refinery::BlogGenerator

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

Instance Method Summary collapse

Instance Method Details

#append_load_seed_dataObject


15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/refinery/blog/blog_generator.rb', line 15

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 Blog engine
Refinery::Blog::Engine.load_seed
    EOH
  end
end

#generate_blog_initializerObject


6
7
8
# File 'lib/generators/refinery/blog/blog_generator.rb', line 6

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

#rake_dbObject


10
11
12
13
# File 'lib/generators/refinery/blog/blog_generator.rb', line 10

def rake_db
  rake("refinery_blog:install:migrations")
  rake("refinery_settings:install:migrations")
end