Sha256: 55ef57eb17c754a9ecf0e63bf07c7e808250948ba6da5986110152d905385805

Contents?: true

Size: 552 Bytes

Versions: 6

Compression:

Stored size: 552 Bytes

Contents

module Phcpresspro
  class Modules::Category < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Add Paper Trail
    has_paper_trail

    # Model Relationships
    has_many :connections, class_name: 'Phcpresspro::Modules::Connection', dependent: :destroy
    has_many :posts, class_name: 'Phcpresspro::Modules::Category', :through => :connections

    # Validation for Form Fields
    validates :catname,
    presence: true,
    length: { minimum: 3 }

    # Clean URL Define
    friendly_id :catname, use: :slugged

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
phcpresspro-14.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-13.1.0 app/models/phcpresspro/modules/category.rb
phcpresspro-13.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-12.3.0 app/models/phcpresspro/modules/category.rb
phcpresspro-12.2.1 app/models/phcpresspro/modules/category.rb
phcpresspro-12.2.0 app/models/phcpresspro/modules/category.rb