fixing tests
This commit is contained in:
parent
a4990ef7fd
commit
25674faa7d
@ -4,8 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/jinzhu/gorm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
@ -39,7 +37,7 @@ func (m *ComplexWidget) GetType() string {
|
|||||||
return "complex"
|
return "complex"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *WidgetUser) EncodeField(scope *gorm.Scope, column string) (interface{}, error) {
|
func (m *WidgetUser) EncodeField(column string) (interface{}, error) {
|
||||||
switch column {
|
switch column {
|
||||||
case "widget":
|
case "widget":
|
||||||
val, err := json.Marshal(m.Widget)
|
val, err := json.Marshal(m.Widget)
|
||||||
@ -52,7 +50,7 @@ func (m *WidgetUser) EncodeField(scope *gorm.Scope, column string) (interface{},
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *WidgetUser) DecodeField(scope *gorm.Scope, column string, value interface{}) error {
|
func (m *WidgetUser) DecodeField(column string, value interface{}) error {
|
||||||
switch column {
|
switch column {
|
||||||
case "widget":
|
case "widget":
|
||||||
b, ok := value.([]byte)
|
b, ok := value.([]byte)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user