Sha256: 2a930e3b726a0a4781ee157a86a2d866a8f8957dcda2dc03303e3dfdb49b4b26

Contents?: true

Size: 576 Bytes

Versions: 7

Compression:

Stored size: 576 Bytes

Contents

module Phccodesnipper
  class Script::Snippet < ApplicationRecord

    # Include Core Validations
    include Phccorehelpers::Validations

    # Clean URL Initialize
    extend FriendlyId

    # Relationships
    has_many :urls, class_name: 'Phccodesnipper::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

7 entries across 7 versions & 1 rubygems

Version Path
phccodesnipper-5.4.0 app/models/phccodesnipper/script/snippet.rb
phccodesnipper-5.3.0 app/models/phccodesnipper/script/snippet.rb
phccodesnipper-5.2.0 app/models/phccodesnipper/script/snippet.rb
phccodesnipper-5.1.0 app/models/phccodesnipper/script/snippet.rb
phccodesnipper-5.0.0 app/models/phccodesnipper/script/snippet.rb
phccodesnipper-4.0.0 app/models/phccodesnipper/script/snippet.rb
phccodesnipper-3.0.0 app/models/phccodesnipper/script/snippet.rb