default_scope not applied to has_many relation?

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • 2.5.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      For class Foo with has_many Bar with a default_scope, I believe foo.bars should be scoped. It currently is not, but foo.bars.all is.

      Steps to repro:

      Create a model Foo with a has_many to model Bar.
      Create an attribute in Bar on which to scope.
      Create a default scope for this attribute.
      Add some instances of Bar to foo.
      Try both foo.bars and foo.bars.all, the first one is scoped, the latter one is not.

      I'm on version 2.4.10

            Assignee:
            Unassigned
            Reporter:
            stiller
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: