diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-09-26 04:17:35 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-10-17 10:51:53 +0900 |
commit | 1198a3880bb2918bb771b55d94cfb333813744fa (patch) | |
tree | 55c7bdd9ada28997f5d08aab764622fb5256d9d9 /activerecord/lib/active_record.rb | |
parent | bb0c02e9b5178a2833ca509494e28d85e5d3d5df (diff) | |
download | rails-1198a3880bb2918bb771b55d94cfb333813744fa.tar.gz rails-1198a3880bb2918bb771b55d94cfb333813744fa.tar.bz2 rails-1198a3880bb2918bb771b55d94cfb333813744fa.zip |
Consolidate duplicated code that initializing an empty model object
`init_with` and `init_from_db` are almost the same code except decode
`coder`.
And also, named `init_from_db` is a little misreading, a raw values hash
from the database is already converted to an attributes object by
`attributes_builder.build_from_database`, so passed `attributes` in that
method is just an attributes object.
I renamed that method to `init_with_attributes` since the method is
shared with `init_with` to initialize an empty model object.
Diffstat (limited to 'activerecord/lib/active_record.rb')
0 files changed, 0 insertions, 0 deletions