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

Reputation not automatically aggregated #96

Open
thebravoman opened this issue Feb 15, 2017 · 0 comments
Open

Reputation not automatically aggregated #96

thebravoman opened this issue Feb 15, 2017 · 0 comments

Comments

@thebravoman
Copy link

Adding an evaluation does not result in the aggregated evaluation updating its value
I have:

class Article < ActiveRecord::Base

has_reputation :popularity,
  :source => [
    {:reputation => :rep1, :weight => 0.8},
    {:reputation => :rep2},
  ]

has_reputation :rep1,
  :source => :article,
  :source_of => [{:reputation=>:popularity}]

has_reputation :rep2,
  :source=>:comments,
  :source_of => [{:reputation=>:popularity}]

The problem is

Article.add_evalution(:rep1, 1, Article.first)
Article.reputation_for(:rep1) -> 1.0
Article.reputation_for(:popularity) ->1.0

Then

Article.add_evaluation(:rep2, 2, Comment.first)
Arctile.reputation_for(:popularity) ->1 STILL 1.0.

Why is it still 1.0 is something I can not understand?

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
@thebravoman and others