whats wrong with my if statement if x + y = z : I am trying to evaluate if the selected item meats the requirment by using the following code

    if @weight.nominal + x = required
                  weights << @weight.id
    end

However rather than doing what I would expect which is evaluate the result of nominal + x against required, it is adding nominal + x together.

Why is that and how do do what I want? 

Thanks