module Sequel::Plugins::SingleTableInheritance::InstanceMethods
Public Instance Methods
Source
# File lib/sequel/plugins/single_table_inheritance.rb 265 def before_validation 266 if new? && model.sti_key && !self[model.sti_key] 267 set_column_value("#{model.sti_key}=", model.sti_key_chooser.call(self)) 268 end 269 super 270 end
Set the sti_key column based on the sti_key_map.
Calls superclass method
Private Instance Methods
Source
# File lib/sequel/plugins/single_table_inheritance.rb 275 def _filter_tactical_eager_load_objects(opts) 276 objects = defined?(super) ? super : retrieved_with.dup 277 name = opts[:name] 278 objects.select!{|x| x.model.association_reflections.include?(name)} 279 objects 280 end
Limit tactical eager loading objects to objects that support the same association.
Calls superclass method
Source
# File lib/sequel/plugins/single_table_inheritance.rb 283 def use_prepared_statements_for?(type) 284 false 285 end
Don’t allow use of prepared statements.