Sha256: a85074857bca55fc1b5e7424390427ec9a7da8ed1501b7df38db2efbba81380a

Contents?: true

Size: 763 Bytes

Versions: 6

Compression:

Stored size: 763 Bytes

Contents

module Phcpresspro
  class Articles::Post < ApplicationRecord

    # For Image Uploads
    mount_uploader :pstimage, Phcpresspro::PstimageUploader

    # 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 :categories, class_name: 'Phcpresspro::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

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

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
phcpresspro-14.0.0 app/models/phcpresspro/articles/post.rb
phcpresspro-13.1.0 app/models/phcpresspro/articles/post.rb
phcpresspro-13.0.0 app/models/phcpresspro/articles/post.rb
phcpresspro-12.3.0 app/models/phcpresspro/articles/post.rb
phcpresspro-12.2.1 app/models/phcpresspro/articles/post.rb
phcpresspro-12.2.0 app/models/phcpresspro/articles/post.rb