Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
brennana committed Aug 21, 2024
2 parents e24da03 + 83587c2 commit 8575318
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ 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

## 1.1.0
* Add support for Ecto 1.11

## 1.0.0

* Introduce support for Ecto 3
Expand Down
7 changes: 7 additions & 0 deletions lib/mongo_ecto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,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
Expand All @@ -475,6 +479,8 @@ defmodule Mongo.Ecto do
:error
end

defp load_objectid(nil), do: {:ok, nil}

defp load_objectid(_arg), do: :error

@impl true
Expand Down Expand Up @@ -573,6 +579,7 @@ defmodule Mongo.Ecto do
ArgumentError -> :error
end

defp dump_objectid(nil), do: {:ok, nil}
defp dump_objectid(_), do: :error

@impl Ecto.Adapter.Schema
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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.2"

def project do
[
Expand Down

0 comments on commit 8575318

Please sign in to comment.