尝试设置模型观察者。 AuditTrail被触发但是没有传递值。为什么呢?
def after_update(stock)
AuditTrail.create(message: 'Stock update: #{stock.in_stock} * #{stock.variation.name}|#{stock.color.name} in #{stock.storage.name}',
importance: 'Success')
end
答案 0 :(得分:0)
正如@eugen所指出的,应该使用双引号。