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

Model.client_name not usable due to private visibility unlike collection_name/database_name

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 7.1.2, 7.0.8
    • Affects Version/s: 6.0.0, 7.0.0, 6.1.0, 6.2.0, 6.3.0, 6.4.0
    • Component/s: Persistence
    • None

      Public .client_name delegates call to persistence_context.client_name which is private in its turn:

      class Band
        include Mongoid::Document
      end
      
      Band.client_name

      The above raises exception:

       NoMethodError: private method `client_name' called for #<Mongoid::PersistenceContext:0x000055b495f8ce98>
      Did you mean?  client
      from /home/ixti/.gem/ruby/2.5.7/gems/mongoid-6.1.1/lib/mongoid/clients/options.rb:61:in `client_name'
      

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            ixti Aleksey Zapparov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: