lib/restful_model_collection.rb in inbox-0.18.2 vs lib/restful_model_collection.rb in inbox-1.0.0

- old
+ new

@@ -3,15 +3,14 @@ module Inbox class RestfulModelCollection attr_accessor :filters - def initialize(model_class, api, namespace_id, filters = {}) + def initialize(model_class, api, filters = {}) raise StandardError.new unless api.class <= Inbox::API @model_class = model_class @filters = filters - @namespace_id = namespace_id @_api = api end def each offset = 0 @@ -91,11 +90,11 @@ def build(args) for key in args.keys args[key.to_s] = args[key] end - model = @model_class.new(@_api, @namespace_id) + model = @model_class.new(@_api) model.inflate(args) model end def inflate_collection(items = []) @@ -113,11 +112,10 @@ end models end def url - prefix = "/n/#{@namespace_id}" if @namespace_id - @_api.url_for_path("#{prefix}/#{@model_class.collection_name}") + @_api.url_for_path("/#{@model_class.collection_name}") end private def get_model(id)