我有以下两个类
class A
def serializable_hash(options)
super(options).tap do |json|
json.delete_if{|k,v| v.nil?}.as_json
end
end
end
和
class B < A
end
当对象B被序列化时,不会调用“serializable_hash”... 如果我在B中实现相同的方法,则调用它。 我错过了什么?