Sequel Hybrid Table Inheritance
Ruby Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib/sequel/plugins
spec
.gitignore
Gemfile
LICENSE.txt
README.rdoc
Rakefile
sequel-table_inheritance.gemspec

README.rdoc

NOT MAINTAINED

The functionality of this plugin was integrated into Sequel 4.24. Use that instead.

Sequel Hybrid Table Inheritance

This is a sequel plugin that combines the functionality of the single and class table inheritance plugins. This plugin uses the single_table_inheritance plugin and should work as a drop in replacement for the class_table_inheritance plugin. This allows using new tables for subclasses only when need for additional columns or possibly referential integrity to exclusively subclassed rows.

Additional features over the class table inheritance plugin

For class table inheritance use this provides additional functionality beyond the standard class_table_inheritance plugin including the following:

  • Eager loading in addition to lazy loading of subclasses.

  • Use RETURNING * on insert if available avoiding a select query after new model saves

  • Features found in the single_table_inheritance not in class_table_inheritance Notably the key_map, key_chooser options and accepting a proc in addition to a hash for model_map option

Using sequel-table_inheritance

Include the sequel-hybrid_table gem in your Gemfile

gem "sequel-table_inheritance"

run “bundle install” if needed

The hybrid_table_inheritance plugin should now work like any other sequel plugin. You should be able to use in place of the class_table_inheritance plugin.

Full documentation available at www.rubydoc.info/gems/sequel-table_inheritance/Sequel/Plugins/HybridTableInheritance