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

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

    XMLWordPrintable

    Details

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

      Description

      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'
      

        Attachments

          Activity

            People

            Assignee:
            oleg.pudeyev Oleg Pudeyev
            Reporter:
            ixti Aleksey Zapparov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: