find_or_create_by fails with dynamic collection

XMLWordPrintableJSON

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

      class OneModel
      include Mongoid::Document

      field :a
      end

      class AnotherModel
      include Mongoid::Document

      field :a
      end

      OneModel.with(collection: 'another_models').find_or_create_by(:a => 1)

      OneModel.count => 1
      AnotherModel.count => 0

              Assignee:
              Durran Jordan
              Reporter:
              makeshifthoop
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: