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

cant use gte/lte etc on embedded docs..

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      i suspect because strings / quoted symbols dont work with them either

      class Foo
        include Mongoid::Document
        embeds_one :bar  
        field :a, type: Integer
      end
      
      class Bar
        include Mongoid::Document
        embedded_in :foo
        field :b, type: Integer
      end
      
      
      f=Foo.new(:a=>10)
      b=Bar.new(:b=>20)
      f.bar=b
      f.save
      
      
      Foo.where(:"a.gt"=>5).count
       # => 0 WHY?
      Foo.where(:a.gt=>5).count
       # => 1 
      
       Foo.where("a"=>10).count
       => 1 
       Foo.where(:a=>10).count
       => 1 
      
      
      Foo.where(:bar.b.gt=>5).count
       # NoMethodError: undefined method `b' for :bar:Symbol
      Foo.where(:"bar.b.gt"=>5).count
       # => 0  
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            darkskiez darkskiez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: