lib/restly/base/resource/finders.rb in restly-0.0.1.alpha.2 vs lib/restly/base/resource/finders.rb in restly-0.0.1.alpha.3

- old
+ new

@@ -1,23 +1,21 @@ module Restly::Base::Resource::Finders - def find(*args) + def find(id, *args) options = args.extract_options! #params[pagination_options[:params][:page]] = options[:page] if pagination - instance_from_response connection.get(path_with_format(args.first), params: params) + instance_from_response connection.get(path_with_format(id), params: params) end def all collection_from_response connection.get(path_with_format, params: params) end def create(attributes = nil, options = {}) instance = self.new(attributes, options) instance.save end - - private def collection_from_response(response) raise Restly::Error::InvalidResponse unless response.is_a? OAuth2::Response Restly::Collection.new self, nil, response: response end \ No newline at end of file