To view this screencast, add it to
your cart
and
checkout.
You can buy this screencast for any price, including FREE!
Does your Rails application have lots of little tables for keeping track of things like genders, states, colors or other enum-like data?
Way back when, when I was learning database development, a mentor of mine showed me a technique that he liked to use to consolidate similar enum-esque database tables (tables with just an ID and a string).
Introducing AuxCodes
AuxCodes is an ActiveRecord-based gem that makes it easy to store enum-like data in your applications. It gives you …
- a way to maintain all of this data in a YAML file
- auto-generated ActiveRecord classes for these categories, eg.
GenderorColor - a simple DSL for accessing your enum data, eg.
Gender.female - a way to store additional meta data for any of your categories’ codes, eg.
Gender.female.abbreviation
see http://github.com/remi/aux_codes or watch the screencast!
checkout AuxCodes on Rails for part II of the screencast & for howto use AuxCodes in your Rails applications.
aux_codes inspired by Walter Turner