Rails AR. validate one field, with 4 validators & 2 condition block
validates :inn,
presence: { if: -> { user.is_a?(Client) } },
inn: { if: -> { user.is_a?(Client) } },
uniqueness: { if: -> { user.is_a?(Client) } },
absence: { if: -> { user.is_a?(Department) } }
Could I have some tips on refactoring this?
inn
as an option ofvalidates
? \$\endgroup\$