Empty namespace that plugins should use to store themselves, so they can be loaded via Model.plugin.
Plugins should be modules with one of the following conditions:
Add method to mod that overrides set_dataset to call the method afterward.
# File lib/sequel/model/plugins.rb, line 43 43: def self.after_set_dataset(mod, meth) 44: mod.send(:define_method, :set_dataset) do |*a| 45: r = super(*a) 46: send(meth) 47: r 48: end 49: end
In the given module mod, define methods that are call the same method on the dataset. This is designed for plugins to define dataset methods inside ClassMethods that call the implementations in DatasetMethods.
# File lib/sequel/model/plugins.rb, line 28 28: def self.def_dataset_methods(mod, meths) 29: Array(meths).each do |meth| 30: mod.class_eval("def #{meth}(*args, &block); dataset.#{meth}(*args, &block) end", __FILE__, __LINE__) 31: end 32: end
Add method to mod that overrides inherited_instance_variables to include the values in this hash.
# File lib/sequel/model/plugins.rb, line 36 36: def self.inherited_instance_variables(mod, hash) 37: mod.send(:define_method, :inherited_instance_variables) do || 38: super().merge!(hash) 39: end 40: end