一个例子是:
class Person < ActiveRecord::Base def name=(name) super(name.capitalize) end def name super().downcase # not sure why you'd do this; this is just an example end end
但是它的运行不太对,是出了什么错吗?
相似问题