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

Extract `truthy?` method

parent 595ee8e6
...@@ -72,9 +72,13 @@ module Projects ...@@ -72,9 +72,13 @@ module Projects
def matching_policies_from(license_compliance) def matching_policies_from(license_compliance)
filters = matching_policies_params filters = matching_policies_params
license_compliance.find_policies( license_compliance.find_policies(
detected_only: filters[:detected] == 'true', detected_only: truthy?(filters[:detected]),
classification: filters[:classification] classification: filters[:classification]
) )
end end
def truthy?(value)
value.in?(%w[true 1])
end
end 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