Permalink
Browse files

Added 1.5 details to CHANGELOG.

git-svn-id: https://svn.thoughtbot.com/jester/trunk@113 d7758119-aa2c-0410-afcd-b700fbd0d0b3
  • Loading branch information...
1 parent 6bf5006 commit 3b1cbe56bb19c0355362df7b40003d06a4bafec6 emill committed Oct 25, 2007
Showing with 58 additions and 8 deletions.
  1. +58 −8 CHANGELOG
View
@@ -1,23 +1,73 @@
-Version 1.4
+==========================
+Version 1.5 (October 25th)
+==========================
-
- * Support for Twitter-style JSON callbacks, allowing read-only remote site support for sites which offer this. This method does not use Prototype or AJAX, but inserts a <script> tag. Thus, find() calls *must* be made asynchronously, and *only* submitting a function as a callback argument (instead of a Prototype options hash). Example:
+ Release post:
+ http://giantrobots.thoughtbot.com/2007/10/25/jester-1-5-universal-rest
+
+ NOTICE: This release is not backwards compatible with earlier versions.
+
+ * Total rewrite of the object hierarchy and Resource.model function.
+ Objects returned from User.find(1) are now instances of the User class, not Base.
+
+ * Renamed Base to Resource. If "Resource" still conflicts with other libraries you are working with, you can refer to it as Jester.Resource.
+
+ * Support for Twitter-style JSON callbacks (aka "JSONP"), allowing read-only remote site support for sites which offer this. This method does not use Prototype or AJAX, but inserts a <script> tag. Thus, find() calls *must* be made asynchronously, and *only* submitting a function as a callback argument (instead of a Prototype options hash). Example:
- User.find(1, {}, function(user) { ... })
+ Resource.model("User", {
+ format: "json",
+ prefix: "http://externaldomain.com"
+ })
+ // fetches http://externaldomain.com/users/1.xml?json=jesterCallback and calls myCallback with the loaded User
+ User.find(1, myCallback)
- Objects returned can be modified, but save(), destroy(), create(), and updateAttributes() will all return false.
+ Objects returned can be modified, but save(), destroy(), create(), and updateAttributes() will all return false, as no POSTs can be made.
* Basic path prefixes are supported, using ActiveResource syntax to denote prefix options. Values for these options can be mixed in with the parameters hash argument of a find() call. For example, to find all posts by the User with ID 1, at /users/1/posts.xml:
- Base.model("Post", {prefix: "/users/:user_id"})
+ Resource.model("Post", {prefix: "/users/:user_id"})
// request to /users/1/posts.xml
posts = Post.find("all", {user_id: 1})
// request to /users/1/posts.xml?key=value
posts = Post.find("all", {user_id: 1, key: value})
-
-
+
+ * All API URLs for a model can be accessed individually.
+ Accepted URLs are: show, list, new, create, update, index, destroy.
+ URLs for "show", "list", and "new" will be set by default based on the model name.
+ "create" and "index" will default to the value set for "list".
+ "destroy" and "update" will default to the value set for "show".
+ If needed, each URL can be accessed through a helper method of the style "_show_url()". It can be called on either the class or the instance, and will interpolate a hash of arguments. Example:
+
+ User._show_url() => "http://domain.com/users/:id.xml"
+ User._show_url(1) => "http://domain.com/users/1.xml"
+ User.find(1)._show_url({admin: true}) => "http://domain.com/users/1.xml?admin=true"
+
+ * All API URLs for a model can be customized individually. For example, a Twitter model customized to Twitter's non-standard API:
+
+ Resource.model("Twitter", {
+ format: "json",
+ prefix: "http://twitter.com",
+ urls: {
+ show: "/statuses/show/:id.json",
+ list: "/statuses/user_timeline/:username.json"
+ }
+ })
+ // request to load http://twitter.com/statuses/user_timeline/jesterjs.json?callback=jesterCallback
+ // and call myCallback with the array of Twitter objects
+ Twitter.find("all", {username: "jesterjs"}, myCallback)
+
+ * If your controller supports the "new" action, to provide an object skeleton, you can instruct the model to fetch this skeleton. It will be fetched once, when the resource is modeled. This replaces the old method, where the checkNew argument was passed on each call to build, which was silly. Example:
+
+ Resource.model("User", {checkNew: true})
+
+ This operation is (now) asynchronous by default, "checkNew" is still a silly name for the option, I'm open to better ideas.
+
+ * Some littler things:
+ - For JSON requests, autotransform any field ending in "_at" or "_on" into a date (not just created/updated_at/on).
+ - Only instantiate ObjTree if a model is defined that uses the XML format.
+ - Various bugfixes, including major one where CamelCased models names weren't handled correctly.
========================
Version 1.3 (June 10th)

0 comments on commit 3b1cbe5

Please sign in to comment.