Corrected the check that avoids trying to insert duplicate entry-states for the same entry and user.

Previously I was checking against the presence of the result of a query. This is not correct because the query always returns an ActiveRecord instance, even if there are no records in it, and it never passed the .blank? conditional.

The correct way to perform this check is using ActiveRecord's .exists? method.