makandra / active_type

Make any Ruby object quack like ActiveRecord
MIT License
1.09k stars 74 forks source link

index_errors option to nests_many #74

Closed kdiogenes closed 7 years ago

kdiogenes commented 7 years ago

I will write tests for it soon, I opened the pull-request to get feedback.

triskweline commented 7 years ago

Is this a feature that exists in vanilla ActiveRecord? I'm not familiar with it, maybe you can point to documentation that describes the intended behavior?

kdiogenes commented 7 years ago

This is a Rails 5 feature: https://github.com/rails/rails/pull/19686

triskweline commented 7 years ago

OK thanks.

Code looks good. I would maybe resolve the expression !@options[:index_errors] && !ActiveRecord::Base.index_nested_attribute_errors in the constructor instead of during validations.

We can merge it once tests are in place.

kdiogenes commented 7 years ago

@triskweline did you noticed my last commits to this?

triskweline commented 7 years ago

I'm afraid Github doesn't send a notifications when new commits a pushed to an existing PR.

Looks good now, thanks!

I just released these changes as 0.7.0.