1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix warning: method redefined;

This fixes the following warning:

```
/tmp/d20170727-7039-kmdtb1/app/app/models/user.rb:5: warning: method redefined; discarding old model_name
rails/activemodel/lib/active_model/naming.rb:222: warning: previous definition of model_name was here
```
This commit is contained in:
yuuji.yaginuma 2017-07-27 07:29:38 +09:00
parent 6f9b01c056
commit 65a1733545

View file

@ -293,7 +293,7 @@ module ApplicationTests
extend ActiveModel::Naming
include ActiveModel::Conversion
def model_name
def self.model_name
@_model_name ||= ActiveModel::Name.new(self.class, nil, "User")
end
@ -430,7 +430,7 @@ module ApplicationTests
extend ActiveModel::Naming
include ActiveModel::Conversion
def model_name
def self.model_name
@_model_name ||= ActiveModel::Name.new(self.class, nil, "User")
end
@ -542,7 +542,7 @@ module ApplicationTests
extend ActiveModel::Naming
include ActiveModel::Conversion
def model_name
def self.model_name
@_model_name ||= ActiveModel::Name.new(self.class, nil, "User")
end