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