Skip to content


breaks when using autosave mode #13

aserafin opened this Issue · 3 comments

2 participants


Consider this code

class Foo
  has_many :bars, autosave: true

bars are validated with special AssociationValidator that will copy errors from bars to the parent Foo object and this breaks HumanMessageFormatter value method.

I don't really care about error messages from Bar in Foo so I've just overriden AssociationValidator class in my project to not put them there.

Another solution would be to rescue nil in this method

  def value
    return if attribute == :base
    base.send :read_attribute_for_validation, attribute rescue nil

in HumanMessageFormatter but it's not the most elegant way.

BTW. awesome library, huge improvement from standard activemodel errors :)


I'll try reproduce this with a spec first, then I'll see what's the best way to fix this


This ActiveRecord specific, since ActiveModel seem to handle this differently. I need to dig into ActiveRecord to see how they are integrated.

@aq1018 aq1018 closed this in 1fe1433

v1.6.6 released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.