Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return results from invalid outcomes #212

Closed
wants to merge 1 commit into from
Closed

Return results from invalid outcomes #212

wants to merge 1 commit into from

Conversation

tfausak
Copy link
Collaborator

@tfausak tfausak commented Aug 14, 2014

Fixes #168.

>> class Example < ActiveInteraction::Base
>>   boolean :b
>>   def execute
>>     errors.add(:b, 'falsey') unless b
>>     :something
>>   end
>> end
=> nil
>> outcome = Example.run(b: false)
=> #<Example:0x007fd16b5f8658 @b=false, @_interaction_errors=#<ActiveInteraction::Errors:0x007fd16b5f8310 @symbolic={}, @base=#<Example:0x007fd16b5f8658 ...>, @messages={:b=>["falsey"]}>, @_interaction_result=:something, @validation_context=nil, @_interaction_valid=false>
>> outcome.invalid?
=> true
>> outcome.result
=> :something

Needs review from @AaronLasseigne.

(Like #211, this should be merged into v2.0.0.)

@tfausak tfausak added this to the v2.0.0 milestone Aug 14, 2014
@tfausak tfausak self-assigned this Aug 14, 2014
@tfausak tfausak changed the title Fix #168; return results from invalid outcomes Return results from invalid outcomes Aug 15, 2014
@tfausak
Copy link
Collaborator Author

tfausak commented Aug 15, 2014

👉 #214

@tfausak tfausak closed this Aug 15, 2014
@tfausak tfausak deleted the gh-168 branch August 15, 2014 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return a result even when validation fails?
1 participant