diff options
author | Chris Salzberg <chris@dejimata.com> | 2019-03-13 10:17:00 +0900 |
---|---|---|
committer | Chris Salzberg <chris@dejimata.com> | 2019-03-13 10:34:15 +0900 |
commit | 8ca3c286a768038f6b391fd3bfbdfcc299876a1f (patch) | |
tree | ae93f15965fad583bcd749d13a5e70ffd79876d9 /Gemfile | |
parent | 963ec3bae5ac12ab3e0614bdd0d0ca9fba06ac46 (diff) | |
download | rails-8ca3c286a768038f6b391fd3bfbdfcc299876a1f.tar.gz rails-8ca3c286a768038f6b391fd3bfbdfcc299876a1f.tar.bz2 rails-8ca3c286a768038f6b391fd3bfbdfcc299876a1f.zip |
Give GeneratedAttributeMethods module a name
Currently GeneratedAttributeMethods is a module builder class, an
instance of which is included in every AR class. OTOH,
GeneratedAssociatedMethods is assigned to a constant under the model
namespace. This is inconsistent and looks strange in the list of
ancestors.
There is no particular reason *not* to assign a constant for this (very
important) module under the model namespace, so that's what this commit
does.
Previous to this change, ancestors for an AR class looked like this:
```
=> [User (call 'User.connection' to establish a connection),
User::GeneratedAssociationMethods,
#<ActiveRecord::AttributeMethods::GeneratedAttributeMethods:0x000055ace0f05b08>,
ApplicationRecord(abstract),
ApplicationRecord::GeneratedAssociationMethods,
#<ActiveRecord::AttributeMethods::GeneratedAttributeMethods:0x000055ace093c460>,
ActiveRecord::Base,
...
```
With this change, they look like this:
```
=> [User (call 'User.connection' to establish a connection),
User::GeneratedAssociationMethods,
User::GeneratedAttributeMethods,
ApplicationRecord(abstract),
ApplicationRecord::GeneratedAssociationMethods,
ApplicationRecord::GeneratedAttributeMethods,
ActiveRecord::Base,
...
```
The previously named `GeneratedAttributeMethods` module builder class is
renamed `GeneratedAttributeMethodsBuilder` to emphasize that this is not
a module but a class.
Diffstat (limited to 'Gemfile')
0 files changed, 0 insertions, 0 deletions