diff options
author | Keenan Brock <kbrock@redhat.com> | 2014-01-22 12:55:46 -0500 |
---|---|---|
committer | Keenan Brock <kbrock@redhat.com> | 2014-01-22 13:47:34 -0500 |
commit | 8cbd500035aa64a5440d5ccc44209cfd902118fc (patch) | |
tree | 1b18f85e6239e96f230ab71a6c6e92978012df9c /activerecord/lib/active_record/core.rb | |
parent | 72403003085ff6413ddf53e34561175e3dd68168 (diff) | |
download | rails-8cbd500035aa64a5440d5ccc44209cfd902118fc.tar.gz rails-8cbd500035aa64a5440d5ccc44209cfd902118fc.tar.bz2 rails-8cbd500035aa64a5440d5ccc44209cfd902118fc.zip |
Move changed_attributes into dirty.rb
Move serialization dirty into serialization.rb
Diffstat (limited to 'activerecord/lib/active_record/core.rb')
-rw-r--r-- | activerecord/lib/active_record/core.rb | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index a4fe1efd33..6f02c763fe 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -182,9 +182,7 @@ module ActiveRecord @column_types = self.class.column_types init_internals - init_changed_attributes - ensure_proper_type - populate_with_current_scope_attributes + initialize_internals_callback # +options+ argument is only needed to make protected_attributes gem easier to hook. # Remove it when we drop support to this gem. @@ -255,16 +253,12 @@ module ActiveRecord run_callbacks(:initialize) unless _initialize_callbacks.empty? - @changed_attributes = {} - init_changed_attributes - @aggregation_cache = {} @association_cache = {} @attributes_cache = {} @new_record = true - ensure_proper_type super end @@ -440,13 +434,7 @@ module ActiveRecord @reflects_state = [false] end - def init_changed_attributes - # Intentionally avoid using #column_defaults since overridden defaults (as is done in - # optimistic locking) won't get written unless they get marked as changed - self.class.columns.each do |c| - attr, orig_value = c.name, c.default - changed_attributes[attr] = orig_value if _field_changed?(attr, orig_value, @attributes[attr]) - end + def initialize_internals_callback end # This method is needed to make protected_attributes gem easier to hook. |