Sha256: 649bf3ee23815a04dea3c0297d0d4c7268aa0f60b09db3381d7caab75f248b57
Contents?: true
Size: 826 Bytes
Versions: 26
Compression:
Stored size: 826 Bytes
Contents
module PhcdevworksPress class List::Item < ApplicationRecord # Clean URL Initialize extend FriendlyId # Paper Trail Initialize has_paper_trail :class_name => "PhcdevworksPress::ListItemVersions" # Image Upload has_one_attached :list_item_image # Relationships belongs_to :user, class_name: "PhcdevworksAccounts::User" belongs_to :post, class_name: "PhcdevworksPress::List::Post" belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true # Form Fields Validation validates :list_item_title, presence: true validates :list_item_text, presence: true # Clean URL Define friendly_id :list_item_nice_urls, use: [:slugged, :finders] def list_item_nice_urls [:list_item_title] end end end
Version data entries
26 entries across 26 versions & 1 rubygems