aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-05-29 21:47:19 -0500
committerJeremy Kemper <jeremy@bitsweat.net>2009-05-30 11:59:17 -0700
commit3962be5b8c20da54421ae472f06c741f0472fd46 (patch)
treed21afda8ab3cdea1ed39d7f79aa92b6948fc8599 /activeresource/lib
parentc53057d4fdd6aa55c42fe00ce81e0b04948c4f02 (diff)
downloadrails-3962be5b8c20da54421ae472f06c741f0472fd46.tar.gz
rails-3962be5b8c20da54421ae472f06c741f0472fd46.tar.bz2
rails-3962be5b8c20da54421ae472f06c741f0472fd46.zip
Use URI and Inflector
Diffstat (limited to 'activeresource/lib')
-rw-r--r--activeresource/lib/active_resource/base.rb6
1 files 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., <tt>prefix/collectionname/1.xml</tt>)