Class: ActivePStore::Generators::ModelGenerator

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

Instance Attribute Summary

Attributes included from Persistence

#id

Instance Method Summary collapse

Methods inherited from Base

all, create, find_or_create_by, first_or_create, #initialize

Methods included from ConnectionHandling

#connection_config, #establish_connection, #use_connection

Methods included from DynamicMatchers

#respond_to?

Methods included from FinderMethods

#find, #find_by, #find_by!, #first, #last, #take

Methods included from Inheritance

#new

Methods included from ModelSchema

#pstore_key

Methods included from QueryMethods

#where

Methods included from Persistence

#destroy, #new_record?, #save, #update, #update_attribute

Methods included from Core

#==, #hash

Methods included from AttributeMethods

#[]

Constructor Details

This class inherits a constructor from ActivePStore::Base

Instance Method Details

#create_model_fileObject

class_option :timestamps, type: :boolean

class_option :parent,     type: :string, desc: "The parent class for the generated model"
class_option :collection, type: :string, desc: "The collection for storing model's documents"


16
17
18
# File 'lib/active_pstore/generators/active_pstore/model/model_generator.rb', line 16

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