Sha256: 34cdd6192bbd55e12c4d0c03f526dfc2b68d8b22da418657f2e8c05105c657b6

Contents?: true

Size: 783 Bytes

Versions: 7

Compression:

Stored size: 783 Bytes

Contents

module Phcscriptcdn
  class Script::Listing < ApplicationRecord

    # Clean URLS
    extend FriendlyId

    # Attach to URL (Nested)
    has_many :urls, class_name: 'Phcscriptcdn::Script::Url'

    # Attach to Author (None Nested)
    belongs_to :author, class_name: 'Phcscriptcdn::Script::Author'

    # Attach to Version (None Nested)
    belongs_to :version, class_name: 'Phcscriptcdn::Script::Version'

    # Attach to Licence (None Nested)
    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 URLS Slugs
    friendly_id :scripttitle, use: :slugged

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
phcscriptcdn-7.2.2 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-7.2.1 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-7.2.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-7.1.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-7.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-6.0.0 app/models/phcscriptcdn/script/listing.rb
phcscriptcdn-6.0.0b app/models/phcscriptcdn/script/listing.rb