Sha256: 294606aef4e4b949caed90d98a8947c64bb309267d6e9aee60f948f0e5cc42c2

Contents?: true

Size: 492 Bytes

Versions: 3

Compression:

Stored size: 492 Bytes

Contents

module PhcdevworksScripts
  class Snippet::Post < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

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

3 entries across 3 versions & 1 rubygems

Version Path
phcdevworks_scripts-2.1.0 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-1.0.0 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-0.1.0 app/models/phcdevworks_scripts/snippet/post.rb