Project

General

Profile

Help with new plugin and accessing custom fields

Added by Chris Born over 14 years ago

I have a basic new plugin I have been working on that sends realtime notifications. So far so good. In moving on with development I have added a custom user field (example "Notification Name").

As an example:

def controller_wiki_edit_after_save(context = { })
      @project = context[:project]
      @page = context[:page]
      @user = @page.content.author
      do_notify("#{@user.firstname} edited the wiki.", notificationName)
end

I need to be able to access the user that is watching the item's custom "Notification Name" field.
So I guess it is a two part question. How do I find out the user being notified via watching, and second how can I access the custom fields for that user?