Class: ActivePStore::Generators::ModelGenerator
- Defined in:
- lib/active_pstore/generators/active_pstore/model/model_generator.rb
Instance Attribute Summary
Attributes included from Persistence
Instance Method Summary collapse
-
#create_model_file ⇒ Object
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”.
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
Methods included from FinderMethods
#find, #find_by, #find_by!, #first, #last, #take
Methods included from Inheritance
Methods included from ModelSchema
Methods included from QueryMethods
Methods included from Persistence
#destroy, #new_record?, #save, #update, #update_attribute
Methods included from Core
Methods included from AttributeMethods
Constructor Details
This class inherits a constructor from ActivePStore::Base
Instance Method Details
#create_model_file ⇒ Object
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 |