Add transaction when Note is updated.
Add by_done_at scope to Note model.
Add by_id class method to Photo model.
Add detect_done_at method to Note class.