Skip to content

Instantly share code, notes, and snippets.

@paul
Created December 2, 2008 22:21
Show Gist options
  • Save paul/31293 to your computer and use it in GitHub Desktop.
Save paul/31293 to your computer and use it in GitHub Desktop.
module SsbeQueryExtensions
attr_accessor :collection_uri
end
module SsbeModelExtensions
def collection(uri, query = {})
query = Query.new(self.repository, self)
query.extend(SsbeQueryExtensions)
query.collection_uri = uri
repository.read_many(query)
end
end
Model.send(:include, SsbeModelExtensions)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment