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-25.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-24.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-23.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-23.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-22.2.0 app/models/phcpresspro/article/post.rb
phcpresspro-22.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-22.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-21.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-21.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-20.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-19.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-18.4.0 app/models/phcpresspro/article/post.rb
phcpresspro-18.3.0 app/models/phcpresspro/article/post.rb
phcpresspro-18.2.0 app/models/phcpresspro/article/post.rb
phcpresspro-18.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-18.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-17.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-16.2.0 app/models/phcpresspro/article/post.rb
phcpresspro-16.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-16.0.0 app/models/phcpresspro/article/post.rb