-class Minimongoid
+class @Minimongoid
   id: undefined
   attributes: {}
 


  save: ->
    return false unless @isValid()
    
    attributes = @mongoize(@attributes)
    attributes['_type'] = @constructor._type if @constructor._type?
    
    if @isPersisted()
      @constructor._collection.update @id, { $set: attributes }
    else
      @id = @constructor._collection.insert attributes
    
    this

  update: (@attributes) ->

  @_collection: undefined
  @_type: undefined

  @new: (attributes) ->
    new @(attributes)

