Upgrading to Wheels 1.0
Our listing of steps to take while upgrading your Wheels application from earlier versions to 1.0.
The easiest way to upgrade is to setup an empty website, deploy a fresh copy of Wheels 1.0, 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 1.0 release, we've highlighted the changes that are affected by that release.
Supported System Changes
- 1.0: URL rewriting with IIS 7 is now supported.
- 1.0: URL rewriting in a sub folder on Apache is now supported.
- ColdFusion 9 is now supported.
- Oracle 10g or later is now supported.
- PostgreSQL is now supported.
- Railo 3.1 is now supported.
File System Changes
- 1.0: There is now an app.cfm file in the config folder. Use it to set variables that you'd normally set in Application.cfc (i.e.,
this.name,this.sessionManagement,this.customTagPaths, etc.) - 1.0: There is now a
web.configfile in the root. - 1.0: There is now a Wheels.cfc file in the models folder.
- 1.0: The Wheels.cfc file in the controllers folder has been updated.
- 1.0: The IsapiRewrite4.ini and .htaccess files in the root have both been updated.
- 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.
Database Structure Changes
deletedOn,updatedOn, andcreatedOnare no longer available as auto-generated fields. Please change the names todeletedAt,updatedAt, andcreatedAtinstead to get similar functionality, and make sure that they are of typedatetime,timestamp, or equivalent.
CFML Code Changes
Config Code
- 1.0: The
actionof the default route (home) has changed towheels. - The way configuration settings are done has changed quite a bit. To change a Wheels application setting, use the new
set()function with the name of the Wheels property to change. (For example,<cfset set(dataSourceName="mydatasource")>.) To see a list of available Wheels settings, refer to the Configuration and Defaults chapter.
Model Code
- 1.0: The extends attribute in models/Model.cfc should now be
Wheels. findById()is now calledfindByKey(). Additionally, itsidargument is now namedkeyinstead. For composite keys, this argument will accept a comma-delimited list.- When using a model's
findByKey()orfindOne()functions, thefoundproperty is no longer available. Instead, the functions returnfalseif the record was not found. - 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 withname,fieldName, andmessageelements. - 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'sinit()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
- 1.0: The contents of the views/wheels folder have been changed.
- The
wrapLabelargument in form helpers is now replaced withlabelPlacement. Valid values forlabelPlacementarebefore,after, andaround. - The first argument for
includePartial()has changed fromnametopartial. If you're referring to it through a named argument, you'll need to replace all instances withpartial. - The variable that keeps a counter of the current record when using
includePartial()with a query has been renamed fromcurrentRowtocurrent. - There is now an included wheels view folder in views. Be sure to copy that into your existing Wheels application if you're upgrading.
- The location of the default layout has changed. It is now stored at /views/layout.cfm. Now controller-specific layouts are stored in their respective view folder as layout.cfm. For example, a custom layout for www.domain.com/about would be stored at /views/about/layout.cfm.
- In
linkTo(), theidargument is now calledkey. It now accepts a comma-delimited list in the case of composite keys. - The
linkTo()function also accepts an object for thekeyargument, in which case it will automatically extract the keys from it for use in the hyperlink. - The
linkTo()function can be used only for controller-, action-, and route-driven links now. Theurlargument has been removed, so now all static links should be coded using a standard<a>tag.
Controller Code
- 1.0: The extends attribute in controllers/Controller.cfc should now be
Wheels. - Multiple-word controllers and actions are now word-delimited by hyphens in the URL. For example, if your controller is called
SiteAdminand the action is callededitLayout, the URL to access that action would be http://www.domain.com/site-admin/edit-layout.
URL/Routing
- The default route for Wheels has changed from
[controller]/[action]/[id]to[controller]/[action]/[key]. This is to support composite keys. Theparams.idvalue will now only be available asparams.key. - 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).
« Previous Chapter
Installation
Installation
^ Top
Table of Contents
Table of Contents
Next Chapter »
Beginner Tutorial: Hello World
Beginner Tutorial: Hello World

Comments
Read and submit questions, clarifications, and corrections about this chapter.
[Add Comment]
Why not just use deleted, updated, and created instead of deletedAt, updatedAt, and createdAt?
# Posted by Chris Martinez | 9/22/2009
There used to be properties called deletedOn, updatedOn, and createdOn, which would only store the date, no time. I guess this naming convention is leftover from that, plus their Rails equivalents are deleted_at, updated_at, and created_at.
# Posted by Chris Peters | 9/22/2009