Sha256: 10cf3fc28ae94d16de14359858f56755a5010d914395d1a9bd4c741aeb7a0993

Contents?: true

Size: 842 Bytes

Versions: 14

Compression:

Stored size: 842 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
    has_one_attached :pstimage

    # Model Relationships
    has_and_belongs_to_many :categories, class_name: 'Phcpresspro::Article::Category', :join_table => 'categories_posts'

    # Validation for Form Fields
    validates :psttittle,
      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
      [
        [:psttittle]
      ]
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
phcpresspro-80.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-79.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-78.2.0 app/models/phcpresspro/article/post.rb
phcpresspro-78.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-78.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-77.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-76.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-75.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-74.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-73.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-72.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-71.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-70.2.0 app/models/phcpresspro/article/post.rb
phcpresspro-70.1.0 app/models/phcpresspro/article/post.rb