📜  如何更新 after_save rails 上的字段 - Ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:45.790000             🧑  作者: Mango

代码示例1
after_save :updater
# Awesome Ruby code
# ...
# ...

private

  def updater
    self.update_column(:column_name, new_value) # This will skip validation gracefully.
  end