module Sequel::Plugins::ClassTableInheritance::ClassMethods
Attributes
An array of columns that may be duplicated in sub-classes. The primary key column is always allowed to be duplicated
The dataset that table instance datasets are based on. Used for database modifications
An array of each model in the inheritance hierarchy that is backed by a new table.
A boolean indicating whether or not to automatically qualify tables backing subclasses with the same qualifier as their superclass, if the superclass is qualified. Specified with the :qualify_tables option to the plugin and only applied to automatically determined table names (not to the :table_map option).
An array of column symbols for the backing database table, giving the columns to update in each backing database table.
A hash with class name symbol keys and table name symbol values. Specified with the :table_map option to the plugin, and should be used if the implicit naming is incorrect.
An array of table symbols that back this model. The first is table symbol for the base model, and the last is the current model table symbol.
Public Instance Methods
The name of the most recently joined table.
# File lib/sequel/plugins/class_table_inheritance.rb 291 def cti_table_name 292 cti_tables.last 293 end
Freeze CTI information when freezing model class.
# File lib/sequel/plugins/class_table_inheritance.rb 269 def freeze 270 @cti_models.freeze 271 @cti_tables.freeze 272 @cti_table_columns.freeze 273 @cti_table_map.freeze 274 @cti_ignore_subclass_columns.freeze 275 276 super 277 end
The model class for the given key value.
# File lib/sequel/plugins/class_table_inheritance.rb 296 def sti_class_from_key(key) 297 sti_class(sti_model_map[key]) 298 end
The table name for the current model class’s main table.
# File lib/sequel/plugins/class_table_inheritance.rb 282 def table_name 283 if cti_tables && cti_tables.length > 1 284 @cti_alias 285 else 286 super 287 end 288 end