Module: Dcmgr::Models::InheritableSchema

Defined in:
lib/dcmgr/models/base_new.rb

Overview

Sequel::Model plugin extends :schema plugin to merge the column definitions in its parent class.

class Model1 < Sequel::Model

plugin InheritableSchema

inheritable_schema do
  String :col1
end

end

class Model2 < Model1

inheritable_schema do
  String :col2
end

end

Model2.create_table!

Then the schema for Model2 becomes as follows:

primary_key :id, :type=>Integer, :unsigned=>true
String :col1
String :col2

Defined Under Namespace

Modules: ClassMethods