diff --git a/app/models/synapse.rb b/app/models/synapse.rb index 31e997f4..07a17e54 100644 --- a/app/models/synapse.rb +++ b/app/models/synapse.rb @@ -48,6 +48,7 @@ class Synapse < ApplicationRecord new = self.attributes.select {|k,v| attrs.include?(k) } old = changed_attributes.select {|k,v| attrs.include?(k) } meta = new.merge(old) # we are prioritizing the old values, keeping them + meta['changed'] = changed_attributes.keys.select {|k| attrs.include?(k) } Events::SynapseUpdated.publish!(self, user, meta) end end diff --git a/app/models/topic.rb b/app/models/topic.rb index 4670c286..b2a2b3bc 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -143,6 +143,7 @@ class Topic < ApplicationRecord new = self.attributes.select {|k,v| attrs.include?(k) } old = changed_attributes.select {|k,v| attrs.include?(k) } meta = new.merge(old) # we are prioritizing the old values, keeping them + meta['changed'] = changed_attributes.keys.select {|k| attrs.include?(k) } Events::TopicUpdated.publish!(self, user, meta) end end