Sha256: 7eaa7195829ca74c46d4afb13e8c5fcc5e858ef193caceebf5c5e0490cf9c0fe

Contents?: true

Size: 582 Bytes

Versions: 8

Compression:

Stored size: 582 Bytes

Contents

module Phccodesnipperpro
  class Script::Snippet < ApplicationRecord

    # Include Core Validations
    include Phccorehelpers::Validations

    # Clean URL Initialize
    extend FriendlyId

    # Relationships
    has_many :urls, class_name: 'Phccodesnipperpro::Script::Url'

    # Form Fields Validation
    validates :snippet_title,
      presence: true

    validates :snippet_code,
      presence: true

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

    def phc_nice_url_slug
      [
        [:snippet_title]
      ]
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
phccodesnipperpro-4.4.0 app/models/phccodesnipperpro/script/snippet.rb
phccodesnipperpro-4.3.0 app/models/phccodesnipperpro/script/snippet.rb
phccodesnipperpro-4.2.0 app/models/phccodesnipperpro/script/snippet.rb
phccodesnipperpro-4.1.0 app/models/phccodesnipperpro/script/snippet.rb
phccodesnipperpro-4.0.0 app/models/phccodesnipperpro/script/snippet.rb
phccodesnipperpro-3.0.0 app/models/phccodesnipperpro/script/snippet.rb
phccodesnipperpro-2.0.0 app/models/phccodesnipperpro/script/snippet.rb
phccodesnipperpro-1.0.0 app/models/phccodesnipperpro/script/snippet.rb