Update blog generator to use Rails 3.1 base

Seeds will now follow Rails 3.1 conventions
This commit is contained in:
Jamie Winsor 2011-10-27 18:12:32 -07:00
parent 8cd4a282d8
commit 5a958007c5
5 changed files with 19 additions and 12 deletions

View file

@ -1,10 +0,0 @@
require 'refinery/generators'
module ::Refinery
class BlogGenerator < ::Refinery::Generators::EngineInstaller
source_root File.expand_path('../../../', __FILE__)
engine_name "refinerycms-blog"
end
end

View file

@ -0,0 +1,16 @@
module Refinery
class BlogGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
def append_load_seed_data
append_file 'db/seeds.rb', :verbose => true do
<<-EOH
# Added by RefineryCMS Blog engine
Refinery::Blog::Engine.load_seed
EOH
end
end
end
end

View file

@ -3,9 +3,10 @@ require 'bundler'
Bundler.require
require 'filters_spam'
require File.expand_path('../generators/blog_generator', __FILE__)
module Refinery
autoload :BlogGenerator, 'generators/refinery/blog/blog_generator'
module Blog
autoload :Version, 'refinery/blog/version'
autoload :Tab, 'refinery/blog/tabs'