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

Module: Mongoid::Relations::Accessors#build confict with Build model

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.0.0
    • Component/s: None
    • Labels:

      Description

      class Build
        include Mongoid::Document
        has_many :bsuites
      end
       
      class Bsuite
        include Mongoid::Document
        belongs_to :build
      end
       
      bs = Bsuite.new
      bs.build #=> stack level too deep!
      

      resolve:
      rename Module: Mongoid::Relations::Accessors#build to Module: Mongoid::Relations::Accessors#*build , also change getter,setter method to use *build

      because in Module: Mongoid::Relations::Accessors the self is bs, so call build(name, object.substitutable, metadata) will always return nil.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              comme comme
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: