ecto-ulid icon indicating copy to clipboard operation
ecto-ulid copied to clipboard

Add ecto 3.5 comaptibilty

Open sztosz opened this issue 5 years ago • 12 comments

Adds required callbacks implementations embed_as/1 and equal?/2 for Ecto.Type behaviour

sztosz avatar Oct 19 '20 15:10 sztosz

Thanks @sztosz. Could you add unit tests that document this functionality?

markusfeyh avatar Oct 19 '20 16:10 markusfeyh

Sure, will add them tomorrow.

sztosz avatar Oct 19 '20 17:10 sztosz

@markusfeyh I added unit tests, and they work with Ecto 3.5, but they are not backward compatible with earlier versions because embeded_dump and embeded_load were added only in Ecto 3.4.1.

Should I just drop the tests with embed_as, which de facto tests not the Ecto.ULID library but if Ecto does it job correctly, or rather try to rewrite those tests to be backward compatible?

sztosz avatar Oct 20 '20 13:10 sztosz

Would it be possible to add a check if the ecto version is greater than 3.5 so those tests are only run in that case?

markusfeyh avatar Oct 20 '20 17:10 markusfeyh

Probably the best solution. But I also am not sure any more If it should be :dump or :self. I need to rethink it and rewrite it. But running those tests only on 3.5 makes a lot of sense.

sztosz avatar Oct 20 '20 18:10 sztosz

What about doing like I did in my PR ? Code will be managed in Ecto.Type here

xward avatar Oct 26 '20 13:10 xward

I've got other things on my mind right now, so changed it to draft. I may find some time later in the week. Changing behaviour to just use may work, but it does not enforce that public API stays same in proper way.

sztosz avatar Oct 27 '20 07:10 sztosz

Agree with @xward, I sent the same fix #5 over a year ago. 🙂

@dcuddeback If you are no longer interested in this project, may I take over?

I rely on this package heavily and evidently many do.

jayjun avatar Nov 19 '20 22:11 jayjun

@jayjun If you fork it, update, and fix it, I'll be glad to make the project I work on switch to it. We're doing daily a lot of builds in our pipelines, so it may give new library some stats in hex.pm that would make deprecation of this package easier, that's of course with assumption that @dcuddeback will not respond in timely manner.

I totally understand that @dcuddeback does not maintain it any more for whatever reasons, and I'm OK with that. I can only thank him, and thank any person that will carry on with making ULID's compatible with current and further versions of ecto.

sztosz avatar Nov 20 '20 09:11 sztosz

@sztosz I managed to contact dcuddeback and long story short, TheRealReal has assigned people to look into this. They seem like an active company so I won’t consider forking yet.

jayjun avatar Nov 21 '20 00:11 jayjun

Any updates on this? Is there a better fork?

lpgauth avatar Feb 21 '22 16:02 lpgauth

@lpgauth Version 0.3.0 adds the required callback implementations for Ecto ~> 3.2. They just forgot to update the changelog. It was published shortly after I published a fork on Hex, which includes a few more minor changes, including the type from #6 and improved documentation.

woylie avatar Mar 19 '22 06:03 woylie