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

Zero reputations result in a non zero reputation when sum #97

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

Zero reputations result in a non zero reputation when sum #97

thebravoman opened this issue Feb 15, 2017 · 0 comments

Comments

@thebravoman
Copy link

Definition is:

has_reputation :popularity,
    :source => [
      {:reputation => :watched_pointsd},
      {:reputation => :views},
      {:reputation => :payment_reputation, :weight => 2}
    ],
    :aggregated_by => :sum

  has_reputation :payment_reputation,
    :source => :episode,
    :source_of => [{:reputation=>:popularity}]

  has_reputation :views,
    :source=>:user,
    :source_of => [{:reputation=>:popularity}]

	has_reputation :watched_points,
		:source=>:user,
    :source_of => [{:reputation=>:popularity}]

Then for a given episode I have

def pop e 
 puts "Popularity: #{e.reputation_for(:popularity)}" 
 puts "Watched points: #{e.reputation_for(:watched_points)}"
 puts "Views: #{e.reputation_for(:views)}"
 puts "Payment: #{e.reputation_for(:payment_reputation)}"
end

The result for a given episode is:
Popularity: -272.2
Watched points: 0.0
Views: 0.0
Payment: 0.0

How could that be? Where could I even start debugging it?

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

1 participant