Skip to content

Commit

Permalink
Release v2.2.0-rc.1
Browse files Browse the repository at this point in the history
  • Loading branch information
José Valim committed Aug 18, 2017
1 parent c365a44 commit 394cb70
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Ecto now supports specifying fields sources. This is useful when you use a datab
field :name, :string, source: :NAME
field :user_name, :string, source: :"user-name"

The source option can be specified programatically by given a function to `@field_source_mapper` that receives the field name as an atom and returns the source name as an atom.

On the migrations side, `execute/2` function was added, which allows developers to describe up and down commands inside the `change` callback:

def change do
Expand All @@ -24,6 +26,19 @@ The query syntax also seen some improvements: map updates are supported in subqu

Finally, the UPSERT support added on Ecto v2.1 is getting more improvements: the `{:constraint, constraint}` is now supported as conflict target and the `:returning` option was added to `Ecto.Repo.insert/2`, mirroring the behaviour of `insert_all`.

## v2.2.0-rc.1 (2017-08-18)

### Regressions

* [Ecto.UUID] Remove UUID version validation as it is not part of the RFC
* [Ecto.Adapters.Postgres] No longer add parens to migration index expression in order to support NULL/ASC/DESC

### Enhancements

* [Ecto.Changeset] Add `unsafe_validate_unique/3` which validates uniqueness for faster feedback cycles but without data-integrity guarantees
* [Ecto.Query] Support aggregations in `type/2` in select
* [Ecto.Schema] Support `@field_source_mapper` in `Ecto.Schema` as a mechanism to programatically set the `:source` option

## v2.2.0-rc.0 (2017-08-08)

### Enhancements
Expand Down
6 changes: 5 additions & 1 deletion lib/ecto/query/api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,14 @@ defmodule Ecto.Query.API do
type(fragment("NOW"), :naive_datetime)
Or on fields for schemaless queries:
Or to type fields from schemaless queries:
from p in "posts", select: type(p.cost, :decimal)
Or to type aggregation results:
from p in Post, select: type(avg(p.cost), :integer)
"""
def type(interpolated_value, type), do: doc! [interpolated_value, type]

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Ecto.Mixfile do
use Mix.Project

@version "2.2.0-rc.0"
@version "2.2.0-rc.1"
@adapters [:pg, :mysql]

def project do
Expand Down

0 comments on commit 394cb70

Please sign in to comment.