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

belongs_to :name, class_name: '::SomeClass' raises an exception

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0.rc0, 7.0.4
    • Affects Version/s: 7.0.3
    • Component/s: Associations
    • Labels:
      None

      Following the rework of the `:class_name` option in v7.0.3, a value of '::SomeClass' causes a NameError exception. GitHub PR #4640 fixes it so it works again (as it did in 7.0.2 and prior).

      Example:
      class Child
        include Mongoid::Document
        belongs_to :parent, class_name: '::OtherClass'
      {{ end}}

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            tmorgan thomas morgan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: