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