I have an Address model with the following validation:
Address
validates :addressable_id, uniqueness: { scope: :addressable_type }, if: -> { addressable_t