From 5ffaaa71d149c9807260c950c9a61d01fe734827 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Mon, 20 Jul 2009 00:27:04 +0900 Subject: Define ActiveModel API Compliance - Define to_model on AR - Define to_model on ActiveModel::APICompliant - Update test fixtures to be API Compliant - Start using to_model in AP --- .../lib/action_controller/routing/generation/polymorphic_routes.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/lib/action_controller/routing/generation') diff --git a/actionpack/lib/action_controller/routing/generation/polymorphic_routes.rb b/actionpack/lib/action_controller/routing/generation/polymorphic_routes.rb index c6f7de17bd..159d869a54 100644 --- a/actionpack/lib/action_controller/routing/generation/polymorphic_routes.rb +++ b/actionpack/lib/action_controller/routing/generation/polymorphic_routes.rb @@ -77,6 +77,7 @@ module ActionController end record = extract_record(record_or_hash_or_array) + record = record.to_model if record.respond_to?(:to_model) namespace = extract_namespace(record_or_hash_or_array) args = case record_or_hash_or_array -- cgit v1.2.3