Ruby on Rails Enumerated Column Constraints

This is an ROR extension to support enumerations in the database using the enum type in MySQL or column constraints in other databases. Currently only MySQL has been implemented, but other connection adapters can easily be extended to check for column constraints and then parse out the possible values.

This makes it very easy to implement and maintain controlled vocabularies in the database schema without having to change the validations and the view. I have made an effort to make the modifications without modifying the core classes, but I have not been extreamly successful. I have had to make some modifications that are version dependent and then put some exception handlers to make the backward compatible.

This is not the ideal solution and could cause some performance issues in the helpers. The core code still works with both 1.1 and 1.2 without modification. This is schedule to be incorporated into the core for the next major relese.

http://enum-column.rubyforge.org/

No comments

Powered by Blogger.