some fix for rails3.2

Signed-off-by: ShiningRay <shiningray.nirvana@gmail.com>