diff options
Diffstat (limited to 'activeresource/lib')
-rw-r--r-- | activeresource/lib/active_resource/railtie.rb | 8 | ||||
-rw-r--r-- | activeresource/lib/active_resource/validations.rb | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/activeresource/lib/active_resource/railtie.rb b/activeresource/lib/active_resource/railtie.rb index 1b9307d472..7e35fdc0eb 100644 --- a/activeresource/lib/active_resource/railtie.rb +++ b/activeresource/lib/active_resource/railtie.rb @@ -3,9 +3,15 @@ require "rails" module ActiveResource class Railtie < Rails::Railtie - plugin_name :active_resource + railtie_name :active_resource require "active_resource/railties/subscriber" subscriber ActiveResource::Railties::Subscriber.new + + initializer "active_resource.set_configs" do |app| + app.config.active_resource.each do |k,v| + ActiveResource::Base.send "#{k}=", v + end + end end end
\ No newline at end of file diff --git a/activeresource/lib/active_resource/validations.rb b/activeresource/lib/active_resource/validations.rb index 7b2382bd8c..4774c6dd22 100644 --- a/activeresource/lib/active_resource/validations.rb +++ b/activeresource/lib/active_resource/validations.rb @@ -101,10 +101,10 @@ module ActiveResource # Loads the set of remote errors into the object's Errors based on the # content-type of the error-block received def load_remote_errors(remote_errors, save_cache = false ) #:nodoc: - case remote_errors.response['Content-Type'] - when /xml/ + case self.class.format + when ActiveResource::Formats[:xml] errors.from_xml(remote_errors.response.body, save_cache) - when /json/ + when ActiveResource::Formats[:json] errors.from_json(remote_errors.response.body, save_cache) end end |