Sha256: 6120af72a822af771825e0cb067d1a773f7e4ae6aec975c9f9e7474402056110

Contents?: true

Size: 724 Bytes

Versions: 1

Compression:

Stored size: 724 Bytes

Contents

module Phcpress
  class Articles::Post < ApplicationRecord

    # Image Upload Initialize
    mount_uploader :pstimage, Phcpress::PstimageUploader

    # Clean URL Initialize
    extend FriendlyId

    # Paper_tail Initialize
    has_paper_trail

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

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

    validates :psttext,
    presence: true,
    length: { minimum: 3 }

    validates :pststatus,
    presence: true

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
phcpress-9.0.1 app/models/phcpress/articles/post.rb