Module: Sequel::Plugins::GenerateSlug
- Defined in:
- lib/sequel/plugins/generate_slug.rb
Overview
GenerateSlug plugin generates a unique slug based on the specified source and additional columns. The plugin is designed to work with the Sequel ORM.
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Class Method Summary collapse
-
.configure(model, opts = {}) ⇒ Object
Configure the plugin with the given options.
Class Method Details
.configure(model, opts = {}) ⇒ Object
Configure the plugin with the given options.
32 33 34 35 36 37 38 |
# File 'lib/sequel/plugins/generate_slug.rb', line 32 def self.configure(model, opts = {}) model.instance_exec do @slug_column = opts[:column] || :slug @source_column = opts[:source] || :title @additional_column = opts[:additional] || :identifier end end |