(raw any)
| 154 | } |
| 155 | |
| 156 | func (f *SelectField) normalizeValue(raw any) any { |
| 157 | val := list.ToUniqueStringSlice(raw) |
| 158 | |
| 159 | if !f.IsMultiple() { |
| 160 | if len(val) > 0 { |
| 161 | return val[len(val)-1] // the last selected |
| 162 | } |
| 163 | return "" |
| 164 | } |
| 165 | |
| 166 | return val |
| 167 | } |
| 168 | |
| 169 | // DriverValue implements the [DriverValuer] interface. |
| 170 | func (f *SelectField) DriverValue(record *Record) (driver.Value, error) { |
no test coverage detected