+ t.add :writable_by
+ t.add :delete_at
+ t.add :trash_at
+ t.add :is_trashed
+ t.add :properties
+ end
+
+ def maybe_invalidate_permissions_cache
+ if uuid_changed? or owner_uuid_changed? or is_trashed_changed?
+ # This can change users' permissions on other groups as well as
+ # this one.
+ invalidate_permissions_cache
+ end
+ end
+
+ def invalidate_permissions_cache
+ # Ensure a new group can be accessed by the appropriate users
+ # immediately after being created.
+ User.invalidate_permissions_cache self.async_permissions_update
+ end
+
+ def assign_name
+ if self.new_record? and (self.name.nil? or self.name.empty?)
+ self.name = self.uuid
+ end
+ true