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

undefined method `bson_type'

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.2
    • Affects Version/s: 5.1.0, 5.1.1
    • Component/s: None
    • None
    • Environment:
      ruby-2.3.0, mongodb 2.6.9, rails-4.2.5

      
      expect(ability).to be_able_to(:update, Booking)
      
       NoMethodError:
             undefined method `bson_type' for #<Distributor:0x000000092248a0>
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/bson-4.0.2/lib/bson/hash.rb:44:in `block in to_bson'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/bson-4.0.2/lib/bson/hash.rb:43:in `each'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/bson-4.0.2/lib/bson/hash.rb:43:in `to_bson'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/protocol/serializers.rb:163:in `serialize'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/protocol/message.rb:202:in `block in serialize_fields'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/protocol/message.rb:190:in `each'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/protocol/message.rb:190:in `serialize_fields'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/protocol/message.rb:100:in `serialize'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/server/connection.rb:172:in `block in write'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/server/connection.rb:171:in `each'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/server/connection.rb:171:in `write'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/server/connection.rb:157:in `deliver'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/server/connection.rb:104:in `block in dispatch'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/monitoring/publishable.rb:47:in `publish_command'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/server/connection.rb:103:in `dispatch'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/operation/executable.rb:36:in `block in execute'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/server/connection_pool.rb:108:in `with_connection'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/server/context.rb:63:in `with_connection'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/operation/executable.rb:34:in `execute'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/collection/view/iterable.rb:79:in `send_initial_query'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/collection/view/iterable.rb:41:in `block in each'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/retryable.rb:51:in `read_with_retry'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongo-2.2.3/lib/mongo/collection/view/iterable.rb:39:in `each'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongoid-5.1.1/lib/mongoid/query_cache.rb:207:in `each'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongoid-5.1.1/lib/mongoid/contextual/mongo.rb:121:in `each'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongoid-5.1.1/lib/mongoid/contextual.rb:20:in `each'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongoid-5.1.1/lib/mongoid/criteria.rb:49:in `entries'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/mongoid-5.1.1/lib/mongoid/criteria.rb:49:in `=='
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/cancancan-1.13.1/lib/cancan/rule.rb:54:in `conditions_empty?'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/cancancan-1.13.1/lib/cancan/rule.rb:41:in `matches_conditions?'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/cancancan-1.13.1/lib/cancan/ability.rb:68:in `block (2 levels) in can?'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/cancancan-1.13.1/lib/cancan/ability.rb:67:in `each'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/cancancan-1.13.1/lib/cancan/ability.rb:67:in `detect'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/cancancan-1.13.1/lib/cancan/ability.rb:67:in `block in can?'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/cancancan-1.13.1/lib/cancan/ability.rb:66:in `map'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/cancancan-1.13.1/lib/cancan/ability.rb:66:in `can?'
           # /home/siva/.rvm/gems/ruby-2.3.0/gems/cancancan-1.13.1/lib/cancan/matchers.rb:12:in `block (2 levels) in <top (required)>'
           # ./spec/ability/partner_spec.rb:158:in `block (4 levels) in <top (required)>'
      
      

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            siva.gollapalli Siva Gollapalli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: