Re: Calling a method on class creation

Adam Cohen
Fri, 24 Aug 2007 19:09:46 -0000

On 8/24/07, eggie5 <eggie5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
>
> THANKS! that''s the trick I was looking for. Now this reminds me of
an
> example from the essential rails book...
>
> So, it looks like status is called automatically when a new instance
> of the class is created?

does defining an after_initialize method not work for you?

by the way, your belongs_to method doesn''t need the :class_name or
:foreign_key specifications.. These can be inferred from the
association itself.

Adam