   # @return [Object] the error object for the attribute
   forAttribute: (attribute) ->
     ActiveResource::Collection.build(@__errors[attribute]).inject {}, (out, error) ->
-      out[error.code] = error.detail
+      out[error.code] = error.message
       out
 
   # Returns the error object for base

  # @return [Object] the error object created and added to storage
  add: (attribute, code, detail = '') ->
    @__errors[attribute] ||= []
    @__errors[attribute].push(error = { code: code, detail: detail })
    error

  # Indicates whether or not the errors object is empty
  #
  # @return [Boolean] whether or not the errors object is empty
  empty: ->
    empty = true
    for k,v of @__errors
      empty = empty && !v.length
    empty

  # Returns the error object for an attribute
  #

  # @return [Object] the error object for base
  forBase: ->
    @forAttribute('base')

  # Converts the errors object to an array of errors
  #
  # @return [Array] the errors object converted to an array of errors
  toArray: ->
    output = []
    for attribute, errors of @__errors
      output.push errors...

    output

  # Convert the errors object to a collection of errors
  #
  # @return [Collection] the errors object converted to a collection of errors
  toCollection: ->
    ActiveResource::Collection.build(@toArray())
