Sha256: fecbc34ef76b4086fb206375a241887dc8586c735d5ccd2870ef7bf3138f0250

Contents?: true

Size: 951 Bytes

Versions: 68

Compression:

Stored size: 951 Bytes

Contents

module Phcpresspro
  class Article::Post < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Add Paper Trail
    has_paper_trail :class_name => 'Phcpresspro::PostVersions'

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

    # 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 :phcpresspro_post_slug, use: [:slugged, :finders]

    # Define for Multiple Records
    def phcpresspro_post_slug
      [
        [:psttitle]
      ]
    end

  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
phcpresspro-15.6.0 app/models/phcpresspro/article/post.rb
phcpresspro-15.5.0 app/models/phcpresspro/article/post.rb
phcpresspro-15.4.0 app/models/phcpresspro/article/post.rb
phcpresspro-15.3.0 app/models/phcpresspro/article/post.rb
phcpresspro-15.2.0 app/models/phcpresspro/article/post.rb
phcpresspro-15.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-15.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-14.1.0 app/models/phcpresspro/article/post.rb