Quantcast
Channel: Planet Apache
Viewing all articles
Browse latest Browse all 9364

Sam Ruby: Keeping it on the Rails

$
0
0

It is increasingly becoming the case that Agile Web Development with Rails is being actively co-developed with Rails itself.

While my tests have been an official part of the release process for a long time now, yesterday’s release of 3.2.3RC1 provides a number of examples that illustrate this.

Within hours after the release, I got an excited IM from Santiago Pastorino that my tests were failing.  In particular, the failure was thus:

rake db:migrate
rake aborted!
An error has occurred, this and all later migrations canceled:
uninitialized constant Arel::Relation
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

The root cause was quickly determined to be a recent change to arel, and a number of corrective actions were promptly taken: first, the change was backed out, then Rails 4.0 was updated and Rails 3.2 was changed to point to a branch of arel, and finally, the original change was reapplied.

The previous error that was caught was connection pool of new applications have size 1.  This demonstrates the unique value that my tests bring to the table.  Outside of my tests, the bulk of the test of Rails is an impressive array of unit tests (which verify that the connection pool setting does what it is supposed to do), and real world testing (using applications with highly tuned configurations), and my tests.  Only the latter is effectively testing that the defaults provided actually work together to provide a viable configuration to use as a starter set for new applications.

One last example, this one shows the level cooperation involved.  The underlying security changes that were the raison d'être for the 3.2.3 release caused the following scenario to fail:

rails generate scaffold Product title:string
rake db:migrate
rake test

The root cause was that the code generated as scaffolding used the very feature which is now being discouraged as it creates a security issue. The fix required both changes to Rails itself (to change the scaffolding generated) and to the scenario provided in the book (both in identifying the code that needs to be changed, and in the changes that need to be made).

The intent is to prove an updated to the eBook free of charge which incorporates the necessary changes, either concurrent with the final release of 3.2.3 or shortly thereafter.


Viewing all articles
Browse latest Browse all 9364

Trending Articles