Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-2837

errors.add :base, "..." doesn't seem to prevent save

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

      I came across this but wasn't sure if it was a bug or the intended behavior.

      l = Log.new
      l.errors.add :base, "test"
      l.save
      => true
      

      `

      I'm trying this with a simple model:

      Unable to find source-code formatter for language: `ruby. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      class Log
        include Mongoid::Document
        include Mongoid::Timestamps
      
        field :text, type: String
      end
      

      With an error added it should prevent the save right? I'm not sure if some other gem could be interfering? This is with mongoid 3.0.18. Thanks!

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

              Created:
              Updated:
              Resolved: