Open nlgcat opened 8 years ago
change Test::Parent(:test_children) to Test::Parent
http://sequel.jeremyevans.net/rdoc-plugins/classes/Sequel/Plugins/ClassTableInheritance.html
# Specifying the tables with a :table_map hash
Employee.plugin :class_table_inheritance,
:table_map=>{:Employee => :employees,
:Staff => :staff,
:Cook => :staff,
:Manager => :managers,
:Executive => :executives,
:CEO => :executives }
Many thanks for the reply.
edit: Never mind the further question if you had seen it, I had a typo
I have managed to set up CTI as per the instructions on this repo, along with the separate rails-generators. I am now trying to create classes within their own Module, such as you can do with ActiveRecord.
When I try the below however I get an error on the child although the parent works:
Output from running rake db:seed (a call to Parent.create, then a call to a separate Child.create)
The various code snippets are shown below. Is it possible to do this with sequel-rails or is it currently unsupported? The Child class does not seem to be able to find the parent class when declared in this way.
Many thanks.
Code Snippets:
create_test_parents.rb
create_test_children.rb
app/models/test/parent.rb
app/model/test/child.rb
db/seeds.rb