Possible to make with(safe: true) the default for a model?

XMLWordPrintableJSON

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

      Was wondering if it would be possible have safe saves be the default for a collection/model.

      We have .create! or .save! in various places around the code for this model. We try to remain vigilant about setting them to safe, but with a large code base, they can sneak in.

      The bug manifests itself when we create a new record of this model and then some other code needs to read it right after it's saved. It seems in production under load, once in a while the read will not find the newly saved record on the first read. We have consistency: :strong set, but if I'm understanding correctly it's not guaranteed to be readable right away unless we use with(safe: true). Thanks!

              Assignee:
              Unassigned
              Reporter:
              Brian Armstrong
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: