Sha256: b97a6a512f8706450359b48095d4e217e949ac37f97eacab3a5e2226f9f46d86

Contents?: true

Size: 901 Bytes

Versions: 54

Compression:

Stored size: 901 Bytes

Contents

module Phcscriptcdn
  class Script::Listing < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Add Paper Trail
    has_paper_trail :class_name => 'Phcscriptcdn::ListingVersions'

    # Relationships
    has_many :urls, class_name: 'Phcscriptcdn::Script::Url'
    belongs_to :author, class_name: 'Phcscriptcdn::Script::Author'
    belongs_to :version, class_name: 'Phcscriptcdn::Script::Version'
    belongs_to :licence, class_name: 'Phcscriptcdn::Script::Licence'

    # Validation for Form Fields
    validates :scripttitle,
      presence: true

    validates :scriptdescription,
      presence: true

    validates :scriptstatus,
      presence: true

    # Clean URL Define
    friendly_id :phcscriptcdn_listing_slug, use: [:slugged, :finders]

    # Define for Multiple Records
    def phcscriptcdn_listing_slug
      [
        [:scripttitle]
      ]
    end

  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
phcscriptcdn-48.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-47.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-44.1.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-45.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-44.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-43.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-42.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-41.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-40.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-38.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-37.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-36.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-35.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-34.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-33.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-32.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-31.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-30.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-29.2.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-29.1.0 app/models/phcscriptcdn/script/listing.rb