Displaying 1 result from an estimated 1 matches for "calculated_value".
2006 Mar 14
7
Overriding new or create for a model
...e. It seems to me that I should do this in the model code
and that I should override the new and/or create methods.
Is this the right approach and, if so, how can I execute the existing
method but add on my calculation?
I want something like:
def create
-Do the original create first-
field = calculated_value
save
self
end
How do I call the original create method and use the parameters passed?
Also, should I be overriding new or create or both?
Thanks for any help.
Julian
--
Posted via http://www.ruby-forum.com/.