replaced rails completion to support rails 2, 3 & 4