vendor/plugins/model_stubbing/lib/model_stubbing/definition.rb
def model(klass, options = {}, &block)
      m = Model.new(self, klass, @options.merge(options))
      @ordered_models <<  m unless @models.key?(m.name)
      @models[m.name] ||= m
      @models[m.name].instance_eval(&block) if block
      @models[m.name]
    end
# Creates a new ModelStubbing::Model to hold one or more stubs.  Multiple calls will append
# any added stubs to the same model instance.
#
# Options:
# * :name      - The name used of the model.  Defaults to the "Foo".underscore.pluralize
# * :plural    - The name of the method used to access the stubs in your test.  
#                Defaults to #name.
# * :singular  - The name of the method for the new_* stub accessors.
# * :validate  - set to false if you don't want to validate model data, or run callbacks
# * :callbacks - set to true if you want to run callbacks.
Creates a new ModelStubbing::Model to hold one or more stubs.  Multiple calls will append
any added stubs to the same model instance.

:name      - The name used of the model.  Defaults to the "Foo".underscore.pluralize
:plural    - The name of the method used to access the stubs in your test.
Defaults to #name.
:singular  - The name of the method for the new_* stub accessors.
:validate  - set to false if you don't want to validate model data, or run callbacks
:callbacks - set to true if you want to run callbacks.
Creates a new ModelStubbing :: Model to hold one or more stubs . Multiple calls will append any added stubs to the same model instance . : name - The name used of the model . Defaults to the " Foo " . underscore . pluralize : plural - The name of the method used to access the stubs in your test . Defaults to #name . : singular - The name of the method for the new_ * stub accessors . : validate - set to false if you don ' t want to validate model data or run callbacks : callbacks - set to true if you want to run callbacks .
def model(klass, options = {}, &block)
      m = Model.new(self, klass, @options.merge(options))
      @ordered_models <<  m unless @models.key?(m.name)
      @models[m.name] ||= m
      @models[m.name].instance_eval(&block) if block
      @models[m.name]
    end
def model ( klass , options = { } , & block ) m = Model . new ( self , klass , @options . merge ( options ) ) @ordered_models << m unless @models . key? ( m . name ) @models [ m . name ] ||= m @models [ m . name ] . instance_eval ( & block ) if block @models [ m . name ] end
Creates a new ModelStubbing::Model to hold one or more stubs.
Creates a new ModelStubbing :: Model to hold one or more stubs .
klass
options
block