module Phcscriptcdnpro class Script::Version < ApplicationRecord # Clean URL Initialize extend FriendlyId # Add Paper Trail has_paper_trail :class_name => 'Phcscriptcdnpro::ScriptversionVersions' # Relationships has_many :listings, class_name: 'Phcscriptcdnpro::Script::Listing' has_many :urls, class_name: 'Phcscriptcdnpro::Script::Url' # Validation for Form Fields validates :scriptversion, presence: true # Clean URL Define friendly_id :phcscriptcdnpro_version_slug, use: [:slugged, :finders] # Define for Multiple Records def phcscriptcdnpro_version_slug [ [:scriptversion] ] end end end