On 8 January 2011 09:19, Colin Law <[email protected]> wrote:

> Is there an expiry_date column in the database?

Yes there is.

> in the controller if that column exists.  However, if the expiry date
> is *always* +90 days then you should not put it in the database, but
> should provide an instance method in the model, something like
>
> def expiry_date
>  self.issue_date + 90.days
> end
>
> Then you can say durc.expiry_date and will always get issue date + 90
> days.  The method may have to be a little more complex if issue_date
> can ever be nil.

I have not thought about this, I have put curc_expiry_date in the
database, is it wrong?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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-talk?hl=en.

Reply via email to