Sha256: 7b3313d509c4b674b9da239bb8df170cf14baa602eacca8cafc9ee18f062e13a

Contents?: true

Size: 514 Bytes

Versions: 20

Compression:

Stored size: 514 Bytes

Contents

# frozen_string_literal: true

module Thredded
  class Category < ActiveRecord::Base
    extend FriendlyId
    belongs_to :messageboard
    has_many :topic_categories, inverse_of: :category, dependent: :delete_all
    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

20 entries across 20 versions & 1 rubygems

Version Path
thredded-1.1.0 app/models/thredded/category.rb
thredded-1.0.1 app/models/thredded/category.rb
thredded-1.0.0 app/models/thredded/category.rb
thredded-0.16.16 app/models/thredded/category.rb
thredded-0.16.15 app/models/thredded/category.rb
thredded-0.16.14 app/models/thredded/category.rb
thredded-0.16.13 app/models/thredded/category.rb
thredded-0.16.12 app/models/thredded/category.rb
thredded-0.16.11 app/models/thredded/category.rb
thredded-0.16.10 app/models/thredded/category.rb
thredded-0.16.9 app/models/thredded/category.rb
thredded-0.16.8 app/models/thredded/category.rb
thredded-0.16.7 app/models/thredded/category.rb
thredded-0.16.6 app/models/thredded/category.rb
thredded-0.16.5 app/models/thredded/category.rb
thredded-0.16.4 app/models/thredded/category.rb
thredded-0.16.3 app/models/thredded/category.rb
thredded-0.16.1 app/models/thredded/category.rb
thredded-0.16.0 app/models/thredded/category.rb
thredded-0.15.5 app/models/thredded/category.rb