Sha256: ea246c8c79d4275a3bb809a06b95a6c6762aff18c82da37bdc4803035a8d6d21

Contents?: true

Size: 759 Bytes

Versions: 2

Compression:

Stored size: 759 Bytes

Contents

module PhcdevworksCoreModules
  class Affiliate::Link < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Paper Trail Initialize
    has_paper_trail versions: {class_name: "PhcdevworksCoreModules::AffiliateLinkVersions"}

    # Relationships for Local
    belongs_to :user, class_name: "PhcdevworksAccounts::User"

    if defined?phcdevworks_press
      has_many :posts, class_name: "PhcdevworksPress::Article::Post"
      has_many :posts, class_name: "PhcdevworksPress::Review::Post"
      has_many :posts, class_name: "PhcdevworksPress::List::Post"
    end

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

    def affiliate_link_nice_urls
      [:affiliate_link_name]
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
phcdevworks_core_modules-7.1.1 app/models/phcdevworks_core_modules/affiliate/link.rb
phcdevworks_core_modules-7.1.0 app/models/phcdevworks_core_modules/affiliate/link.rb