# frozen_string_literal: true # Order # public_id: string class Order < ApplicationRecord belongs_to :user_account has_one :payment, dependent: :destroy has_many :product_orders, dependent: :destroy has_many :products, through: :product_orders accepts_nested_attributes_for :product_orders def to_param public_id end end