Sha256: 37de4062c0df3ff6856eb582677ad077c801f5183e620ea93914d602663e738a

Contents?: true

Size: 742 Bytes

Versions: 2

Compression:

Stored size: 742 Bytes

Contents

# TODO
# 
# This is horrendous code.  I need to replace it ASAP
Luca.concerns.Deferrable = 
  configure_collection: (setAsDeferrable=true)->
    return unless @collection

    if _.isString( @collection ) and collectionManager = Luca.CollectionManager?.get()
      @collection = collectionManager.getOrCreate(@collection)

    # if there is already an instantiated backbone collection don't do anything
    unless @collection and _.isFunction( @collection.fetch ) and _.isFunction( @collection.reset )
      @collection = new Luca.Collection( @collection.initial_set, @collection )
    
    if @collection?.deferrable_trigger
      @deferrable_trigger = @collection.deferrable_trigger

    if setAsDeferrable
      @deferrable = @collection

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
luca-0.9.76 src/concerns/deferrable.coffee
luca-0.9.7 src/concerns/deferrable.coffee