提交 7c61f5c2 编写于 作者: R Ryuta Kamizono

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
```
上级 92010303
...@@ -3,9 +3,6 @@ class Cat < ActiveRecord::Base ...@@ -3,9 +3,6 @@ class Cat < ActiveRecord::Base
enum gender: [:female, :male] enum gender: [:female, :male]
scope :female, -> { where(gender: genders[:female]) }
scope :male, -> { where(gender: genders[:male]) }
default_scope -> { where(is_vegetarian: false) } default_scope -> { where(is_vegetarian: false) }
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册