Verified Commit b0eb3cdc authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

fix severe bug: group_assignment#last_submitted_hours_and_feedbacks

- scoped relation on group_assignment was not used so the volunteer got
  all feedbacks and hours belonging to all volunteers displayed
parent 72d892e1
Pipeline #19721 failed with stage
in 106 minutes and 4 seconds
......@@ -36,11 +36,11 @@ class GroupAssignment < ApplicationRecord
end
def hours_since_last_submitted
group_offer.hours.since_last_submitted(submitted_at)
hours.since_last_submitted(submitted_at)
end
def feedbacks_since_last_submitted
group_offer.feedbacks.since_last_submitted(submitted_at)
feedbacks.since_last_submitted(submitted_at)
end
def polymorph_url_object
......
......@@ -20,7 +20,7 @@ class Hour < ApplicationRecord
scope :billed, (-> { where.not(billing_expense: nil) })
scope :since_last_submitted, lambda { |submitted_at|
where('created_at > ?', submitted_at) if submitted_at
where('hours.created_at > ?', submitted_at) if submitted_at
}
scope :assignment, (-> { where(hourable_type: 'Assignment') })
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment