Sha256: 2f0436f43662a79398824a0502e4dae33e2a57c8d5029997e2f7df566f205822
Contents?: true
Size: 997 Bytes
Versions: 12
Compression:
Stored size: 997 Bytes
Contents
module PhcdevworksScripts class Script::Author < ApplicationRecord # Clean URL Initialize extend FriendlyId # Paper Trail Initialize has_paper_trail :class_name => 'PhcdevworksScripts::ScriptAuthorVersions' # Relationships has_many :listings, class_name: 'PhcdevworksScripts::Script::Listing' # Form Fields Validation validates :script_author_first_name, presence: true validates :script_author_website, presence: true, format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" } validates :script_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 :script_author_nice_urls, use: [:slugged, :finders] def script_author_nice_urls [:script_author_first_name, :script_author_last_name] end end end
Version data entries
12 entries across 12 versions & 1 rubygems