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

Fix method name generation for recursively_embeds_many for namespaced models

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

      Given the following example:

      module SomeNamespace
        class Foo
          include Mongoid::Document
          recursively_embeds_many
        end
      end
      

      The methods it generates are literally:
      "parent_some_namespace/foo"
      "child_some_namespace/foos"

      Might be nice to just have it use underscores all the way so that it can be a valid ruby method.

      Workaround:
      A temporary workaround for this as pointed out by Durran is to just create the embeds_many and embedded_in relationship like normal, but provide a ":cyclic => true" option to both of them.

            Assignee:
            Unassigned Unassigned
            Reporter:
            joeybeninghove Joey Beninghove
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: