diff options
author | Rafael Mendonça França <rafael.franca@plataformatec.com.br> | 2014-08-17 23:01:13 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafael.franca@plataformatec.com.br> | 2014-08-17 23:01:13 -0300 |
commit | d2d809868c3eeb4d4a964382fc3df15cd5da70e4 (patch) | |
tree | 4f790872d6cb202b235ed21fc3c5ade6c4511399 /actionpack/lib/action_dispatch | |
parent | 76883f92374c6395f13c16628e1d87d40b6d2399 (diff) | |
parent | 6b0e834a194d112585f41deba0a40780d68e38c6 (diff) | |
download | rails-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 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/polymorphic_routes.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb index cd8b1ab066..427a5674bd 100644 --- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb @@ -254,9 +254,9 @@ module ActionDispatch model = record.to_model name = if record.persisted? args << model - model.class.model_name.singular_route_key + model.model_name.singular_route_key else - @key_strategy.call model.class.model_name + @key_strategy.call model.model_name end named_route = prefix + "#{name}_#{suffix}" @@ -284,7 +284,7 @@ module ActionDispatch parent.model_name.singular_route_key else args << parent.to_model - parent.to_model.class.model_name.singular_route_key + parent.to_model.model_name.singular_route_key end } @@ -297,9 +297,9 @@ module ActionDispatch else if record.persisted? args << record.to_model - record.to_model.class.model_name.singular_route_key + record.to_model.model_name.singular_route_key else - @key_strategy.call record.to_model.class.model_name + @key_strategy.call record.to_model.model_name end end |