def where_uniqable(uid)
      where_sql = key_uid?(uid) ?
                      uniqable_fields.map { |r| "#{table_name}.#{r} = :uid" }.join(' OR ') :
                      "#{table_name}.#{self.primary_key} = :uid"
      where(where_sql, uid: uid)
    end
def where_uniqable(uid)
      where_sql = key_uid?(uid) ?
                      uniqable_fields.map { |r| "#{table_name}.#{r} = :uid" }.join(' OR ') :
                      "#{table_name}.#{self.primary_key} = :uid"
      where(where_sql, uid: uid)
    end
rubocop:enable Metrics/MethodLength
 @return [self]