More robust detection of rails 4

Using `Rails.version` requires the `Rails` constant to exist. When
including `gds-sso` in the build of a non-rails gem (e.g.
`govuk_content_models`) that would cause the build to fail because `Rails`
would not be loaded in the tests. 

This alternative way of checking the rails version is more robust to that scenario.

For an example of such a failure see:

https://travis-ci.org/alphagov/govuk_content_models/builds/18656006