Sha256: d9312010525d28009f2751cb9167efd57bef47d64c63803a80da44c2f88c1580

Contents?: true

Size: 467 Bytes

Versions: 22

Compression:

Stored size: 467 Bytes

Contents

# frozen_string_literal: true

module Thredded
  class Category < ActiveRecord::Base
    extend FriendlyId
    belongs_to :messageboard
    has_many :topic_categories
    has_many :topics, through: :topic_categories
    friendly_id :name, use: %i[history scoped], scope: :messageboard

    validates :name, presence: true
    validates :messageboard_id, presence: true

    def normalize_friendly_id(input)
      Thredded.slugifier.call(input.to_s)
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
thredded-0.15.4 app/models/thredded/category.rb
thredded-0.15.3 app/models/thredded/category.rb
thredded-0.15.2 app/models/thredded/category.rb
thredded-0.15.1 app/models/thredded/category.rb
threddedDANIEL-0.14.5 app/models/thredded/category.rb
thredded-0.14.4 app/models/thredded/category.rb
thredded-0.14.3 app/models/thredded/category.rb
thredded-0.14.2 app/models/thredded/category.rb
thredded-0.14.1 app/models/thredded/category.rb
thredded-0.14.0 app/models/thredded/category.rb
thredded-0.13.8 app/models/thredded/category.rb
thredded-0.13.7 app/models/thredded/category.rb
thredded-0.13.6 app/models/thredded/category.rb
thredded-0.13.5 app/models/thredded/category.rb
thredded-0.13.4 app/models/thredded/category.rb
thredded-0.13.3 app/models/thredded/category.rb
thredded-0.13.2 app/models/thredded/category.rb
thredded-0.13.1 app/models/thredded/category.rb
thredded-0.13.0 app/models/thredded/category.rb
thredded-0.12.4 app/models/thredded/category.rb