Sha256: 649bf3ee23815a04dea3c0297d0d4c7268aa0f60b09db3381d7caab75f248b57

Contents?: true

Size: 826 Bytes

Versions: 26

Compression:

Stored size: 826 Bytes

Contents

module PhcdevworksPress
  class List::Item < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

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

    # Image Upload
    has_one_attached :list_item_image

    # Relationships
    belongs_to :user, class_name: "PhcdevworksAccounts::User"
    belongs_to :post, class_name: "PhcdevworksPress::List::Post"
    belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true

    # Form Fields Validation
    validates :list_item_title,
      presence: true

    validates :list_item_text,
      presence: true

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

    def list_item_nice_urls
      [:list_item_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/item.rb
phcdevworks_press-8.3.0 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-8.2.4 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-8.2.3 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-8.2.2 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-8.2.1 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-8.2.0 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-8.1.1 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-8.1.0 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-8.0.2 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-8.0.1 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-8.0.0 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-7.5.0 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-7.3.0 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-7.2.0 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-7.1.9 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-7.1.8 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-7.1.7 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-7.1.6 app/models/phcdevworks_press/list/item.rb
phcdevworks_press-7.1.5 app/models/phcdevworks_press/list/item.rb