Commit 1acf94ba authored by mo khan's avatar mo khan

Extract `truthy?` method

parent 595ee8e6
......@@ -72,9 +72,13 @@ module Projects
def matching_policies_from(license_compliance)
filters = matching_policies_params
license_compliance.find_policies(
detected_only: filters[:detected] == 'true',
detected_only: truthy?(filters[:detected]),
classification: filters[:classification]
)
end
def truthy?(value)
value.in?(%w[true 1])
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment