An open source ColdFusion framework
created in the spirit of Ruby on Rails.
created in the spirit of Ruby on Rails.
Our listing of steps to take while upgrading your Wheels application from 0.7 to 0.8.
The easiest way to upgrade is to setup an empty website, deploy a fresh copy of Wheels 0.8, and then transfer your application code to it. When transferring, please make note of the following changes and make the appropriate changes to your code.
Note: To accompany the newest 0.8.3 release, we've highlighted the changes that are affected by that release.
deletedOn, updatedOn, and createdOn are no longer available as auto-generated fields. Please change the names to deletedAt, updatedAt, and createdAt instead to get similar functionality, and make sure that they are of type datetime, timestamp, or equivalent.findById() is now called findByKey(). Additionally, its id argument is now named key instead. For composite keys, this argument will accept a comma-delimited list.findByKey() function, the found property is no longer available. Instead, we've adopted the "Rails way" of doing this, which involves the function throwing an error of type Wheels.RecordNotFound if the record was not found. Instead, use a cftry/cfcatch block to catch the error.errorsOn() function now always returns an array, even if there are no errors on the field. When there are errors for the field, the array elements will contain a struct with name, fieldName, and message elements.beforeValidation(), beforeValidationOnCreate(), etc.) that should be called from your model's init() method. These methods take a single argument: the method within your model that should be invoked during the callback event. See the chapter on
Object Callbacks for an example.linkTo(), the id argument is now called key. It now accepts a comma-delimited list in the case of composite keys.linkTo() function also accepts an object for the key argument, in which case it will automatically extract the keys from it for use in the hyperlink.linkTo() function can be used only for controller-, action-, and route-driven links now. The url argument has been removed, so now all static links should be coded using a standard <a> tag. At least one of the following arguments is required: controller, action, or route.SiteAdmin and the action is called editLayout, the URL to access that action would be http://www.domain.com/site-admin/edit-layout.[controller]/[action]/[id] to [controller]/[action]/[key]. This is to support composite keys. The params.id value will now only be available as params.key.
Comments
Read and submit questions, clarifications, and corrections about this chapter.
There are no comments for this chapter. Be the first to comment!