mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
7c61f5c207
``` $ ARCONN=mysql2 be ruby -w -Itest test/cases/scoping/default_scoping_test.rb Using mysql2 /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/scoping/named.rb:158: warning: method redefined; discarding old female /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/scoping/named.rb:158: warning: previous definition of female was here /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/scoping/named.rb:158: warning: method redefined; discarding old male /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/scoping/named.rb:158: warning: previous definition of male was here ```
10 lines
171 B
Ruby
10 lines
171 B
Ruby
class Cat < ActiveRecord::Base
|
|
self.abstract_class = true
|
|
|
|
enum gender: [:female, :male]
|
|
|
|
default_scope -> { where(is_vegetarian: false) }
|
|
end
|
|
|
|
class Lion < Cat
|
|
end
|