Rails validating with condition block Rails AR. validate one field, with 4 validators &amp; 2 condition block

validates :inn,
          presence: { if: -&gt; { user.is_a?(Client) } },
          inn: { if: -&gt; { user.is_a?(Client) } },
          uniqueness: { if: -&gt; { user.is_a?(Client) } },
          absence: { if: -&gt; { user.is_a?(Department) } }


Could I have some tips on refactoring this?
You can try something like this (obviously names can be shorter):

if_user_is_a = -&gt;(klass) { { if: -&gt; { user.is_a?(klass) } } }
validates :inn, presence: if_user_is_a[Client], ..., absence: if_user_is_a[Department]


or

if_user_is_a = -&gt;(klass) { { if: -&gt; { user.is_a?(klass) } } }
if_user_is_a_client = if_user_is_a[Client]
...
validates :inn, presence: if_user_is_a_client, ...