Skip to content
This repository has been archived by the owner on Nov 13, 2021. It is now read-only.

Scope by Associations #84

Open
toobulkeh opened this issue Jul 22, 2015 · 2 comments
Open

Scope by Associations #84

toobulkeh opened this issue Jul 22, 2015 · 2 comments

Comments

@toobulkeh
Copy link

After reading your scoping wiki document, it looks like the scope system was built for static names, but I'd like to scope evaluations to calculate a reputation by relationships.

For example, we have a ticketing system where each ticket automatically adds an evaluation to the provider by the system once it's closed using a proprietary algorithm.

I'd like to then calculate and use reputations (over time) for the provider based on any attribute or association related to the provider or ticket. For example a ticket has a creator/author/consumer and is related around an entity/store/location.

Am I correct after investigation that the reputation system doesn't handle this already?

@toobulkeh
Copy link
Author

At first I thought that I could perform this by adding multiple evaluations for the same data, sourcing with each of the associations we want to "scope" (not the current definition of scope in the gem, but the general sense) by.

But this isn't possible since a model can only have one evaluation from one source instance. If anyone has suggestions or feedback (including "no way in this gem") I'd appreciate it.

@BennyOnGit
Copy link

@toobulkeh did you ever discover a way of doing this? I'm investigating whether i can use this gem on a simpler example...a has_many through association as described here:

http://stackoverflow.com/questions/37235008/activerecord-reputation-system-with-has-many-through-assocations

would appreciate the feedback,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants