-
Story
-
Resolution: Done
-
Undefined
-
None
-
None
-
None
-
False
-
-
False
-
Unset
-
None
-
Right now the "paused_at" fields go embedded in any model that requires them. The suggestion is to remove the structure and to just use a plain "paused_at" pointer field in the models that require it.
The reasons are:
- The "Pause" structure only holds a "paused_at" field.
- The pointer to "time.Time" would allow us to insert "nil" values into the database, which is a perfectly valid value for a resource: if it is nil, the resource is "unpaused", if it has a date, it is considered to be "paused". Since we are using a non-pointer "time.Time" value, every time we insert a resource a default date gets inserted into the database, which makes it a little bit harder to query about the pause status than it needs to be.
Keep in mind to remove the extra "Where" condition with the default date on the "IsPaused" methods when working on this one.