mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-10 03:30:22 +00:00
8 lines
249 B
Ruby
8 lines
249 B
Ruby
class EnterpriseRelationship < ActiveRecord::Base
|
|
belongs_to :parent, class_name: 'Enterprise'
|
|
belongs_to :child, class_name: 'Enterprise'
|
|
|
|
validates_presence_of :parent_id, :child_id
|
|
validates_uniqueness_of :child_id, scope: :parent_id
|
|
end
|