aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-05-13 01:10:37 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-05-13 12:00:15 -0700
commite8550ee0329586b32de425e905c7af7e65bc78a8 (patch)
tree0cdfe0f9f0d3fb010280ff0453fc553ab6ff2d92 /activeresource
parentfa5da8ad54d68ea0484825845eb6f6a8e8bca361 (diff)
downloadrails-e8550ee0329586b32de425e905c7af7e65bc78a8.tar.gz
rails-e8550ee0329586b32de425e905c7af7e65bc78a8.tar.bz2
rails-e8550ee0329586b32de425e905c7af7e65bc78a8.zip
Cherry-pick core extensions
Diffstat (limited to 'activeresource')
-rw-r--r--activeresource/Rakefile7
-rw-r--r--activeresource/lib/active_resource/base.rb4
-rw-r--r--activeresource/test/base/custom_methods_test.rb1
-rw-r--r--activeresource/test/base/load_test.rb1
-rw-r--r--activeresource/test/base_test.rb1
5 files changed, 13 insertions, 1 deletions
diff --git a/activeresource/Rakefile b/activeresource/Rakefile
index c3cde26b6c..eb5b1dd1ac 100644
--- a/activeresource/Rakefile
+++ b/activeresource/Rakefile
@@ -34,6 +34,13 @@ Rake::TestTask.new { |t|
t.verbose = true
t.warning = true
}
+task :isolated_test do
+ ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
+ activesupport_path = "#{File.dirname(__FILE__)}/../activesupport/lib"
+ Dir.glob("test/**/*_test.rb").all? do |file|
+ system(ruby, "-Ilib:test:#{activesupport_path}", file)
+ end or raise "Failures"
+end
# Generate the RDoc documentation
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb
index 8a1236c9a8..dc24e713ff 100644
--- a/activeresource/lib/active_resource/base.rb
+++ b/activeresource/lib/active_resource/base.rb
@@ -1,8 +1,10 @@
+require 'active_support'
require 'active_support/core_ext/class/attribute_accessors'
require 'active_support/core_ext/class/inheritable_attributes'
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'
@@ -1027,7 +1029,7 @@ module ActiveResource
private
# Tries to find a resource for a given collection name; if it fails, then the resource is created
def find_or_create_resource_for_collection(name)
- find_or_create_resource_for(name.to_s.singularize)
+ find_or_create_resource_for(ActiveSupport::Inflector.singularize(name.to_s))
end
# Tries to find a resource in a non empty list of nested modules
diff --git a/activeresource/test/base/custom_methods_test.rb b/activeresource/test/base/custom_methods_test.rb
index 61887f4ec7..2d81549a65 100644
--- a/activeresource/test/base/custom_methods_test.rb
+++ b/activeresource/test/base/custom_methods_test.rb
@@ -1,6 +1,7 @@
require 'abstract_unit'
require 'fixtures/person'
require 'fixtures/street_address'
+require 'active_support/core_ext/hash/conversions'
class CustomMethodsTest < Test::Unit::TestCase
def setup
diff --git a/activeresource/test/base/load_test.rb b/activeresource/test/base/load_test.rb
index cd2103acb7..035bd965c2 100644
--- a/activeresource/test/base/load_test.rb
+++ b/activeresource/test/base/load_test.rb
@@ -2,6 +2,7 @@ require 'abstract_unit'
require "fixtures/person"
require "fixtures/street_address"
require 'active_support/core_ext/symbol'
+require 'active_support/core_ext/hash/conversions'
module Highrise
class Note < ActiveResource::Base
diff --git a/activeresource/test/base_test.rb b/activeresource/test/base_test.rb
index a6cef6b2ae..82d3b2ae96 100644
--- a/activeresource/test/base_test.rb
+++ b/activeresource/test/base_test.rb
@@ -3,6 +3,7 @@ require "fixtures/person"
require "fixtures/customer"
require "fixtures/street_address"
require "fixtures/beast"
+require 'active_support/core_ext/hash/conversions'
class BaseTest < Test::Unit::TestCase
def setup