Sha256: feef0fb4aef9a766f16868af9b3a82ef82cfb19bab43e1dad410acdd5cb86c20

Contents?: true

Size: 433 Bytes

Versions: 2

Compression:

Stored size: 433 Bytes

Contents

module Ecom
  module Core
    class WorkProductTemplate < ApplicationRecord
      validates :code, :name, presence: true, uniqueness: true
      has_and_belongs_to_many :task_templates
      has_many :product_types

      scope :filtered_by_template_type, lambda { |id|
        joins(:task_template).where('ecom_core_task_templates.task_template_type_id = ?', id)
                             .order(:code)
      }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ecom_core-1.2.16 app/models/ecom/core/work_product_template.rb
ecom_core-1.2.15 app/models/ecom/core/work_product_template.rb