Sha256: 7ea752b395c031b503c0133b5e81530a02bc2f919830b70cf2cc84d8ae3e64b5
Contents?: true
Size: 926 Bytes
Versions: 10
Compression:
Stored size: 926 Bytes
Contents
module Phcscriptcdn class Script::Author < ApplicationRecord # Clean URL Initialize extend FriendlyId # Paper Trail Initialize has_paper_trail :class_name => 'Phcscriptcdn::AuthorVersions' # Relationships has_many :listings, class_name: 'Phcscriptcdn::Script::Listing' # Form Fields Validation validates :author_first_name, presence: true validates :author_website, presence: true, format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" } validates :author_github, presence: true, format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" } # Clean URL Define friendly_id :phc_nice_url_slug, use: [:slugged, :finders] def phc_nice_url_slug [:author_first_name, :author_last_name] end end end
Version data entries
10 entries across 10 versions & 1 rubygems