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

Association Proxies `===` returns false on its modules

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: Associations
    • None

       

      For example I have those two classes:

       

      
      class User
        include Mongoid::Document
        end
      
       
      
      class Post
        include Mongoid::Document
      
        belongs_to :user, class_name: "User"
        end
      
      

       

      The issue is that I can't check whether association returns a module instance (fails for any module).

       

      Mongoid::Document === Post.last.user #=> false, but expected true

      But

      Mongoid::Document === Post.last.user.reload #=> true, as expected works just ok{{}}

       

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            dmitry.barskov@flatstack.com Dmitry Barskov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: