Sha256: 53908e3fbd9952c3a63af50d6e968f90b96fd81e09326b53bb1643ca465b5dcf

Contents?: true

Size: 1 KB

Versions: 26

Compression:

Stored size: 1 KB

Contents

module PhcdevworksPress
  class List::Post < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Paper Trail Initialize
    has_paper_trail :class_name => "PhcdevworksPress::ListPostVersions"

    # Image Upload
    has_one_attached :list_post_image

    # Relationships
    belongs_to :user, class_name: "PhcdevworksAccounts::User"
    has_many :items, class_name: "PhcdevworksPress::List::Item", :dependent => :destroy
    has_and_belongs_to_many :categories, class_name: "PhcdevworksCoreModules::Post::Category", :join_table => "phcdevworks_press_list_categories_posts", :dependent => :destroy
    belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true

    # Form Fields Validation
    validates :list_post_title,
      presence: true

    validates :list_post_text,
      presence: true

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

    def list_post_nice_urls
      [:list_post_title]
    end

  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
phcdevworks_press-8.3.1 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-8.3.0 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-8.2.4 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-8.2.3 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-8.2.2 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-8.2.1 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-8.2.0 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-8.1.1 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-8.1.0 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-8.0.2 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-8.0.1 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-8.0.0 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-7.5.0 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-7.3.0 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-7.2.0 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-7.1.9 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-7.1.8 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-7.1.7 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-7.1.6 app/models/phcdevworks_press/list/post.rb
phcdevworks_press-7.1.5 app/models/phcdevworks_press/list/post.rb