The issue was caused by the following line:
security_user = SecurityUser.new(data[:Information])
because even thought the hash passed in the new method holds only email and password fields, the result object was created with the rest of the model attributes but set to nil. For, example, I have id=>nil.
Then in I was doing the following
SecurityUser.where(email: security_user.email).first_or_create!(security_user.attributes)
in order to created the user only if exists. Anyway, since the id parameter is not in the attr_accessible clause in the model, I was not able to make mass assign.
To delete the nil values of the hash I've done the following:
SecurityUser.where(email: security_user.email)
.first_or_create!(security_user.attributes
.delete_if { |key, value| value.nil? })