add preliminary support for rails 3