Skip to content

Commit

Permalink
Fix indentation for merge_attributes/2 example (#342)
Browse files Browse the repository at this point in the history
Fixes indentation for `merge_attributes/2` example.
  • Loading branch information
lcezermf authored and germsvel committed Apr 12, 2019
1 parent a88d8dc commit 8613906
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/ex_machina.ex
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,16 @@ defmodule ExMachina do
## Example
# custom factory
def article_factory(attrs) do
title = Map.get(attrs, :title, "default title")
# custom factory
def article_factory(attrs) do
title = Map.get(attrs, :title, "default title")
article = %Article{
title: title
}
article = %Article{
title: title
}
merge_attributes(article, attrs)
end
merge_attributes(article, attrs)
end
Note that when trying to merge attributes into a struct, this function will
raise if one of the attributes is not defined in the struct.
Expand Down

0 comments on commit 8613906

Please sign in to comment.