BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
127119f2
Commit
127119f2
authored
Apr 08, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify query to retrieve NotificationSetting on controllers
parent
d11288be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
notification_settings_controller.rb
app/controllers/groups/notification_settings_controller.rb
+1
-1
notification_settings_controller.rb
app/controllers/projects/notification_settings_controller.rb
+1
-1
No files found.
app/controllers/groups/notification_settings_controller.rb
View file @
127119f2
class
Groups
::
NotificationSettingsController
<
Groups
::
ApplicationController
def
update
notification_setting
=
group
.
notification_settings
.
where
(
user_id:
current_user
).
find
(
params
[
:id
]
)
notification_setting
=
group
.
notification_settings
.
find_by
(
user_id:
current_user
)
saved
=
notification_setting
.
update_attributes
(
notification_setting_params
)
render
json:
{
saved:
saved
}
...
...
app/controllers/projects/notification_settings_controller.rb
View file @
127119f2
...
...
@@ -8,7 +8,7 @@ class Projects::NotificationSettingsController < Projects::ApplicationController
end
def
update
notification_setting
=
project
.
notification_settings
.
where
(
user_id:
current_user
).
find
(
params
[
:id
]
)
notification_setting
=
project
.
notification_settings
.
find_by
(
user_id:
current_user
)
saved
=
notification_setting
.
update_attributes
(
notification_setting_params
)
render
json:
{
saved:
saved
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment