add generic scope to find historic attributes by dynamic query and ts