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 ```
11 lines
171 B
Ruby
11 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
|