From 691fbdf1d362e77ab5eb2c42e51844b54a69b058 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 25 Jan 2017 22:54:52 +0800 Subject: fix: delete attachment after remove comment. --- vendor/github.com/go-xorm/xorm/engine.go | 4 +++- vendor/github.com/go-xorm/xorm/session_delete.go | 2 +- vendor/github.com/go-xorm/xorm/session_update.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'vendor/github.com') diff --git a/vendor/github.com/go-xorm/xorm/engine.go b/vendor/github.com/go-xorm/xorm/engine.go index 1ee1589c31..7bd0df6e89 100644 --- a/vendor/github.com/go-xorm/xorm/engine.go +++ b/vendor/github.com/go-xorm/xorm/engine.go @@ -573,7 +573,7 @@ func (engine *Engine) Id(id interface{}) *Session { return session.Id(id) } -// ID mehtod provoide a condition as (id) = ? +// ID method provoide a condition as (id) = ? func (engine *Engine) ID(id interface{}) *Session { session := engine.NewSession() session.IsAutoClose = true @@ -1599,6 +1599,8 @@ func (engine *Engine) formatTime(tz *time.Location, sqlTypeName string, t time.T return t } if tz != nil { + t = t.In(tz) + } else { t = engine.TZTime(t) } switch sqlTypeName { diff --git a/vendor/github.com/go-xorm/xorm/session_delete.go b/vendor/github.com/go-xorm/xorm/session_delete.go index 8c9193c209..1c458fe1ea 100644 --- a/vendor/github.com/go-xorm/xorm/session_delete.go +++ b/vendor/github.com/go-xorm/xorm/session_delete.go @@ -226,7 +226,7 @@ func (session *Session) Delete(bean interface{}) (int64, error) { session.afterDeleteBeans[bean] = &afterClosures } } else { - if _, ok := interface{}(bean).(AfterInsertProcessor); ok { + if _, ok := interface{}(bean).(AfterDeleteProcessor); ok { session.afterDeleteBeans[bean] = nil } } diff --git a/vendor/github.com/go-xorm/xorm/session_update.go b/vendor/github.com/go-xorm/xorm/session_update.go index 17e5672ed2..27e2deb0fe 100644 --- a/vendor/github.com/go-xorm/xorm/session_update.go +++ b/vendor/github.com/go-xorm/xorm/session_update.go @@ -333,7 +333,7 @@ func (session *Session) Update(bean interface{}, condiBean ...interface{}) (int6 } } else { - if _, ok := interface{}(bean).(AfterInsertProcessor); ok { + if _, ok := interface{}(bean).(AfterUpdateProcessor); ok { session.afterUpdateBeans[bean] = nil } } -- cgit v1.2.3