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

Infinite Loop In Callbacks

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0
    • Affects Version/s: 6.0.0
    • Component/s: None
    • None

      I get an infinite loop running this script that I get in v6.0.0.rc1 but not in the v5.x series.

      Was there an intended behavior change here? I couldn't find anything to that effect, but this seems like a reasonable use-case.

      ```ruby
      require 'mongoid'

      Mongoid.configure do |config|
      config.connect_to('foo_test')
      end

      puts Mongoid::VERSION # => 6.0.0.rc0

      class Band
      include Mongoid::Document
      has_many :members
      after_save :create_member

      def create_member
      members.create!(name: 'Ben')
      end
      end

      class Member
      include Mongoid::Document
      field :name, type: String
      belongs_to :band
      end

      Band.create!
      ```

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            bcrouse Ben Crouse
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: