From 9eaf5f68ece4cd4049b4ddb2ca4cc0c388f84768 Mon Sep 17 00:00:00 2001 From: Scott Ames-Messinger Date: Fri, 15 Dec 2023 22:42:21 -0500 Subject: [PATCH 1/4] Fix: Allow binary_id fields to be nil --- lib/mongo_ecto.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/mongo_ecto.ex b/lib/mongo_ecto.ex index 7e6daf3..5f8049c 100644 --- a/lib/mongo_ecto.ex +++ b/lib/mongo_ecto.ex @@ -496,6 +496,8 @@ defmodule Mongo.Ecto do :error end + defp load_objectid(nil), do: {:ok, nil} + defp load_objectid(_arg), do: :error @impl true @@ -589,6 +591,7 @@ defmodule Mongo.Ecto do ArgumentError -> :error end + defp dump_objectid(nil), do: {:ok, nil} defp dump_objectid(_), do: :error @impl Ecto.Adapter.Schema From 557aea52bf8fe690250f8cd85980f55557d8feed Mon Sep 17 00:00:00 2001 From: Scott Ames-Messinger Date: Fri, 15 Dec 2023 22:43:08 -0500 Subject: [PATCH 2/4] 1.1.1 --- CHANGELOG.md | 6 ++++++ mix.exs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c647b69..6738f18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 1.1.1 +* Allow `binary_id` fields to be nil + +## 1.1.0 +* Add support for Ecto 1.11 + ## 1.0.0 * Introduce support for Ecto 3 diff --git a/mix.exs b/mix.exs index 5060a7d..a4f8c1d 100644 --- a/mix.exs +++ b/mix.exs @@ -2,7 +2,7 @@ defmodule Mongo.Ecto.Mixfile do use Mix.Project @source_url "https://github.com/elixir-mongo/mongodb_ecto" - @version "1.1.0" + @version "1.1.1" def project do [ From 02fb4d2abf350292e82e7936cd3f9253de25338b Mon Sep 17 00:00:00 2001 From: Scott Ames-Messinger Date: Tue, 16 Apr 2024 21:52:23 -0600 Subject: [PATCH 3/4] Add support for loading nil dates --- lib/mongo_ecto.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/mongo_ecto.ex b/lib/mongo_ecto.ex index 5f8049c..c2738e2 100644 --- a/lib/mongo_ecto.ex +++ b/lib/mongo_ecto.ex @@ -474,6 +474,10 @@ defmodule Mongo.Ecto do defp load_time(time), do: time + defp load_date(nil) do + {:ok, nil} + end + defp load_date(date) do {:ok, date |> DateTime.to_date()} end From 83587c2c5d14f5956ad78ffaba62630515e44e06 Mon Sep 17 00:00:00 2001 From: Scott Ames-Messinger Date: Tue, 16 Apr 2024 21:53:11 -0600 Subject: [PATCH 4/4] 1.1.2 --- CHANGELOG.md | 3 +++ mix.exs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6738f18..4936c22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 1.1.2 +* Add support for loading nil dates + ## 1.1.1 * Allow `binary_id` fields to be nil diff --git a/mix.exs b/mix.exs index a4f8c1d..b03425d 100644 --- a/mix.exs +++ b/mix.exs @@ -2,7 +2,7 @@ defmodule Mongo.Ecto.Mixfile do use Mix.Project @source_url "https://github.com/elixir-mongo/mongodb_ecto" - @version "1.1.1" + @version "1.1.2" def project do [