Search code examples
ruby-on-rails-3observer-pattern

Rails Observer not passing arguments


Trying to set up a model observer. AuditTrail is triggered however it's not passing the values. Why?

  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

Solution

  • As pointed out by @eugen should have used double quotes.