update_attributes ignoring persisted nested attributes validations

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • 3.0.5
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      As explained here (https://groups.google.com/forum/#!topic/mongoid/pREjqqSSnMU), mongoid seems to ignore nested attributes validation errors for existing (updated) nested documents.

      I had an answer on StackOverflow (http://stackoverflow.com/questions/11542244/rails-mongoid-update-attributes-ignoring-persisted-nested-attributes-validations/11688456#11688456) sending me to a fork commit that seems to fix this issue (didn't try yet...the fork is based on a very old version of mongoid 3 => I'll write a monkey patch since the fix is very simple).

      Here is the commit : https://github.com/jiren/mongoid/commit/9ebb8af8514ea70c66a7dbe64be20bc7407a2829 (only custom code in the fork)

      Maybe you can check if the fix is good enough (perf, ...) to be included in official repo ?

      Thanks !

            Assignee:
            Durran Jordan
            Reporter:
            gauthier-delacroix
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: