How can I fix the following code for deprecation warning?
role = Role.find_by_name(‘eclient’)
if client_id.blank? && role_id == role.id
errors.add :client_id, “must assign an external client to this
elsif !client_id.blank? && role_id != role.id
errors.add :client_id, “cannot assign an internal user to a
It is the errors.add part that is triggering the following messages:
…DEPRECATION WARNING: Errors#on have been
deprecated, use Errors# instead.
Also note that the behaviour of Errors# has changed. Errors# now
always returns an Array. An empty Array is returned when there are no
errors on the specified attribute. (called from on at