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-37.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-38.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-37.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-36.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-36.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-35.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-34.0.1 app/models/phcpresspro/article/post.rb
phcpresspro-34.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-33.0.2 app/models/phcpresspro/article/post.rb
phcpresspro-33.0.1 app/models/phcpresspro/article/post.rb
phcpresspro-33.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-32.0.1 app/models/phcpresspro/article/post.rb
phcpresspro-32.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-31.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-31.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-30.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-29.0.1 app/models/phcpresspro/article/post.rb
phcpresspro-29.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-28.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-27.0.0 app/models/phcpresspro/article/post.rb