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

Version Path
phcdevworks_scripts-8.1.1 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-8.1.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-8.0.5 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-8.0.4 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-8.0.3 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-8.0.2 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-8.0.1 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-8.0.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-7.4.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-7.2.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-7.1.0 app/models/phcdevworks_scripts/script/author.rb
phcdevworks_scripts-7.0.0 app/models/phcdevworks_scripts/script/author.rb