Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
app/controllers/groups/notification_settings_controller.rb
app/controllers/groups/notification_settings_controller.rb
+1
-1
app/controllers/projects/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