fix-rails4-deprecated-warning

Add PR from asoules to fix condition warning in has_many