Sha256: 8b0d7597357643cfca554b62cf2ee669563fa48b29d9bcbbdfc22dab37f7eb55

Contents?: true

Size: 935 Bytes

Versions: 12

Compression:

Stored size: 935 Bytes

Contents

module Phcscriptcdnpro
  class Script::Author < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Paper Trail Initialize
    has_paper_trail :class_name => 'Phcscriptcdnpro::AuthorVersions'

    # Relationships
    has_many :listings, class_name: 'Phcscriptcdnpro::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

12 entries across 12 versions & 1 rubygems

Version Path
phcscriptcdnpro-79.0.3 app/models/phcscriptcdnpro/script/author.rb
phcscriptcdnpro-79.0.2 app/models/phcscriptcdnpro/script/author.rb
phcscriptcdnpro-79.0.1 app/models/phcscriptcdnpro/script/author.rb
phcscriptcdnpro-79.0.0 app/models/phcscriptcdnpro/script/author.rb
phcscriptcdnpro-78.4.0 app/models/phcscriptcdnpro/script/author.rb
phcscriptcdnpro-78.3.0 app/models/phcscriptcdnpro/script/author.rb
phcscriptcdnpro-78.2.0 app/models/phcscriptcdnpro/script/author.rb
phcscriptcdnpro-78.1.0 app/models/phcscriptcdnpro/script/author.rb
phcscriptcdnpro-78.0.0 app/models/phcscriptcdnpro/script/author.rb
phcscriptcdnpro-77.0.0 app/models/phcscriptcdnpro/script/author.rb
phcscriptcdnpro-75.0.0 app/models/phcscriptcdnpro/script/author.rb
phcscriptcdnpro-74.0.0 app/models/phcscriptcdnpro/script/author.rb