diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..416e265 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +## v0.1.1 +* Fix: the encoding process is not respecting the `Field.model` property. + +## v0.1.0 +* First release. diff --git a/lib/manager.dart b/lib/manager.dart index 1496eda..07754ae 100644 --- a/lib/manager.dart +++ b/lib/manager.dart @@ -106,7 +106,11 @@ mapper.FieldDecoder _fieldDecoder = (Object data, String fieldName, mapper.FieldEncoder _fieldEncoder = (Map data, String fieldName, mapper.Field fieldInfo, List metadata, Object value) { - data[fieldName] = value; + String name = fieldInfo.model; + if (name == null) { + name = fieldName; + } + data[name] = value; }; mapper.GenericTypeCodec _codec = new mapper.GenericTypeCodec( diff --git a/pubspec.yaml b/pubspec.yaml index 6c520f1..055aedf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: redstone_mapper_pg -version: 0.1.0 +version: 0.1.1 author: Luiz Mineo description: PostgreSQL extension for redstone_mapper homepage: http://redstonedart.org