Sha256: 1361b0390db54cf73cd6ad4925cba120b63a5f24638dc5eaefa5a4b6e3e195fd

Contents?: true

Size: 678 Bytes

Versions: 2

Compression:

Stored size: 678 Bytes

Contents

module PhcdevworksPortfolio
  class Project::Post < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Image Upload
    has_one_attached :post_image

    # Relationships
    has_and_belongs_to_many :categories, class_name: "Project::Category", :join_table => "phcdevworks_portfolio_categories_posts"
    has_and_belongs_to_many :types, class_name: "Project::Type", :join_table => "phcdevworks_portfolio_posts_types"
    belongs_to :user, class_name: "PhcdevworksAccounts::User"

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

    def phcdev_project_post_nice_urls
      [:post_title]
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
phcdevworks_portfolio-2.0.1 app/models/phcdevworks_portfolio/project/post.rb
phcdevworks_portfolio-2.0.0 app/models/phcdevworks_portfolio/project/post.rb