Upgrading to Wheels 0.8

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.

Supported System Changes

  • Oracle 10g or later is now supported.
  • 0.8.3: Railo Express 3.0 is now supported.

File System Changes

  • The controller folder has been changed to controllers.
  • The model folder has been changed to models.
  • The view folder has been changed to views.
  • Rename all of your CFCs in models and controllers to UpperCamelCase. So controller.cfc will become Controller.cfc, adminUser.cfc will become AdminUser.cfc, and so on.
  • All images must now be stored in the images folder, files in the files folder, JavaScript files in the javascripts folder, and CSS files in the stylesheets folder off of the root. (In 0.7, you were able to specify the paths yourself.)

Database Structure Changes

  • 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.

CFML Code Changes

Config Code

  • 0.8.3: There have been a few lines added to and removed from the files stored in the config folder. We recommend copying any unique settings that you have from your old copy to the new Wheels config files.

Model Code

  • 0.8.3: A model file is now optional if you don't need to associate it with other models or add any additional business logic.
  • 0.8.3: 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.
  • When using a model's 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.
  • A model's 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.
  • The way callbacks are created has changed. There is now a method for each callback event (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.

View Code

  • 0.8.3: In linkTo(), the id argument is now called key. It now accepts a comma-delimited list in the case of composite keys.
  • 0.8.3: The 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.
  • 0.8.3: The 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.

Controller Code

  • 0.8.3: Multiple-word controllers and actions are now word-delimited by hyphens in the URL. For example, if your controller is called SiteAdmin and the action is called editLayout, the URL to access that action would be http://www.domain.com/site-admin/edit-layout.

URL/Routing

  • 0.8.3: The default route for Wheels has changed from [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.
  • 0.8.3: You can now pass along composite keys in the URL. Delimit multiple keys with a comma. (If you want to use this feature, then you can't have a comma in the key value itself).

Comments

Read and submit questions, clarifications, and corrections about this chapter.

There are no comments for this chapter. Be the first to comment!

Add Comment

Type the two words: