Closed matryer closed 11 years ago
If you've loaded a resource already, this approach makes it more difficult to save that resource back. You have to re-type/re-do the path. I suppose you could do resource.Path as the argument to At(), but that seems a bit ridiculous.
Tyler
I think we should add some helper methods to resources that takes away that pain a little.
tylerResource.Set("name", "Tyler")
err := tylerResource.Save(session)
That way, if people just need to quickly save a resource, they can do this. If they need something a little more advanced (like turning timestamps off for this particular resource), then they can use the advanced version:
Stretchr.At(tylerResource.ResourcePath()).WithStamps(false).Update()
Done.
Pros:
Stretchr.At("people")....
Cons:
Save
method to resources?