[Git][noosfero/noosfero][master] 2 commits: check if target exist

Victor Costa gitlab at mg.gitlab.com
Thu May 4 11:27:56 BRT 2017


Victor Costa pushed to branch master at Noosfero / noosfero


Commits:
b6463289 by Marcelo Júnior at 2017-05-04T10:45:26-03:00
check if target exist

- - - - -
fd4af0ea by Victor Costa at 2017-05-04T14:27:40+00:00
Merge branch 'fix-tracked-notifications-migrate' into 'master'

check if target exist

See merge request !1192
- - - - -


1 changed file:

- db/migrate/20170427104432_fixes_tracked_notifications_receiver_info.rb


Changes:

=====================================
db/migrate/20170427104432_fixes_tracked_notifications_receiver_info.rb
=====================================
--- a/db/migrate/20170427104432_fixes_tracked_notifications_receiver_info.rb
+++ b/db/migrate/20170427104432_fixes_tracked_notifications_receiver_info.rb
@@ -1,9 +1,11 @@
 class FixesTrackedNotificationsReceiverInfo < ActiveRecord::Migration
   def up
     ActionTracker::Record.where(verb: 'reply_scrap_on_self').find_each do |n|
-      n.params['receiver_name'] ||= n.target.receiver.name
-      n.params['receiver_url'] ||= n.target.receiver.url
-      n.save
+      if n.target
+        n.params['receiver_name'] ||= n.target.receiver.name
+        n.params['receiver_url'] ||= n.target.receiver.url
+        n.save
+      end
     end
   end
 



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/cd723e733ddca9fa5a3c8e73748fa9789bac293c...fd4af0ea600e9d3205bc9009f8cd41acdcf70e7a

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/cd723e733ddca9fa5a3c8e73748fa9789bac293c...fd4af0ea600e9d3205bc9009f8cd41acdcf70e7a
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170504/0f1277fa/attachment-0001.html>


More information about the Noosfero-dev mailing list