Sha256: e3b4e63187fd4691dd9b61a993042953676a5f208007f5c1672d91eb85eec129
Contents?: true
Size: 1.79 KB
Versions: 3
Compression:
Stored size: 1.79 KB
Contents
# ==================================================== # = Model = # ==================================================== BackboneFactory.define '<%= model_name %>', <%= "#{namespace('classify')}.Models.#{model_name('classify')}" %>, -> # title: 'Your Title Here' # description: 'string, function, or another Factory' # size: _(['Tall', 'Grande', 'Venti', 'Trenta']).shuffle()[0] # section: Factory.section() # ======================================================= # = FactoryGirl Interface: = # = Factory.modleName( {overrides:here} ) = # ======================================================= window.Factory = (-> factories = [{}].concat _(BackboneFactory.factories).keys() _(factories).inject (memo, factory)-> memo[factory]= (overrides)-> BackboneFactory.create factory, -> overrides memo )() <%- if collection_name -%> # ==================================================== # = Collection = # ==================================================== _(window.Factory).extend({ <%= collection_name %>: (overrides)-> new <%= "#{namespace('classify')}.Collections.#{collection_name('classify')}" %> _({ models: _([1,2,3]).map -> BackboneFactory.create('<%= model_name %>', ->) }).extend( overrides ) }) <%- end -%> # ==================================================== # = Complex Factories = # ==================================================== # section_w_section_materials: (overrides)-> Factory.section( _( section_materials: Factory.section_materials().models ).extend(overrides) ) # distributor_w_offers: (overrides)-> Factory.distributor( _(offers: Factory.offers().models ).extend(overrides))
Version data entries
3 entries across 3 versions & 1 rubygems