WIP: [Rails5] Add `ApplicationRecord`
What does this MR do?
- Adds
app/models/application_record.rbabstract file (this is a part of migration from official Rails guide). - Replaces
ActiveRecord::BasewithApplicationRecordbyrubocop --auto-correctcommand. - Adds a rubocop's cop with the autocorrection feature that checks for correct constant calls including inheritance.
- Adds a spec for the new rubocop's cop.
- Change rails' model generator to explicitly set
ApplicationRecordas a model parent.
TODO
-
Set --parent ApplicationRecordexplicitly before rails' command gets unshifted inrails/commands.
This step depends on !17828 (merged) as common code is used by both MRs. -
Fix typos in the spec itblocks (add trailings). -
Update EE codebase when this MR is reviewed.
Why was this MR needed?
Migrating to rails 5.0
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered -
End-to-end tests pass ( package-and-qamanual pipeline job)
What are the relevant issue numbers?
Edited by blackst0ne