Skip to content

Commit

Permalink
obey rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
as-op committed Nov 28, 2024
1 parent 744d4af commit 02dd29f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
18 changes: 9 additions & 9 deletions modules/reporting/app/controllers/cost_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -506,16 +506,16 @@ def prepare_query
# Determine the query settings the current request and save it to
# the session.
def determine_settings
if force_default?
filters = default_filter_parameters
groups = default_group_parameters
session[session_name].try :delete, :name
else
filters = filter_params
groups = group_params
end
return reset_settings if force_default?

cookie = session[session_name] || {}
session[session_name] = cookie.merge(filters: filter_params, groups: group_params)
end

def reset_settings
session[session_name].try :delete, :name
cookie = session[session_name] || {}
session[session_name] = cookie.merge(filters:, groups:)
session[session_name] = cookie.merge(filters: default_filter_parameters, groups: default_group_parameters)
end

##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def all_entries
.filter { |r| r.fields["type"] == "TimeEntry" }
end

# rubocop:disable Metrics/AbcSize
def build_table_rows(entries)
rows = [table_header_columns]
entries
Expand All @@ -85,8 +84,6 @@ def build_table_rows(entries)
rows
end

# rubocop:enable Metrics/AbcSize

def build_table_day_rows(spent_on, lines)
day_rows = []
lines.each do |r|
Expand Down Expand Up @@ -188,7 +185,6 @@ def split_group_rows(table_rows)
end
groups
end

# rubocop:enable Metrics/AbcSize

def write_table(user_id, entries)
Expand Down

0 comments on commit 02dd29f

Please sign in to comment.