I have the following line of code :
if params[:"available_#{district.id}"] == 'true'
@deliverycharge = @product.deliverycharges.create!(districtrate_id: district.id)
delivery_custom_price(district)
end
Rubocop highlight it and asks me to use a guard clause for it. How can I do it?
EDIT : Rubocop highlighted the first line and gave this message Use a guard clause instead of wrapping the code inside a conditional expression