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