aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/drink_designer.rb
blob: fe7f5c9e03e215475ea4d76ef1d6ffddab5de04c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

class DrinkDesigner < ActiveRecord::Base
  has_one :chef, as: :employable
end

class DrinkDesignerWithPolymorphicDependentNullifyChef < ActiveRecord::Base
  self.table_name = "drink_designers"

  has_one :chef, as: :employable, dependent: :nullify
end

class DrinkDesignerWithPolymorphicTouchChef < ActiveRecord::Base
  self.table_name = "drink_designers"

  has_one :chef, as: :employable, touch: true
end

class MocktailDesigner < DrinkDesigner
end