[LRUG] Query about ActiveRecord
David Salgado
david at digitalronin.com
Sat Aug 18 05:05:46 PDT 2007
Hi John
Sorry I'm late to the discussion, but couldn't you just do this?
class Cycle < ActiveRecord::Base
before_save :ensure_pattern_has_correct_length
private
def ensure_pattern_has_correct_length
self.pattern = some_padding_function( @pattern )
end
end
... or am I missing something?
Cheers
David
On 17/08/07, John Winters <john at sinodun.org.uk> wrote:
>
> Thanks to all - some very constructive pointers there.
>
> It's nice to find an environment where people understand the question,
> "What's the *right* way to do it?".
>
> Cheers,
> John
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20070818/564653bf/attachment-0003.html>
More information about the Chat
mailing list