elixir-lang/ecto — pull request #261 by MSch (2014-08-19 14:26:38+00:00)
Title: [WIP] Ecto.Model.assign

I've started working on `Ecto.Model.assign` as described in https://github.com/elixir-lang/ecto/issues/258#issuecomment-52421545 and https://github.com/elixir-lang/ecto/issues/246

Currently open questions:
- `assign` should accept both a struct and a module right?

```elixir
assign(%User{name: "martin"}, %{name: "not martin"})
assign(User, %{name: "not martin"})
```

- `assign` should probably be generated by the `Ecto.Model.schema` macro and not use `model.__schema__(:field_names)` at runtime, right?

- `__schema__(:field_names)` doesn't return virtual fields, but there's no `__schema__(:virtual_field_names)`. Is there a reason why?