From dba5c808178b14955a38ddfd33a4bc6728097a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 5 May 2015 12:17:08 +0200 Subject: [PATCH] Release v0.11.1 --- CHANGELOG.md | 8 ++++++++ lib/ecto/changeset.ex | 8 ++++---- lib/ecto/type.ex | 2 +- mix.exs | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfaed1aebe..00b40ed059 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## v0.11.1 (2015-05-05) + +* Enhancements + * Add `force_change/3` to force a change into a changeset + +* Bug fixes + * `put_change/3`, `put_new_change/3` and `change/2` in `Ecto.Changeset` also verify the model value before storing the change + ## v0.11.0 (2015-05-04) * Enhancements diff --git a/lib/ecto/changeset.ex b/lib/ecto/changeset.ex index de066f2eec..0858bc0e73 100644 --- a/lib/ecto/changeset.ex +++ b/lib/ecto/changeset.ex @@ -51,6 +51,7 @@ defmodule Ecto.Changeset do @doc """ Wraps the given model in a changeset or adds changes to a changeset. + Changed attributes will only be added if the change does not have the same value as the attribute in the model. @@ -64,9 +65,9 @@ defmodule Ecto.Changeset do `changes` to be atoms. `changes` can be a map as well as a keyword list. When a changeset is passed as the first argument, the changes passed as the - second argument are merged over the changes already in the changeset (with - precedence to the new changes) without checking the model. If `changes` is - not present or is an empty map, this function is a no-op. + second argument are merged over the changes already in the changeset if they + differ from the values in the model. If `changes` is an empty map, this + function is a no-op. See `cast/4` if you'd prefer to cast and validate external parameters. @@ -536,7 +537,6 @@ defmodule Ecto.Changeset do update_in changeset.changes, &Map.put(&1, key, value) end - @doc """ Puts a change on the given `key` only if a change with that key doesn't already exist, also, if the change has the same value as the model, it diff --git a/lib/ecto/type.ex b/lib/ecto/type.ex index 3c3f22b441..f35d6305c8 100644 --- a/lib/ecto/type.ex +++ b/lib/ecto/type.ex @@ -3,7 +3,7 @@ defmodule Ecto.Type do Defines functions and the `Ecto.Type` behaviour for implementing custom types. - A custom type expects 5 functions to be implemented, all documented + A custom type expects 4 functions to be implemented, all documented and described below. We also provide two examples of how custom types can be used in Ecto to augment existing types or providing your own types. diff --git a/mix.exs b/mix.exs index e942ffaee5..02d1509c12 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Ecto.Mixfile do use Mix.Project - @version "0.11.0" + @version "0.11.1" @adapters [:pg, :mysql] def project do