Class: Mongomatic::Generators::ModelGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/rails/generators/mongomatic/model/model_generator.rb

Instance Method Summary collapse

Methods inherited from Base

source_root

Instance Method Details

#connectionObject



22
23
24
# File 'lib/rails/generators/mongomatic/model/model_generator.rb', line 22

def connection
  options[:connection]
end

#create_model_fileObject



30
31
32
# File 'lib/rails/generators/mongomatic/model/model_generator.rb', line 30

def create_model_file
  template "model.rb", File.join("app/models", class_path, "#{file_name}.rb")
end

#expectations?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/rails/generators/mongomatic/model/model_generator.rb', line 26

def expectations?
  options[:expectations] == true
end