component / model

Minimalistic extensible data models
122 stars 40 forks source link

Make it possible to Model.get() without an ID (for single-resource endpoints) #54

Closed johntron closed 4 years ago

johntron commented 10 years ago

Makes it possible to Model.get() without an ID (for single-resource endpoints).

ianstormtaylor commented 10 years ago

no idea if the use case is valid. are you doing Model.get(undefined, function(){ ... though? would be nice (if valid use case) to just be able to do Model.get(function(){ ... instead

johntron commented 10 years ago

Nah, we've got an endpoint that returns the devices on a machine (same for all users), and I want to be able to get this list without having to give it an ID:

var Devices = model('Devices');
Devices.get();
johntron commented 10 years ago

Oh, I just saw Model.all(). Pretty much does the same thing, but semantically confusing in my case.