aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/naming.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafael.franca@plataformatec.com.br>2014-08-17 23:01:13 -0300
committerRafael Mendonça França <rafael.franca@plataformatec.com.br>2014-08-17 23:01:13 -0300
commitd2d809868c3eeb4d4a964382fc3df15cd5da70e4 (patch)
tree4f790872d6cb202b235ed21fc3c5ade6c4511399 /activemodel/lib/active_model/naming.rb
parent76883f92374c6395f13c16628e1d87d40b6d2399 (diff)
parent6b0e834a194d112585f41deba0a40780d68e38c6 (diff)
downloadrails-d2d809868c3eeb4d4a964382fc3df15cd5da70e4.tar.gz
rails-d2d809868c3eeb4d4a964382fc3df15cd5da70e4.tar.bz2
rails-d2d809868c3eeb4d4a964382fc3df15cd5da70e4.zip
Merge pull request #15889 from carnesmedia/model-name
Use #model_name on instances instead of classes
Diffstat (limited to 'activemodel/lib/active_model/naming.rb')
-rw-r--r--activemodel/lib/active_model/naming.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/naming.rb b/activemodel/lib/active_model/naming.rb
index 241e88deeb..d9ec502f88 100644
--- a/activemodel/lib/active_model/naming.rb
+++ b/activemodel/lib/active_model/naming.rb
@@ -307,7 +307,7 @@ module ActiveModel
if record_or_class.respond_to?(:model_name)
record_or_class.model_name
elsif record_or_class.respond_to?(:to_model)
- record_or_class.to_model.class.model_name
+ record_or_class.to_model.model_name
else
record_or_class.class.model_name
end