Sha256: 7409a2f857893d65ed37c169d973ed290ace19af7d066e1461ca41f63a6fdcd7

Contents?: true

Size: 992 Bytes

Versions: 15

Compression:

Stored size: 992 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 :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

15 entries across 15 versions & 1 rubygems

Version Path
phcdevworks_scripts-5.8.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-5.7.1 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-5.7.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-5.6.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-5.5.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-5.4.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-5.3.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-5.2.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-5.1.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-5.0.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-4.1.1 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-4.1.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-4.0.2 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-4.0.1 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-4.0.0 app/models/phcdevworks_scripts/script/author.rb