Skip to content

Commit

Permalink
Remove assoc/3 deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcsmith committed Mar 4, 2016
1 parent be31cda commit ddc8837
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions lib/ex_machina/ecto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,6 @@ defmodule ExMachina.Ecto do
def save_record(record) do
ExMachina.Ecto.save_record(@repo, record)
end

defp assoc(_, factory_name, _ \\ nil) do
raise """
assoc/3 has been removed. Please use build instead. Built records will be automatically saved when you call create.
def factory(#{factory_name}) do
%{
...
some_assoc: build(:some_assoc)
...
}
end
"""
end
end
else
raise ArgumentError,
Expand Down Expand Up @@ -139,7 +125,7 @@ defmodule ExMachina.Ecto do
## Example
# Will save the article and list of comments
create(:article, comments: [build(:comment)])
insert(:article, comments: [build(:comment)])
"""
def save_record(repo, %{__meta__: %{__struct__: Ecto.Schema.Metadata}} = record) do
repo.insert!(record)
Expand Down

0 comments on commit ddc8837

Please sign in to comment.