Skip to content

Commit

Permalink
always return the same type
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronLasseigne committed Apr 5, 2015
1 parent 85ec343 commit 8d4ca60
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Expand Up @@ -736,11 +736,11 @@ class CreateAccount < ActiveInteraction::Base
def execute
account = Account.new(inputs)

if account.save
account
else
unless account.save
errors.merge!(account.errors)
end

account
end
end
```
Expand Down Expand Up @@ -848,11 +848,11 @@ class UpdateAccount < ActiveInteraction::Base
account.first_name = first_name if first_name?
account.last_name = last_name if last_name?

if account.save
account
else
unless account.save
errors.merge!(account.errors)
end

account
end
end
```
Expand Down Expand Up @@ -1076,11 +1076,11 @@ class UpdateThing < ActiveInteraction::Base
model :thing

def execute
if thing.save
thing
else
unless thing.save
errors.merge!(thing.errors)
end

thing
end
end
```
Expand Down

0 comments on commit 8d4ca60

Please sign in to comment.