diff --git a/app/models/synapse.rb b/app/models/synapse.rb index 07a17e54..d14a18f4 100644 --- a/app/models/synapse.rb +++ b/app/models/synapse.rb @@ -45,10 +45,10 @@ class Synapse < ApplicationRecord def after_updated attrs = ['desc', 'category', 'permission', 'defer_to_map_id'] if attrs.any? {|k| changed_attributes.key?(k)} - new = self.attributes.select {|k,v| attrs.include?(k) } - old = changed_attributes.select {|k,v| attrs.include?(k) } + new = self.attributes.select {|k| attrs.include?(k) } + old = changed_attributes.select {|k| 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) } + 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 b2a2b3bc..e5ea90ee 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -140,10 +140,10 @@ class Topic < ApplicationRecord def after_updated attrs = ['name', 'desc', 'link', 'metacode_id', 'permission', 'defer_to_map_id'] if attrs.any? {|k| changed_attributes.key?(k)} - new = self.attributes.select {|k,v| attrs.include?(k) } - old = changed_attributes.select {|k,v| attrs.include?(k) } + new = self.attributes.select {|k| attrs.include?(k) } + old = changed_attributes.select {|k| 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) } + meta['changed'] = changed_attributes.keys.select {|k| attrs.include?(k) } Events::TopicUpdated.publish!(self, user, meta) end end