Skip to content

Commit

Permalink
Updates other affected specs
Browse files Browse the repository at this point in the history
  • Loading branch information
mereghost committed Aug 9, 2023
1 parent d37b6cf commit cf03cac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ def extension
->(*) do
property :position,
render_nil: true,
skip_render: ->(*) { !(backlogs_enabled? && type && type.passes_attribute_constraint?(:position)) }
skip_render: ->(*) do
!(backlogs_enabled? && type && type.passes_attribute_constraint?(:position))
end

property :story_points,
render_nil: true,
skip_render: ->(*) {
!(backlogs_enabled? && type && type.passes_attribute_constraint?(:story_points))
}
skip_render: ->(*) do
!(backlogs_enabled? && type && type.passes_attribute_constraint?(:story_points))
end

property :remaining_time,
exec_context: :decorator,
Expand All @@ -64,7 +66,7 @@ def extension
# cannot use def here as it wouldn't define the method on the representer
define_method :remaining_time= do |value|
represented.remaining_hours = datetime_formatter
.parse_duration_to_hours(value, 'remainingTime', allow_nil: true)
.parse_duration_to_hours(value, 'remainingTime', allow_nil: true)
end

define_method :derived_remaining_time= do |value|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ module InstanceMethods
private

def selected_descendants_attributes
super + %i(remaining_hours derived_remaining_hours)
super + %i(remaining_hours)
end

def selected_leaves_attributes
super + [:remaining_hours]
super + %i[remaining_hours derived_remaining_hours]
end
end
end
2 changes: 2 additions & 0 deletions spec/services/work_packages/update_ancestors/loader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def descendants_of_hash(hashed_work_package)
"id" => hashed_work_package.id,
"ignore_non_working_days" => false,
"parent_id" => hashed_work_package.parent_id,
"remaining_hours" => nil,
"schedule_manually" => false }
end

Expand Down Expand Up @@ -257,6 +258,7 @@ def children_of_hash(hashed_work_package)
"id" => hashed_work_package.id,
"ignore_non_working_days" => false,
"parent_id" => hashed_work_package.parent_id,
"remaining_hours" => nil,
"schedule_manually" => false }
end

Expand Down

0 comments on commit cf03cac

Please sign in to comment.