Sha256: 2ee507714fdace9c84e04e3b3135980bd449354dd0f3d049716f14b3bde124c9

Contents?: true

Size: 986 Bytes

Versions: 6

Compression:

Stored size: 986 Bytes

Contents

module PhcdevworksScripts
  class Script::Author < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

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

    # Relationships
    has_many :listings, class_name: 'PhcdevworksScripts::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 :phcdev_script_author_nice_urls, use: [:slugged, :finders]

    def phcdev_script_author_nice_urls
      [
        [:author_first_name, :author_last_name]
      ]
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
phcdevworks_scripts-3.0.1 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-3.0.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-2.3.1 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-2.3.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-2.2.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-2.1.1 app/models/phcdevworks_scripts/script/author.rb