Sha256: d93639e9ff9738ef311828f9ded2ca8e468f0f010b85a4487f92134ae5f75380

Contents?: true

Size: 552 Bytes

Versions: 1

Compression:

Stored size: 552 Bytes

Contents

# frozen_string_literal: true

module Spina
  module Admin::Conferences::Blog
    # Spina::Blog::Category
    class Category < ApplicationRecord
      extend FriendlyId

      friendly_id :name, use: :slugged

      has_many :posts, class_name: 'Spina::Admin::Conferences::Blog::Post', inverse_of: :category
      validates :name, presence: true, uniqueness: { case_sensitive: false }

      translates :name, fallbacks: true

      def to_s
        name
      end

      def self.table_name
        'spina_blog_categories'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spina-admin-conferences-blog-0.3.1 app/models/spina/admin/conferences/blog/category.rb