twitter / activerecord-reputation-system

An Active Record Reputation System for Rails
Apache License 2.0
1.33k stars 123 forks source link

Scope by Associations #84

Open toobulkeh opened 9 years ago

toobulkeh commented 9 years ago

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 commented 9 years ago

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 commented 8 years ago

@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,