Sha256: c9355f864924386bc7684df4366b634c9293ef904fc901c9acd65e03a4647595

Contents?: true

Size: 911 Bytes

Versions: 17

Compression:

Stored size: 911 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_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

17 entries across 17 versions & 1 rubygems

Version Path
phcpresspro-69.1.0 app/models/phcpresspro/article/post.rb
phcpresspro-69.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-68.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-67.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-66.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-65.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-64.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-63.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-62.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-61.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-60.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-59.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-58.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-57.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-56.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-55.0.0 app/models/phcpresspro/article/post.rb
phcpresspro-54.0.0 app/models/phcpresspro/article/post.rb