> OP, what do you want - Robert's solution or Robert's solution? :-)
> 
> Kind regards
> 
>   robert
Thanks RobertS!
Now I'm pretty sure that people tend to using the programming languages 
that has the same character with their names, like Roberts will pick up 
Ruby while Johns prefer Java.

Robert Dober's solution offer me details on how to write the codes about 
defining those methods. It will be very useful, but still I have no idea 
where to put these definitions.
Robert's solution(yes, that's Robert Klemme) needs to be adjusted to fit 
my requirement correctlly. But it's very interesting. Robert, Can you 
tell me how to make setup_methods :apple can be called inside a class, 
like:

#magic codes put here, then
Class Fruit < ActiveRecord::Base
# create all the methods on the fly
setup_methods :apple
setup_methods :banana
....
# call methods that are created on the fly inside a class
after_save :save_apple
after_save :save_banana
end

That is, please tell me how to mixin.



-- 
Posted via http://www.ruby-forum.com/.