From 86139065a8bbe09c75f7392e6e2bc78f2b67df13 Mon Sep 17 00:00:00 2001 From: Luiz Cezer Date: Fri, 12 Apr 2019 10:37:57 -0300 Subject: [PATCH] Fix indentation for merge_attributes/2 example (#342) Fixes indentation for `merge_attributes/2` example. --- lib/ex_machina.ex | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ex_machina.ex b/lib/ex_machina.ex index 55971ae..34717dc 100644 --- a/lib/ex_machina.ex +++ b/lib/ex_machina.ex @@ -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.