Fix failing tests for edge rails

* Edge Rails returns an instance of 'Gem::Version' for 'Rails.version' due to [#8501](https://github.com/rails/rails/issues/8501)
 
* Travis build was failing because of this as 'Rails.version.start_with? '4'' was giving 'undefined method' on 'Gem::Version' instance