Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Currently
ActiveModel::Model
is defined as the minimum API to talkwith Action Pack and Action View.
However, its name suggests it can be included to create Active Record
type models. But for creating models it's probably too minimal. For
example it's very common to include ActiveModel::Attributes as well.
By moving
ActiveModel::Model
's implementation to a newActiveModel::API
we keep a definition of the minimum API to talk withAction Pack and Action View.
ActiveModel::Model
now only includesActiveModel::API
.This will allow
ActiveModel::Model
to add more functionality whilekeeping backwards compatibility.
Related discussions: #41448 and https://mobile.twitter.com/kaspth/status/1361340090237222912
This the same as an earlier stale PR: #42042 that I couldn't update.