Allow specifying scope in association declarations

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      ActiveRecord permits defining scope on associations when association is declared. Per https://apidock.com/rails/ActiveRecord/Associations/ClassMethods/has_one:

      has_one :vehicle, -> { where(name: 'Car') }
      

      Mongoid does not appear to support scopes in any of its association definitions.

              Assignee:
              Oleg Pudeyev (Inactive)
              Reporter:
              Oleg Pudeyev (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: