Archive for September 20th, 2007

One more Rails project online

Thursday, September 20th, 2007

I have another project went live.

RightViewPro is a site for baseball fans, selling some pretty interesting baseball systems. The site is written completely in Rails, features rich admin interface, fully customizable thru admin panel, and features online shop with physical and downloadable products.

Cheers goes to WindUp Design team with whom I was working on the project.

Override :destroy parameter in acts_as_tree in Rails

Thursday, September 20th, 2007

I have made a little extension (just function redefinition, actually) to allow you to control the behaviour of :destroy parameter in acts_as_tree function in Rails. More info, and download file follows.

This extension redefines the default behaviour of acts_as_tree function
to allow you to override the :dependent option for your trees
The default value defined in Rails is :destroy, but sometime you might want to use
a different cascade delete logic, or don't use cascade deleted at all.

Usage:
1. put this file into /lib/active_record_ext/ folder inside your rails application
2. add the following string somewhere in the environment.rb file:
require 'active_record_ext/tree'

This fix implements patch submitted to Rails development site, but not yet implemented
in main trunk of Rails. More info available at this link.

This extension should work without problems on Rails 1.2x, but of course I can not be held responsible
for any damage/loss/etc it might cause.

Download the extension patch (2Kb)