Updated teh sc, ss, sg, and sdb functions to support Rails 2.x.x, 3.x.x, and 4.x.x.