rails/activerecord/test/models/cat.rb
Ryuta Kamizono 7c61f5c207 Fix warning: method redefined; discarding old female
```
$ 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
```
2016-03-12 17:06:43 +09:00

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