Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
86 lines (57 sloc) 4.17 KB



  • If defined, include jQuery.ajaxSetup data in REST parameters. [Ismael Celis]


  • Finder methods now return undefined for a missing model.
  • Remove #update method which you might guess acts like ActiveRecord's #update_attributes which is not the case - no calls are triggered on the persistence adapter.
  • Model.RestPersistence renamed to Model.REST - Model.RestPersistence can still be used but will be removed in version 1.0.
  • REST adapter now sends JSON instead of "application/x-www-form-urlencoded" (and so now requires the browser to be JSON-aware).
  • Add reverse class method.
  • Add Model.VERSION to allow inspection of js-model version.
  • Add Model.localStorage persistence adapter.
  • Stop jQuery's JSON parsing throwing an error when encountering Rails' none-empty " " JSON responses.
  • Remove Underscore dependency.
  • Model.remove method now takes a model instance rather than an id.
  • Rename sort to sortBy and add the ability to specify an attribute name as well as a custom function. Add sort method that acts on a collection just like Array#sort.
  • Add pluck method that takes an attribute name and returns an array of values.
  • Fix for callbacks being wrongly called on multiple instances - they were being stored on the prototype and thus being shared across instances. Thanks to Oliver Nightingale for identifying the bug and writing a test case.


  • Add named parameters to Model.RestPersistence so "/categories/:category_id/posts" will pick up the corresponding category_id attribute from your model and be converted to "/categories/2/posts". [Russell Jones]


  • Fix that find, first, last and detect return null 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 use dataType "json" removing the need to set a global beforeSend. [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 successful save (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 to Model.Collection.
  • Collection methods now access the collection through the all method so that select, 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 separate merge 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 from changes.
  • errors array shouldn't have to be manually reset when implementing validate.


  • First tagged release.
Jump to Line
Something went wrong with that request. Please try again.