Upgrade Ruby on Rails to 4.2
This ticket covers the upgrade of core Foreman to Ruby on Rails 4.2 (i.e. Gemfile et al).
fixes #13244 - update Rails to 4.2.6
- Add responders gem to support class-level respond_to usage
- Replace foreigner with native Rails 4.2 FK support
- uses a patch from Rails 5 to support Foreigner's
`foreign_key_exists?` helper for full compatibility
- `foreign_keys` should be avoided in favour of the higher level
methods as it throws a NotImplementedError on sqlite3
- Update DB adapter versions to match ActiveRecord
- Enable exceptions from after_commit handlers to detect more errors
- Change deprecated application config settings
- Remove test:lib chaining on rake test task
- 4.2 runs lib tasks automatically now, as test:run is redefined
to all _test files within test/ rather than units+functionals.
The task is still needed for the jenkins:* tasks.
- Fix deprecation of mailer #deliver method, change to #deliver_now
- Change CSRF test to use generated, not static tokens
- 4.2 changes CSRF tokens to be different on every request and
validated against the session, so use its generator to test the
controller behaviour instead of hardcoding tokens.
- Change test execution order to random
#11 Updated by Dominic Cleal almost 5 years ago
A branch is available at https://github.com/domcleal/foreman/commits/13244-rails42 for anybody wanting to test against it. Apart from a couple of integration tests, it's in good working order.
#19 Updated by Dominic Cleal almost 5 years ago
This has been merged into the
rails42 branch and not develop yet (leaving it on RfT until it is merged). Please see https://groups.google.com/forum/#!topic/foreman-dev/6ANhWVGDzNA for details.