neo4jrb / activegraph

An active model wrapper for the Neo4j Graph Database for Ruby.
http://neo4jrb.io
MIT License
1.4k stars 276 forks source link

BigDecimal type converter missing #1615

Closed mstrofbass closed 3 years ago

mstrofbass commented 4 years ago

Upgrading to activegraph and got the error Unable to cast to type BigDecimal. Dug into the code and it appears that there is no type converter for BigDecimal in activegraph 10.0.0. The require statements are still there, it's simply missing the block of code.

The documentation still explicitly says that BigDecimal is a permitted type so, unless I'm missing something, it appears that one of the following needs to occur:

  1. Type converter for BigDecimal needs to be added to lib/active_graph/shared/type_converters.rb and a test for the BigDecimal converter should be added; or
  2. The documentation should be updated to indicate that BigDecimal is not a type in docs/Properties.rst and a note should be added to the upgrade guide docs/UpgradeGuide.rst

In addition, the error message in lib/active_graph/shared/typecasted_attributes.rb at line 71 should be updated to be something more along the lines of No TypeCaster for #{type} found. which better reflects the actual error.

klobuczek commented 4 years ago

@mstrofbass you are right. BigDecimal shouldn't have been removed from activegraph.