build rules by model or table name