Improve method naming and implementation

pull/2598/head
Alexander Bach 10 years ago
parent 73825c76b4
commit 35af232afd
  1. 10
      lib/api/v3/work_packages/schema/work_package_schema.rb

@ -80,18 +80,18 @@ module API
def percentage_done_writable?
if Setting.work_package_done_ratio == 'status' ||
Setting.work_package_done_ratio == 'disabled'
Setting.work_package_done_ratio == 'disabled'
return false
end
work_package_present_and_parent?
is_leaf_or_nil?(@work_package)
end
def estimated_time_writable?
work_package_present_and_parent?
is_leaf_or_nil?(@work_package)
end
def work_package_present_and_parent?
@work_package.nil? ? true : @work_package.children.count < 1
def is_leaf_or_nil?(work_package)
work_package.nil? ? true : work_package.children.empty?
end
end
end

Loading…
Cancel
Save