From a01de4deab59f57874965a69e9a4c83112b3cb47 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 26 Jun 2018 10:25:19 -0700 Subject: define attribute methods in `init_from_db` Now that `allocate` is removed, we need to define attribute methods in all "init" methods. --- activerecord/lib/active_record/core.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/lib/active_record/core.rb') diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 20d9e7a9ca..df795df52e 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -356,6 +356,8 @@ module ActiveRecord @new_record = false @attributes = attributes + self.class.define_attribute_methods + yield self if block_given? _run_find_callbacks -- cgit v1.2.3