Class: Spree::ModelDecoratorGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/spree/model_decorator/model_decorator_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_pathsObject



7
8
9
10
11
# File 'lib/generators/spree/model_decorator/model_decorator_generator.rb', line 7

def self.source_paths
  paths = superclass.source_paths
  paths << File.expand_path('templates', __dir__)
  paths.flatten
end

Instance Method Details

#create_model_decorator_fileObject



13
14
15
# File 'lib/generators/spree/model_decorator/model_decorator_generator.rb', line 13

def create_model_decorator_file
  template 'model_decorator.rb.tt', "app/models/#{file_path}_decorator.rb"
end