class Stall::ModelGenerator

Constants

MODELS_DIR

Public Instance Methods

copy_model_template() click to toggle source
# File lib/generators/stall/model/model_generator.rb, line 8
def copy_model_template
  if File.exist?(source_path)
    template source_path, "app/models/#{ file_path_with_ext }"
  else
    raise ModelModelNotFound,
          "Could not find any stall model for #{ class_name }"
  end
end

Private Instance Methods

file_path_with_ext() click to toggle source
# File lib/generators/stall/model/model_generator.rb, line 23
def file_path_with_ext
  @file_path_with_ext ||= "#{ file_path }.rb"
end
source_path() click to toggle source
# File lib/generators/stall/model/model_generator.rb, line 19
def source_path
  @source_path ||= File.join(MODELS_DIR, file_path_with_ext)
end