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.

Jamie Hill's latest activity

Wednesday, January 06 2010
3058 [PATCH] Sexy Validations was updated in Ruby on Rails
  • Jamie Hill
    Jamie Hill commented at 8:00 PM

    Right, think we're there. Attached is new patch which instead of referencing columns, validates_with looks to see if a setter instance method is already availab...

Tuesday, January 05 2010
3058 [PATCH] Sexy Validations was updated in Ruby on Rails
  • Jamie Hill
    Jamie Hill commented at 11:59 PM

    Leave it with me and I'll try a few options.

  • Jamie Hill
    Jamie Hill commented at 11:57 PM

    All I have done is move that logic from the validates_acceptance_of method which it should really be in either. As mentionned above I don't thing validations sh...

  • Jamie Hill
    Jamie Hill commented at 10:50 AM

    Just noticed an error when running on 1.8.7, attaching new patch file.

  • Jamie Hill
    Jamie Hill commented at 9:49 AM

    I am attaching a new diff of what I believe to be an elegant solution to the whole attr_accessor problem.

    I have moved the remaining logic into Validator classe...

Sunday, January 03 2010
3058 [PATCH] Sexy Validations was updated in Ruby on Rails
  • Jamie Hill
    Jamie Hill commented at 5:56 PM

    Sorry, that first code snippet was wrong, should be:

     %w(presence length numericality etc).each do |validation|
        define_method "validates_#{validation}_of",...
  • Jamie Hill
    Jamie Hill commented at 5:54 PM

    I see what you mean about the attr_accessor. I think ideally that validations shouldn't magically add methods to the model and instead you should be expected to...

  • Jamie Hill
    Jamie Hill commented at 4:06 PM

    Agreed on the Validator abstract class, I couldn't initially see a use for it but may be useful in some circumstances.

    As for the entry point being via the vali...

  • Jamie Hill
    Jamie Hill commented at 4:01 AM

    Great news, thanks for your help on this.

    I am attaching a new patch that address your concerns by working by convention as suggested by Josh. I have also publi...

Saturday, December 05 2009
2346 named_scope doesn't override default_scope's :order key was updated in Ruby on Rails
  • Jamie Hill
    • Tag changed from 2.3, activerecord, bug, default_scope, named_scope, patch, verified to 2.3, 2.3.5, activerecord, bug, default_scope, named_scope, patch, verified
    by Jamie Hill at 2:25 PM

    Sorry to resurrect an old ticket but this is definitely still an issue, default_scope becomes pretty much unusable without being able to override the :order etc...