From 723a47bfb3708f968821bc969a9a3fc873a3ed58 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Wed, 2 Sep 2009 11:44:36 -0500 Subject: Kill AMo observing wrap_with_notifications since ARes was only using it --- activeresource/lib/active_resource/observing.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'activeresource/lib') diff --git a/activeresource/lib/active_resource/observing.rb b/activeresource/lib/active_resource/observing.rb index 94836f4bb1..3c74d49c80 100644 --- a/activeresource/lib/active_resource/observing.rb +++ b/activeresource/lib/active_resource/observing.rb @@ -4,7 +4,18 @@ module ActiveResource include ActiveModel::Observing included do - wrap_with_notifications :create, :save, :update, :destroy + %w( create save update destroy ).each do |method| + class_eval(<<-EOS, __FILE__, __LINE__ + 1) + def #{method}_with_notifications(*args, &block) + notify_observers(:before_#{method}) + if result = #{method}_without_notifications(*args, &block) + notify_observers(:after_#{method}) + end + result + end + EOS + alias_method_chain(method, :notifications) + end end end end -- cgit v1.2.3 From 8682d76cc988715fdea11e2c88fa2b56ae2b4709 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 11 Sep 2009 19:22:54 -0700 Subject: Revert "Allow frameworks to be required by their gem name" This has just been confusing. Better to educate than band-aid. This reverts commit 18a24274ec823ded4ffa29bf33fd3d76816aab7e. Originally from http://dev.rubyonrails.org/ticket/8845 [drnic] --- activeresource/lib/activeresource.rb | 1 - 1 file changed, 1 deletion(-) delete mode 100644 activeresource/lib/activeresource.rb (limited to 'activeresource/lib') diff --git a/activeresource/lib/activeresource.rb b/activeresource/lib/activeresource.rb deleted file mode 100644 index e076455b16..0000000000 --- a/activeresource/lib/activeresource.rb +++ /dev/null @@ -1 +0,0 @@ -require 'active_resource' -- cgit v1.2.3 From b5dd1b659987bb6117c0f1657e66dc395cfbed5e Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 17 Sep 2009 11:34:40 -0700 Subject: Fix brittle content-type check. [#1956 state:committed] --- activeresource/lib/active_resource/validations.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activeresource/lib') diff --git a/activeresource/lib/active_resource/validations.rb b/activeresource/lib/active_resource/validations.rb index d4d282e273..67b69fa505 100644 --- a/activeresource/lib/active_resource/validations.rb +++ b/activeresource/lib/active_resource/validations.rb @@ -93,9 +93,9 @@ module ActiveResource # content-type of the error-block received def load_remote_errors(remote_errors, save_cache = false ) #:nodoc: case remote_errors.response['Content-Type'] - when 'application/xml' + when /xml/ errors.from_xml(remote_errors.response.body, save_cache) - when 'application/json' + when /json/ errors.from_json(remote_errors.response.body, save_cache) end end -- cgit v1.2.3