maiera / gde-app

Apache License 2.0
22 stars 9 forks source link

Logical deletion for Activity records #184

Closed Scarygami closed 9 years ago

Scarygami commented 9 years ago

Implementation of https://github.com/maiera/gde-app/issues/99

Activity records now have a boolean field deleted Calling activity_record.delete will set this field to True and store the record. To undelete you call activity_record.update (with full AR information, same as you already do when saving entities from the frontend) and deleted set to False

activity_record.list by default only returns items with deleted=False

To get all activity_records you can use includeDeleted=true as query parameter.

To get only the deleted items you can use includeDeleted=true&deleted=true

When going live we have to set deleted to False for all existing entities in the datastore otherwise the result of activity_record.list would be empty.

I also changed the gplus update task to automatically skip posts if they are associated with a deleted activity_record.

SmokyBob commented 9 years ago

Frontend changes are ready for testing in #185

Scarygami commented 9 years ago

Ok, so there are two "delete" methods now.

activity_record.trash (activityRecord/trash/{id}) will logically delete the activity

activity_record.delete (activityRecord/delete/{id}) which is currently used by the front-end for merging activities, will remove the activity completely from the datastore. This method also marks any associated activity posts as deleted to prevent them from re-creating the activity during updates.

SmokyBob commented 9 years ago

@patt0 @Scarygami can you please deploy these changes to the staging environment? This way I can add and test the features to the front-end and deploy on the staging web Env for user acceptance

patt0 commented 9 years ago

I am deploying this in Firefly for now, once we have done some testing I will move it to Omega ( production)