Skip to content

Commit

Permalink
create feedback on demand
Browse files Browse the repository at this point in the history
  • Loading branch information
oma-s committed Apr 8, 2024
1 parent 6930827 commit de7bb6b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ def home
@payslips = current_user.payslips.reverse_chronologic.page(0).per(6)
@sprint = Sprint.current.take
@upcoming_leaves = current_user.leaves.future.not_rejected.chronologic
sprint_feedback = current_user.sprint_feedbacks.find_by(sprint: @sprint)
@daily_nerd_message = authorize DailyNerdMessage.find_by(created_at: Time.zone.today.all_day, sprint_feedback:) || sprint_feedback.daily_nerd_messages.build if sprint_feedback
if @sprint
sprint_feedback = current_user.sprint_feedbacks.find_or_create_by(sprint: @sprint)
@daily_nerd_message = authorize DailyNerdMessage.find_by(created_at: Time.zone.today.all_day, sprint_feedback:) || sprint_feedback.daily_nerd_messages.build
end
end

def offline
Expand Down

0 comments on commit de7bb6b

Please sign in to comment.