module Rails module Generators class DecoratorGenerator < ::Rails::Generators::NamedBase source_root File.expand_path('../templates', __FILE__) check_class_collision suffix: 'Decorator' def create_decorator template 'decorator.rb', File.join('app/decorators', class_path, "#{file_name}_decorator.rb") end hook_for :test_framework end end end