define attribute methods in `init_from_db`

Now that `allocate` is removed, we need to define attribute methods in
all "init" methods.
上级 259bf875
...@@ -356,6 +356,8 @@ def init_from_db(attributes) ...@@ -356,6 +356,8 @@ def init_from_db(attributes)
@new_record = false @new_record = false
@attributes = attributes @attributes = attributes
self.class.define_attribute_methods
yield self if block_given? yield self if block_given?
_run_find_callbacks _run_find_callbacks
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册