Bruce Tate on Rails Migrations

Posted by Daniel Butler Thu, 17 Aug 2006 14:41:00 GMT

Bruce Tate, a Java book author and Ruby on Rails advocate, discusses the advantages of Ruby on Rails database migration strategy, and concludes:

The migrations story in Java programming is not nearly as robust. Some products have spot solutions for some of the schema migrations problems, but without a systemic process for coordinating schema changes -- both up and down -- dealing with changes in the data and object model can be a difficult task. The Rails solution has some core advantages:

  • Rails migrations are DRY (don't repeat yourself). With Rails, you specify each column definition exactly once: in the migration. Some other mappers force you to specify a column six times: in the schema, the getter, the setter, the model's instance variable, the "from" mapping, and the "to" mapping.
  • Rails migrations allow data migration as well as schema migration.
  • Rails migrations let you use model logic with your data migration where SQL scripts don't.
  • Rails migrations are database independent, but SQL scripts aren't.
  • Rails migrations allow direct SQL for unsupported extensions (such as stored procedures or constraints), while some ORM mappers don't.

With all of the benefits of migrations, you'd expect a complex piece of code, but they are incredibly simple. Migrations have meaningful names and version numbers. Each migration, has an up and down method. Finally, a rake task coordinates running them in the correct order. This simple strategy is also revolutionary. The idea of expressing each schema change not in the model but as a distinct migration is both elegant and effective. Coordinating both data and schema changes is another paradigm shift, and an effective one. Best of all, these ideas are completely language agnostic. If you're building a new Java wrapping framework, you'd do well to consider migrations.

I personally take full advantage of migrations during development and maintenance of Ruby on Rails, and they have forever solved the chicken-and-egg data, code, and schema synchronization problem which made moving from development to production a unweildy and error-prone process in the past. It's also important to have a histor of the schema changes over time so that if a problem arises, you can track back to the exact change and schema migration which caused it.

Crossing Borders: Rails Migrations Article
Understanding Migrations @ Rails Wiki

Posted in  | no comments

New Rails Security Mailing List

Posted by Daniel Butler Fri, 11 Aug 2006 01:01:00 GMT

If you're running any Rails installations in production, do yourself a favor and sign up to the Rails-Security mailing list. DHH says:

In light of the past days of fun and games, we’ve started a new mailing list focused entirely around security. This list will be much lower volume than the main list and be exclusively about security concerns. You can signup at the rails-security mailing list page.

You'll only receive announcements about Rails security, not discussion, so it won't be too painful when something like this happens again.

David's Blog Entry
Rails-Security Mailing List Signup Page

Posted in  | Tags  | no comments

Typo 4.0.1 Released

Posted by Daniel Butler Thu, 10 Aug 2006 11:04:00 GMT

Scott Laird has released version 4.0.1 of Typo, the premiere blogging application written in Ruby on Rails. This release includes Rails 1.1.5, which fixes substantial security problems, and everyone is encouraged to upgrade.

The new installer script has several changes, according to Scott:

  • It has been spun off into its own .gem and lives in its own source repository, so other projects can use it as well.
  • It now supports Postgres as well as SQLite3. I’ll write about this soon.
  • It performs database-agnostic backups to a .yml file.
  • A number of bugs have been squashed.

Thanks for all the hard work!

Scott's Blog Annoucement
Typo 4.0.1 @ RubyForge
Download Page @ TypoSphere

Posted in  | no comments

Upgrade your old Rails installations ... Now!

Posted by Daniel Butler Wed, 09 Aug 2006 22:59:00 GMT

DHH has decreed:

This is a MANDATORY upgrade for anyone not running on a very recent edge (which isn’t affected by this). If you have a public Rails site, you MUST upgrade to Rails 1.1.5. The security issue is severe and you do not want to be caught unpatched.

The issue is in fact of such a criticality that we’re not going to dig into the specifics. No need to arm would-be assailents.

So upgrade today, not tomorrow. We’ve made sure that Rails 1.1.5 is fully drop-in compatible with 1.1.4. It only includes a handful of bug fixes and no new features.

So, if this blog goes down in the next few minutes for a nick, that's bloody well why.

Posted in  | 1 comment

Better Scaffolding with Ruby on Rails: dry_scaffold

Posted by Daniel Butler Wed, 09 Aug 2006 14:07:00 GMT

Ed Moss loves the DRY principle enough that he's posted a Rails engine that attempts to prevent code duplication across model, views, and controllers that allow data editing.

The engine includes support for parent-child relationships, sorting, filtering, in-context editing, as well as being completely customizable. Take a look:

The engine looks great and is easy to use. Thanks, Ed!

dry_scaffold Page @ Rubyforge
Download Plugin from Rubyforge
DRY Rails Engine Plugin Demo

Posted in  | no comments

Yet Another Ruby on Rails IDE: RideMe

Posted by Daniel Butler Mon, 07 Aug 2006 21:23:00 GMT

While nothing can really compare to TextMate on OS X for its simplicity and natural flexibility, Windows users have yet another Ruby on Rails IDE to satiate your need of file drawers, tab completions, and that debilitating syntax-highlighting addiction: RideMe. Jeff Cohen declared version 1.0 as indulging you in the following ways:

  • 100% free, open source, and not built on top of anything else. You just need Ruby 1.8.2 and .NET 2.0 installed.
  • Mission in life is to be lightweight and very fast. This is not a general purpose Ruby editor, it's an IDE for getting your Rails work done.
  • File-system based approach. No messy workspace files or extra RIDE-ME specifics junking up your directory.
  • Syntax highlighting for Ruby Files, Views, Layouts, JavaScript, SQL, CSS, and HTML.
  • Familiar Visual Studio-style tabbed document editor.
  • Model / Member drop downs for easy movability in code. (Think Visual Studio above your code file)
  • Code folding for Ruby files
  • script/console built into the IDE (think Visual Studio "Immediate Mode")
  • Server Error notification (template errors will actually open the view file and go to the LOC)
  • Internal web browser (optional)

Project RideMe
Download Installer: RideMe.Setup.msi

Posted in , ,  | Tags  | 2 comments

Integrated DHTML Menus in Ruby on Rails

Posted by Daniel Butler Tue, 01 Aug 2006 13:20:00 GMT

Max Muermann has annouced the release of the MenuEngine Rails engine. He writes, "MenuEngine is a small Rails engine that can generate templated drop-down DHTML menus commonly used for web site navigation. Supports creation of menus from a YAML file, from code and from pre-configured HTML. Optionally integrates with UserEngine for authorization."

An interesting feature is that, "If your application uses UserEngine for authorization, MenuEngine will optionally use the permissions for the current user to conditionally display only the menu items that link to controller/action pairs that the current user is authorized to use."

MenuEngine Home Page
RubyForge Project Page
Rails Plugins Directory Entry

Posted in  | Tags  | no comments

Older posts: 1 2 3 4 5 ... 8