Closed msalvadores closed 5 years ago
Correct usage for find from now:
instance = Model.find("boo")
instance.load unless instance.loaded?
puts instance.attr
the returned instance is not loaded. It is just a reference. To access the attributes one should do instance.load
to be safe we can always check the loaded?
flag.
Notice that find
returns nil
when the object cannot does not exist. This behavior was like this in previous versions.
Changed to load attributes on find by default and an option to opt out.
Eventually find will not load the attributes and they will loaded on demand (see #62)
This is either resolved, or no longer needed.
For consistency with
where
andall
and to avoid confusion and improve performance. Find might be use to see if a resource exists.