From 3962be5b8c20da54421ae472f06c741f0472fd46 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 29 May 2009 21:47:19 -0500 Subject: Use URI and Inflector --- activeresource/lib/active_resource/base.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb index dc24e713ff..847cc600d5 100644 --- a/activeresource/lib/active_resource/base.rb +++ b/activeresource/lib/active_resource/base.rb @@ -1,12 +1,14 @@ require 'active_support' require 'active_support/core_ext/class/attribute_accessors' require 'active_support/core_ext/class/inheritable_attributes' +require 'active_support/core_ext/kernel/reporting' require 'active_support/core_ext/module/attr_accessor_with_default' require 'active_support/core_ext/module/delegation' require 'active_support/core_ext/module/aliasing' require 'active_support/core_ext/object/blank' require 'active_support/core_ext/object/misc' require 'set' +require 'uri' module ActiveResource autoload :Formats, 'active_resource/formats' @@ -346,9 +348,9 @@ module ActiveResource # Do not include any modules in the default element name. This makes it easier to seclude ARes objects # in a separate namespace without having to set element_name repeatedly. - attr_accessor_with_default(:element_name) { to_s.split("::").last.underscore } #:nodoc: + attr_accessor_with_default(:element_name) { ActiveSupport::Inflector.underscore(to_s.split("::").last) } #:nodoc: - attr_accessor_with_default(:collection_name) { element_name.pluralize } #:nodoc: + attr_accessor_with_default(:collection_name) { ActiveSupport::Inflector.pluralize(element_name) } #:nodoc: attr_accessor_with_default(:primary_key, 'id') #:nodoc: # Gets the \prefix for a resource's nested URL (e.g., prefix/collectionname/1.xml) -- cgit v1.2.3