Skip to content

Commit

Permalink
fix time entries order
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiomagalhaes committed Jul 3, 2024
1 parent ac06ecd commit af07732
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/controllers/analytics/time_entries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class TimeEntriesController < ApplicationController
def index
@time_entries = Analytics::TimeEntriesAnalytics.new(@project, @statement_of_work, params[:start_date],
params[:end_date]).data

render json: @time_entries
end

Expand Down
6 changes: 3 additions & 3 deletions app/utils/analytics/time_entries_analytics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ def assignments
def requirements
return @requirements if @requirements

@requirements = if @project
@requirements = if @statement_of_work
Requirement.where(id: @statement_of_work.requirements.map(&:id))
elsif @project
Requirement.where(id: @project.statement_of_works.map(&:requirements)
.flatten.map(&:id))
elsif @statement_of_work
Requirement.where(id: @statement_of_work.requirements.map(&:id))
else
Requirement.all
end
Expand Down

0 comments on commit af07732

Please sign in to comment.