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

Raise errors or warnings on invalid configuration options

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

      For the longest time, I had my mongoid.yml configured incorrectly:

      Unable to find source-code formatter for language: yml. 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
      production:
        sessions:
          default:
            uri: <%= ENV['MONGOHQ_URL'] %>
            options:
              skip_version_check: true
              safe: true
              identity_map_enabled: true
      

      instead of

      Unable to find source-code formatter for language: yml. 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
      production:
        sessions:
          default:
            uri: <%= ENV['MONGOHQ_URL'] %>
            options:
              skip_version_check: true
              safe: true
        options:
          identity_map_enabled: true
      

      The development section was configured correctly, but wasn't obviously different, because of documentation comments interspersed.

      Subtly, this resulted in the identity map only being off in production (through several months and a couple subtle bugs). It would be wonderful if the former case printed some sort of a warning on server start-up.

      Happy to write a pull, if desired.

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

              Created:
              Updated:
              Resolved: