Noosfero/noosfero

View on GitHub
plugins/push_notification/lib/push_notification_plugin/observers/observers_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage
module PushNotificationPlugin::Observers::ObserversHelper
  def get_target_and_requestor(article)
    target = article.target, requestor = article.requestor
  end

  def get_users_info(target)
    if target.person?
      users = [target.user]
    elsif target.organization?
      users = target.admins.map { |person| person.user }
    end
  end
end