1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test
Chris Salzberg 8ca3c286a7
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.
2019-03-13 10:34:15 +09:00
..
active_record/connection_adapters
assets
cases Give GeneratedAttributeMethods module a name 2019-03-13 10:34:15 +09:00
fixtures Lazy checking whether or not values in IN clause are boundable 2018-10-24 11:26:49 +09:00
migrations Fix occurrences Fixnum|Bignum 2018-03-04 20:44:30 +02:00
models Fixed reselect throwing NoMethodError on ActiveRecord. 2019-03-03 22:25:10 +05:30
schema Add insert_all to ActiveRecord models (#35077) 2019-03-05 11:16:44 -08:00
support Remove duplicated protected params definitions 2019-02-24 19:50:53 +09:00
config.example.yml Respect ENV variables when finding DBs etc for the test suite 2019-02-06 01:20:06 +10:30
config.rb