aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/vegetables.rb
blob: c97b6b939dc4edf6854a925d86f95259264cfe74 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true
class Vegetable < ActiveRecord::Base
  validates_presence_of :name

  def self.inheritance_column
    "custom_type"
  end
end

class Cucumber < Vegetable
end

class Cabbage < Vegetable
end

class GreenCabbage < Cabbage
end

class KingCole < GreenCabbage
end

class RedCabbage < Cabbage
  belongs_to :seller, class_name: "Company"
end