To detect Rails version at runtime, use:
Rails.version # => "x.y.z"
To check just the major version, use:
Rails::VERSION::MAJOR
To detect Rails version at runtime, use:
Rails.version # => "x.y.z"
To check just the major version, use:
Rails::VERSION::MAJOR