Viorel wrote:
> I think it is a problem with your model. Tou should not have fields
> with calculated values, only a method that calculate the value, witch
> you call when you need that value

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 
attributes are total and tax of invoices that are calculated from the 
lines of the invoices) and the app have efficienty problems. I use this 
attributes for searching, doing statistics, calculate another 
values...so I have decided to store them in the database. Each time a 
line is created, modified or deleted the corresponding invoice is 
updated. What do you think about this implementation?
-- 
Posted via http://www.ruby-forum.com/.

-- 
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