- Fix that
find
,first
,last
anddetect
returnnull
when nothing is found. - Add
unbind
method to unbind all callbacks for a particular event or a specific callback by passing a reference to the original function. - Move callback functionality into a separate module and mix-in to class and instance.
- Don't log an error when Rails returns a response of " " for a
head :ok
response. jQuery.ajax
should usedataType
"json" removing the need to set a globalbeforeSend
. [Jason Lee]
- Fix that custom class methods should be available after chaining.
- Move model collection methods into a separate object allowing you to customise the defaults in a single place.
- Move model instance methods into a separate object. This allows you to redefine the defaults once rather than having to pass the same custom method to multiple models at declaration time.
- Defining a model now takes three arguments: name, class methods, instance methods.
- Fix callbacks in IE.
- Fix broken Ajax tests in IE6 and IE7.
Model.RestPersistence
now recognises a 422 response as validation failure and populates the model's errors object with the response data.Model.errors
is now an object and has a similar interface to ActiveModel.- Fix that
changes
should only be merged after a successfulsave
(create/update). - Calling Model#attr() with no arguments returns a combined object of attributes/changes.
- Fix that
Model.RestPersistence
Ajax failures should correctly run the supplied callback. - Add
count
method toModel.Collection
. - Collection methods now access the collection through the
all
method so thatselect
,each
, etc work as expected if it's overwritten.
- Events are now bound directly to a model rather than using jQuery
bind
. Collections also now have the concept of events with "add" and "remove" built-in.
update
should trigger "update" event, add separatemerge
method.- Fix that persistence failure should not trigger corresponding event.
- Pass only a single callback to save/destroy which is called with a boolean to indicate success/failure.
- Bundle release into a single, versioned Javascript file plus minified version.
- Change behaviour of
Model.Collection
and don't let duplicates (scoped by id) of the same model to be stored. [Laurie Young]
- Fix that setting a null value with
attr
should be read back correctly fromchanges
. errors
array shouldn't have to be manuallyreset
when implementingvalidate
.
- First tagged release.