Class: Ember::Generators::ModelGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
GeneratorHelpers
Defined in:
lib/generators/ember/model_generator.rb

Direct Known Subclasses

ScaffoldGenerator

Instance Method Summary collapse

Methods included from GeneratorHelpers

#app_path, #application_name, #class_name, #config_path, #configuration, #engine_name, #handlebars_template_path, #javascript_assets_path, #rails_engine?, #require_name

Instance Method Details

#create_model_filesObject


12
13
14
15
# File 'lib/generators/ember/model_generator.rb', line 12

def create_model_files
  file_path = File.join(app_path, 'models', class_path, "#{file_name.singularize}.es6")
  template "model.es6", file_path
end

#create_test_filesObject


17
18
19
20
# File 'lib/generators/ember/model_generator.rb', line 17

def create_test_files
  file_path = File.join('test', 'models', class_path, "#{file_name.singularize}_test.es6")
  template "test/model.es6", file_path
end