> Why can't my model have calculated values? Right know, my problem is
> that I have a lot of virtual attributes in order to calculate these
> values when I need them. I use this attributes a lot (the virtual

It is a long discussion, but it is a basic principle of any RDBMS. It
is about efficiency also.
Just think about it.

> Each time a line is created, modified or deleted the corresponding invoice is
>updated.

So, this calculations  are made anyway, even if you don't need the
values. Plus, you need to be very sure that the value is updated every
time it need to be and that can be very complicated. I don't think
that the efficiency problem' ppears because too many virtual fields.
It is your decision, but i still say : Don't put calculated values in
the database.

-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to