(raw any)
| 167 | } |
| 168 | |
| 169 | func (f *RelationField) normalizeValue(raw any) any { |
| 170 | val := list.ToUniqueStringSlice(raw) |
| 171 | |
| 172 | if !f.IsMultiple() { |
| 173 | if len(val) > 0 { |
| 174 | return val[len(val)-1] // the last selected |
| 175 | } |
| 176 | return "" |
| 177 | } |
| 178 | |
| 179 | return val |
| 180 | } |
| 181 | |
| 182 | // DriverValue implements the [DriverValuer] interface. |
| 183 | func (f *RelationField) DriverValue(record *Record) (driver.Value, error) { |
no test coverage detected