Hi, I was trying to create an abstract class and a subclass which
inherit that abstract class.
However, seems like I cannot instantiate the subclass too. Below is my
class Abstractclass2 < ActiveRecord::Base
self.abstract_class = true
class Subclass < Abstractclass2
When I test drive it in rails console, I got the following error:
from (irb):1irb(main):002:0> sb = Subclass.new
ActiveRecord::StatementInvalid: Could not find table ‘subclasses’
table_structure' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.3/lib/active_record/connection_adapters/sqlite_adapter.rb:322:incolumns’
If I take out “self.abstract_class”, everything works fine (subclass
object is inserted into abstractclass table but abstractclass can be
instantiated --> that’s not what I want to…)
Did I miss something here so that I cannot instantiate the subclass?