Sha256: 7da9aaf6d685b09d8b020f4d546eeb15934899cdf6826224ef288d56d2a7b527

Contents?: true

Size: 624 Bytes

Versions: 15

Compression:

Stored size: 624 Bytes

Contents

module PhcdevworksScripts
  class Snippet::Post < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Paper Trail Initialize
    has_paper_trail :class_name => 'PhcdevworksScripts::SnippetPostVersions'

    # Relationships
    has_many :urls, class_name: 'PhcdevworksScripts::Snippet::Url'

    # Form Fields Validation
    validates :snippet_title,
      presence: true

    validates :snippet_code,
      presence: true

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

    def phcdev_snippet_post_nice_urls
      [:snippet_title]
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
phcdevworks_scripts-5.8.0 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-5.7.1 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-5.7.0 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-5.6.0 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-5.5.0 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-5.4.0 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-5.3.0 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-5.2.0 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-5.1.0 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-5.0.0 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-4.1.1 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-4.1.0 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-4.0.2 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-4.0.1 app/models/phcdevworks_scripts/snippet/post.rb
phcdevworks_scripts-4.0.0 app/models/phcdevworks_scripts/snippet/post.rb