Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Erik Peterson's latest activity

Tuesday, May 05 2009
750 Keeping track of validations with a hash was updated in Ruby on Rails
  • Erik Peterson
    Erik Peterson commented at 4:18 PM

    I hadn't been following up because there were a couple of projects out there to refactor Rails validations in a much more major way, and I didn't want to step o...

Monday, August 04 2008
750 Keeping track of validations with a hash was updated in Ruby on Rails
  • Erik Peterson
    Erik Peterson commented at 9:55 PM

    I had originally thought that keeping track of options would require a complete OO approach, with Validation objects and all sorts of nastiness that isn't real...

Sunday, August 03 2008
750 Patch: ActiveRecord#required_attributes was updated in Ruby on Rails
  • Erik Peterson
    Erik Peterson commented at 6:38 PM

    Sorry about that, apparently I can't read the formatting instructions:

    class Person < ActiveRecord::Base
      validates_uniqueness_of :name
      validates_presenc...
  • Erik Peterson
    • Tag changed from activerecord, enhancement, patch to activerecord, enhancement, patch, tested
    by Erik Peterson at 6:36 PM

    Ok, here's a patch that keeps track of validations in a hash of arrays. It is tested and documented.

    Usage:

  • Erik Peterson
    Erik Peterson commented at 3:23 PM

    +1 for the idea, but I'm not sure that I like this implementation.

    I think we generally need some way of looking at what validations are on a model. However,...