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

Mongoid.configure should allow arg-less block

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 8.1.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible

      Current syntax is:

      Mongoid.configure do |config|
        config.some_method ...
      end

       

      We should be able to inspect the arity of the block, and if zero use instance_exec on the Config. It would then look like this:

      Mongoid.configure do
        some_method ...
      end

      This can be done is a way that preserves the existing usage above.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            shields@tablecheck.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: