提交 bf50935a 编写于 作者: S Sebastian Martinez

Add more doc to #update_column.

上级 ad3e057e
......@@ -133,6 +133,8 @@ def update_attribute(name, value)
# * Callbacks are skipped.
# * updated_at/updated_on column is not updated if that column is available.
#
# Raises an +ActiveRecordError+ when called on new objects, or when the +name+
# attribute is marked as readonly.
def update_column(name, value)
name = name.to_s
raise ActiveRecordError, "#{name} is marked as readonly" if self.class.readonly_attributes.include?(name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册