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

accepts_nested_attributes_for forces autosave: true / no possibility to set autosave: false

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

      How can one use accepts_nested_attributes_for with autosave: false?

      When using accepts_nested_attributes_for, option autosave is set to true by default (which is okay and mentioned in the documentation).

      However there is no possibility to explicitly request

      Unable to find source-code formatter for language: autosave. 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
      : false

      when using accepts_nested_attributes_for.

      In file

      Unable to find source-code formatter for language: nested_attributes. 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
      .rb

      the line

      autosave(metadata.merge!(autosave: true))
      

      prevents using

      Unable to find source-code formatter for language: accepts_nested_attributes_for```. 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
       with 

      autosave: false{{`}}

      I don't want to monkey-patch nested_attributes.rb, what is the suggested solution for using accepts_nested_attributes_for in combination with autosave: false?

      Thanks!

            Assignee:
            durran Durran Jordan
            Reporter:
            jan-harmsen jan-harmsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: