spider-gazelle / rethinkdb-orm

RethinkDB ORM for Crystal lang
MIT License
24 stars 0 forks source link

refactor!: update active-model using `JSON::Serializable` #21

Closed caspiano closed 2 years ago

caspiano commented 3 years ago

Thanks @dukeraphaelng!

dukenguyenxyz commented 3 years ago

Currently throwing the following compiler

Error: can't annotate @id in RethinkORM::Lock because it was first defined in RethinkORM::Base

This is due to the following breaking change in 0.36.0 https://github.com/crystal-lang/crystal/pull/9502

dukenguyenxyz commented 3 years ago

I have no idea why name_was is getting serialised https://travis-ci.org/github/spider-gazelle/rethinkdb-orm/builds/764191628#L255-L264

All specs even the _was related one passed on active-model branch https://github.com/spider-gazelle/active-model/tree/json_yaml

@{{name}}_was is declared twice, here and here, and in the second one, JSON annotation is not present, however I cannot add the annotation there, the compiler yells that I cannot annotate an inherited instance_var

@caspiano

caspiano commented 3 years ago

@kimburgess @dukeraphaelng There seems to be an issue with redefining annotations when inheriting a model that has defined an attribute. Any ideas?

dukenguyenxyz commented 3 years ago

@caspiano as mentioned above, this is due to https://github.com/spider-gazelle/rethinkdb-orm/pull/21#issuecomment-782791469