class A
def self.a
puts "self: #{self}; superclass: #{superclass}"
end
end
class B < A
class << self; undef_method(:a); end # I'm not allowed to use B.a
def self.b
# h
我是新来的ActiveRecord的新查询接口,所以我仍然搞清楚事情。 我希望有人能解释ActiveRecord模型使用scope和只使用一个类的方法之间的差异(即self.some_method) 据我所知,相当的范围总是期望返回的关系,而类方法不一定非得。这是真的? 举例来说,我认为这将是有意义的做一些事情,如: class Person
scope :grouped_counts,