Add method to return the user notification setting for a group, or a project

parent ee497599
......@@ -105,7 +105,7 @@ class ProjectsController < Projects::ApplicationController
@membership = @project.team.find_member(current_user.id)
if @membership
@notification_setting = current_user.notification_settings.find_or_initialize_by(source: @project)
@notification_setting = current_user.notification_settings_for(@project)
end
end
......
......@@ -831,6 +831,10 @@ class User < ActiveRecord::Base
end
end
def notification_settings_for(source)
notification_settings.find_or_initialize_by(source: source)
end
private
def projects_union
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment