class

FriendlyId::Slug

Inherits DB::Mappable < DB::Serializable < Reference < Object

Constructors

new(slug : String, sluggable_id : Int64, sluggable_type : String, created_at : Time = Time.utc)
Source

Class methods

create!(slug : String, sluggable_id : Int64, sluggable_type : String) : Bool

Create a new slug record

Source
find_by_slug(slug : String) : FriendlyId::Slug | Nil

Find a slug by its value

Source
from_rs(rs : DB::ResultSet)
Source
normalize(str : String, separator : String = "-", preserve_case : Bool = false, locale : String | Nil = nil) : String

Generate a normalized slug using the new SlugGenerator

Source
where(conditions) : Array(Slug)

Retrieve slugs based on conditions

Source

Instance methods

created_at
Source
created_at=(created_at : Time)
Source
id=(id : Int64 | Nil)
Source
slug
Source
slug=(slug : String)
Source
sluggable_id
Source
sluggable_id=(sluggable_id : Int64)
Source
sluggable_type
Source
sluggable_type=(sluggable_type : String)
Source