cirandas.net

ref: master

plugins/products/models/products_plugin/production_cost.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
class ProductsPlugin::ProductionCost < ApplicationRecord

  self.table_name = :production_costs

  attr_accessible :name, :owner

  belongs_to :owner, :polymorphic => true
  validates_presence_of :owner
  validates_presence_of :name
  validates_length_of :name, :maximum => 30, :allow_blank => true
  validates_uniqueness_of :name, :scope => [:owner_id, :owner_type]

end