aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource
diff options
context:
space:
mode:
authorlest <just.lest@gmail.com>2011-11-30 18:44:37 +0300
committerlest <just.lest@gmail.com>2011-11-30 18:57:17 +0300
commit93387e2e7c66fb34bde5442ad314c9c63729b75b (patch)
treea6bbed6caddbcd2f84e43792e1ff0e4ac30d0a99 /activeresource
parent565d92f57891c1114801a27cf45ba8ee4ec02cf9 (diff)
downloadrails-93387e2e7c66fb34bde5442ad314c9c63729b75b.tar.gz
rails-93387e2e7c66fb34bde5442ad314c9c63729b75b.tar.bz2
rails-93387e2e7c66fb34bde5442ad314c9c63729b75b.zip
fix deprecation warnings in activeresource
Diffstat (limited to 'activeresource')
-rw-r--r--activeresource/lib/active_resource/base.rb4
-rw-r--r--activeresource/lib/active_resource/custom_methods.rb48
2 files changed, 25 insertions, 27 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb
index 10cc727bd9..93991ab6b3 100644
--- a/activeresource/lib/active_resource/base.rb
+++ b/activeresource/lib/active_resource/base.rb
@@ -1477,7 +1477,7 @@ module ActiveResource
extend ActiveModel::Naming
include CustomMethods, Observing, Validations
include ActiveModel::Conversion
- include ActiveModel::Serializers::JSON
- include ActiveModel::Serializers::Xml
+ include ActiveModel::Serializable::JSON
+ include ActiveModel::Serializable::XML
end
end
diff --git a/activeresource/lib/active_resource/custom_methods.rb b/activeresource/lib/active_resource/custom_methods.rb
index f7cb381711..2a651dd48e 100644
--- a/activeresource/lib/active_resource/custom_methods.rb
+++ b/activeresource/lib/active_resource/custom_methods.rb
@@ -85,37 +85,35 @@ module ActiveResource
end
end
- module InstanceMethods
- def get(method_name, options = {})
- self.class.format.decode(connection.get(custom_method_element_url(method_name, options), self.class.headers).body)
- end
+ def get(method_name, options = {})
+ self.class.format.decode(connection.get(custom_method_element_url(method_name, options), self.class.headers).body)
+ end
- def post(method_name, options = {}, body = nil)
- request_body = body.blank? ? encode : body
- if new?
- connection.post(custom_method_new_element_url(method_name, options), request_body, self.class.headers)
- else
- connection.post(custom_method_element_url(method_name, options), request_body, self.class.headers)
- end
+ def post(method_name, options = {}, body = nil)
+ request_body = body.blank? ? encode : body
+ if new?
+ connection.post(custom_method_new_element_url(method_name, options), request_body, self.class.headers)
+ else
+ connection.post(custom_method_element_url(method_name, options), request_body, self.class.headers)
end
+ end
- def put(method_name, options = {}, body = '')
- connection.put(custom_method_element_url(method_name, options), body, self.class.headers)
- end
+ def put(method_name, options = {}, body = '')
+ connection.put(custom_method_element_url(method_name, options), body, self.class.headers)
+ end
- def delete(method_name, options = {})
- connection.delete(custom_method_element_url(method_name, options), self.class.headers)
- end
+ def delete(method_name, options = {})
+ connection.delete(custom_method_element_url(method_name, options), self.class.headers)
+ end
- private
- def custom_method_element_url(method_name, options = {})
- "#{self.class.prefix(prefix_options)}#{self.class.collection_name}/#{id}/#{method_name}.#{self.class.format.extension}#{self.class.__send__(:query_string, options)}"
- end
+ private
+ def custom_method_element_url(method_name, options = {})
+ "#{self.class.prefix(prefix_options)}#{self.class.collection_name}/#{id}/#{method_name}.#{self.class.format.extension}#{self.class.__send__(:query_string, options)}"
+ end
- def custom_method_new_element_url(method_name, options = {})
- "#{self.class.prefix(prefix_options)}#{self.class.collection_name}/new/#{method_name}.#{self.class.format.extension}#{self.class.__send__(:query_string, options)}"
- end
- end
+ def custom_method_new_element_url(method_name, options = {})
+ "#{self.class.prefix(prefix_options)}#{self.class.collection_name}/new/#{method_name}.#{self.class.format.extension}#{self.class.__send__(:query_string, options)}"
+ end
end
end