You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you making the variable $sprig to a new object in between these loads?
My guess:
If you are not, it might not be incorrect behavior by Sprig. Since the object is already loaded from database, loaded() is returning true (_loaded is set to true). If you are calling load() again, the _loaded variable is not changed (maybe it should be set to false) and is therefore still true.
Long time since last post, but still:
I would suggest setting ->_loaded to false when a ->delete() is done. This might be a bit against the true meaning of 'loaded', since the element was loaded succesfully, but I think what one really wants to know when one calls ->loaded() is whether the element exists or not.
Another option would be to add an extra option ->exists() that returns to false when ->delete() is executed, and has the same value as ->loaded() at all other times.
TestCase One:
TestCase 2:
The text was updated successfully, but these errors were encountered: