On Feb 12, 10:14 am, Matt Jones <[email protected]> wrote: > > This is actually more of a Rails problem than a Hobo problem - you're > overriding the accessor, so you'll need to do the lifting that AR > typically does (read_attribute). > > This should work > > def secret > �...@secret ||= read_attribute(:secret) || generate_random_password(3) > end > > --Matt Jones
Thanks to both Matt and Bryan! Works like a charm. I don't think I've seen the "||=" construct before, but I can see what its doing. I had completely forgotten about read_attribute(); duh-me. Thanks again! -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
