Skip to content

Commit

Permalink
Fix #328; merge errors instead of records
Browse files Browse the repository at this point in the history
  • Loading branch information
tfausak committed Dec 10, 2015
1 parent dbc12f0 commit e7f5094
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -1192,7 +1192,7 @@ class UpdateUser < ActiveInteraction::Base

def execute
user.birthday = birthday if given?(:birthday)
errors.merge!(user) unless user.save
errors.merge!(user.errors) unless user.save
user
end
end
Expand Down
2 changes: 1 addition & 1 deletion example/app/interactions/things/create_thing.rb
Expand Up @@ -16,7 +16,7 @@ def to_model

def execute
thing = Thing.new(inputs)
errors.merge!(thing) unless thing.save
errors.merge!(thing.errors) unless thing.save
thing
end
end
2 changes: 1 addition & 1 deletion example/app/interactions/things/update_thing.rb
Expand Up @@ -20,7 +20,7 @@ def to_model

def execute
thing.name = name if name?
errors.merge!(thing) unless thing.save
errors.merge!(thing.errors) unless thing.save
thing
end
end

0 comments on commit e7f5094

Please sign in to comment.