1
0
Fork 0
mirror of https://github.com/drapergem/draper synced 2023-03-27 23:21:17 -04:00

Rename existing generator from draper:model to draper:decorator

This commit is contained in:
Jeff Casimir 2011-08-02 23:03:17 -07:00
parent 6d6ff66091
commit 04fe62db0f
5 changed files with 4 additions and 3 deletions

View file

@ -1,7 +1,8 @@
require "draper/version"
require 'draper/version'
require 'draper/system'
require 'draper/all_helpers'
require 'draper/base'
require 'draper/lazy_helpers'
require 'draper/railtie'
Draper::System.setup

View file

@ -1,5 +1,5 @@
module Draper
class ModelGenerator < Rails::Generators::NamedBase
class DecoratorGenerator < Rails::Generators::NamedBase
source_root File.expand_path('../templates', __FILE__)
DECORATORS_ROOT = 'app/decorators/'
@ -11,7 +11,7 @@ module Draper
unless File.exists?(APPLICATION_DECORATOR_PATH)
template APPLICATION_DECORATOR, APPLICATION_DECORATOR_PATH
end
template 'model.rb', "#{DECORATORS_ROOT}#{singular_name}_decorator.rb"
template 'decorator.rb', "#{DECORATORS_ROOT}#{singular_name}_decorator.rb"
end
end
end