Added switch in Gemfile, corrected class constant

* Added version switch for railties gem version for Ruby versions < 1.9
* Corrected the class constant used for comparison in test
Added switch to handle Rails versions prior to 3.1