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

Atomic methods #set, #unset, etc. should work on embedded relations scopes (Mongoid::Contextual::Memory)

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None

      The following should be possible:

      class Band
        embeds_many :instruments
      end
      
      class Instrument
        field :type
        field :color
      
        embedded_in :band
      end
      
      Band.first.instruments.where(type: :guitar).set(color: :red)
      
      #=> current behavior:
      #   NoMethodError: undefined method `set' for #<Mongoid::Contextual::Memory

       

       

            Assignee:
            jamis.buck@mongodb.com Jamis Buck
            Reporter:
            shields@tablecheck.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: