module Orchestrate::Rails::UserGuide::TheModel
Defining the model¶ ↑
My Thing example: <rails-root>/app/models/my_thing.rb
class MyThing < Orchestrate::Rails::Model end
Method definitions for Orchestrate::Rails::Model
Collection names.¶ ↑
By default, it is expected that the collection name can be derived from the class name in standard rails fashion, as shown:
-
class: MyThing => collection: 'my_things'
-
class: Other => collection: 'others'
Collection names that do not follow this convention must be specified by
adding the :define_collection_name
key to the params hash
during model initialization.
class MyThing < Orchestrate::Rails::Model def initialize(params={}) params[:define_collection_name] = "My_Big_Collection_of_Things" super params end end