()
| 55 | } |
| 56 | |
| 57 | func (m *Attachment) Delete() (err error) { |
| 58 | o := orm.NewOrm() |
| 59 | |
| 60 | if _, err = o.Delete(m); err != nil { |
| 61 | return err |
| 62 | } |
| 63 | |
| 64 | return os.Remove(strings.TrimLeft(m.FilePath, "./")) |
| 65 | } |
| 66 | |
| 67 | func (m *Attachment) Find(id int) (*Attachment, error) { |
| 68 | if id <= 0 { |
nothing calls this directly
no outgoing calls
no test coverage detected