> If you want the equivalent of after_initialize, wouldn't you want to
> do_stuff after calling super?  In any case, if you're feeling funky,
> you can do:
>
> def initialize(attrs = {}, &block)
>   attrs[:funky_default] ||= 'my funky default'
>   super
> end
>
> But I much prefer:
>
> def initialize(attrs = {}, &block)
>   super
>   self.funky_default ||= 'my funky default'
> end

Sorry, that's what I meant, if you do stuff before @attributes is
initialized you'll get some nasty surprises.  Without cases which
can't be solved by this pattern, I'm not sure that adding a new
callback is justified.


-- 
Cheers

Koz

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to