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-53.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-52.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-51.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-50.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-49.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-48.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-47.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-47.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-46.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-44.2.0 app/models/phcpresspro/article/post.rb
phcpresspro-44.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-44.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-43.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-42.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-41.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-40.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-40.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-39.0.1 app/models/phcpresspro/article/post.rb
phcpresspro-39.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-38.1.0 app/models/phcpresspro/article/post.rb