Sha256: 15580703806f1401fdd527291c195c4ad2399b72d89fe2111340b86103077831

Contents?: true

Size: 1004 Bytes

Versions: 14

Compression:

Stored size: 1004 Bytes

Contents

module PhcdevworksPortfolio
  class Project::Post < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Paper Trail Initialize
    has_paper_trail :class_name => 'PhcdevworksPortfolio::ProjectPostVersions'

    # Image Upload
    has_one_attached :project_post_image

    # Relationships
    belongs_to :user, class_name: "PhcdevworksAccounts::User"
    has_and_belongs_to_many :types, class_name: "PhcdevworksPortfolio::Project::Type", :join_table => "phcdevworks_portfolio_project_posts_types", :dependent => :destroy
    has_and_belongs_to_many :categories, class_name: "PhcdevworksCoreModules::Post::Category", :join_table => "phcdevworks_portfolio_project_categories_posts", :dependent => :destroy
    belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true

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

    def project_post_nice_urls
      [:project_post_title]
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
phcdevworks_portfolio-10.1.1 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-10.1.0 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-10.0.5 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-10.0.4 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-10.0.3 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-10.0.2 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-10.0.1 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-10.0.0 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-9.4.0 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-9.3.0 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-9.2.0 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-9.1.0 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-9.0.1 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-9.0.0 app/models/phcdevworks_portfolio/project/post.rb