aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/cat.rb
blob: e543d3aadbda8d406c7ed2262a2d27e000fab90d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
class Cat < ActiveRecord::Base
  self.abstract_class = true

  enum gender: [:female, :male]

  scope :female, -> { where(gender: genders[:female]) }
  scope :male, -> { where(gender: genders[:male]) }

  default_scope -> { where(is_vegetarian: false) }
end

class Lion < Cat
end