Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

fix Collection#set_belongs_to to work with has_many through #83

Open

Description

@catmando

probably means complete refactor of has_many_through.

What has_many_through should probably be doing is something like this:

Consider TodoItems.has_many :commenters, class: User, through: :comments

todo_item.commenters.first => todo_item.comments.first.user

In other words it asks just like a scope on Comment, but with the special property that the user (belongs_to) method is automatically applied.

probably its much easier to do this via some delegation class on top of the Comment all scope rather than all the complex mechanism currently.

Right now Collection#set_belongs_to is failing on most recent edge because of the removal of the method_missing which was allowing a bogus assignment to work. For now this has been patched up so it at least works for existing code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions