You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 13, 2021. It is now read-only.
def update_watched_points percentage, user
to_be_given = calculate_some_value
ActiveRecord::Base.transaction do
current_points = self.evaluation_by :watched_points, user
current_points = current_points.to_f
if current_points < to_be_given
user.add_or_update_evaluation :watched_points, to_be_given, self
self.add_or_update_evaluation :watched_points, to_be_given, user
end
end
end
Do you know what might be causing it?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The following error occurs on postgre running on heroku.
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_rs_evaluations_on_reputation_name_and_source_and_target"
DETAIL: Key (reputation_name, source_id, source_type, target_id, target_type)=(watched_points, 135, Episode, 3774, User) already exists.
: INSERT INTO "rs_evaluations" ("created_at", "data", "reputation_name", "source_id", "source_type", "target_id", "target_type", "updated_at", "value") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"
app/models/episode.rb:70:in `block in update_watched_points'
This is the code of the method being called:
Do you know what might be causing it?
The text was updated successfully, but these errors were encountered: