Re: Re: question about before_create

Denny Reiter
Thu, 27 Oct 2005 16:37:27 -0000

On Thu, Oct 27, 2005 at 04:17:37AM +1000, Mark Reginald James
wrote:
> You got nil monitor_end because you''re trying to assign a day
count
> to an attribute of class Date.
>
> I''d recommend adding to the class an attr_reader called
> monitor_end_num_days,
> then using this both as the method parameter in the appropriate form
helpers
> and to set the monitor_end attribute value in before_create.
>
> Or this may work:
> monitor_end = monitor_start + monitor_end_before_type_cast.to_i
> (Let me know if it does.)

That does indeed work.  Thank You!

I agree with your recommendation, though of using the attr_accessor,
it will be much more understandable.

Thanks again,

Denny Reiter

--
Denny Reiter
denny-wJvvXGulOwdAfugRpC6u6w@public.gmane.org
            Yes, I''ve heard of "decaf." What''s your
point?