Sha256: a85074857bca55fc1b5e7424390427ec9a7da8ed1501b7df38db2efbba81380a
Contents?: true
Size: 763 Bytes
Versions: 6
Compression:
Stored size: 763 Bytes
Contents
module Phcpresspro class Articles::Post < ApplicationRecord # For Image Uploads mount_uploader :pstimage, Phcpresspro::PstimageUploader # Clean URL Initialize extend FriendlyId # Add Paper Trail has_paper_trail # 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 :psttitle, use: :slugged end end
Version data entries
6 entries across 6 versions & 1 rubygems