0
My env: ruby-1.9.2-preview3; rails-3.0.0.beta3

class PostFather < ActiveRecord::Base
  def self.inherited(subclass)
  end
end

class Post < PostFather
end

In the console:


> Post.new # => TypeError: can't dup NilClass
> Post.all # => TypeError: can't dup NilClass
> Post.scoped # => TypeError: can't dup NilClass

You can try it yourself;

Croplio
  • 3,433
  • 6
  • 31
  • 37

1 Answers1

1

ActiveRecord is using the inherited method, you need to call super so the ActiveRecord stuff still runs:

class PostFather < ActiveRecord::Base
  def self.inherited(subclass)
    super(subclass)
  end
end
jdeseno
  • 7,753
  • 1
  • 36
  • 34