byroot / activerecord-typedstore

ActiveRecord::Store but with type definition
MIT License
437 stars 57 forks source link

Use `ActiveRecord`s type lookup #77

Closed apauly closed 4 years ago

apauly commented 4 years ago

It would be really cool if the gem would use ActiveRecord::Type.lookup at least as a fallback to allow using custom types that have been registered via ActiveRecord::Type.register.

Is there a certain reason why ARs api is not being used? I could provide a PR if you like the idea.

byroot commented 4 years ago

Is there a certain reason why ARs api is not being used?

Mostly because this library predates the AR types API. If I had to do it again today that's indeed very likely I'd use those.

If you manage to refactor the library using AR types, with minimal backward incompatibility then yeah I'm interested. But if there is any significant backward compatibility breakage, not really.

apauly commented 4 years ago

Alright, I can definitely relate to that ;) Thanks for your super quick answer! I'll close this for now, but we'll discuss it internally.

Thanks and best, Alex