From 60898d2112cab0b501641f0a8871efd8dd9b30ea Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Thu, 15 Dec 2016 10:14:35 -0500 Subject: [PATCH] style cleanup --- app/models/synapse.rb | 6 +++--- app/models/topic.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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