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
iv
gitlab-ce
Commits
144d22f7
Commit
144d22f7
authored
Jul 12, 2016
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete award emoji when deleting a user
parent
d5c715c9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
3 deletions
+25
-3
CHANGELOG
CHANGELOG
+2
-1
app/models/user.rb
app/models/user.rb
+1
-1
db/migrate/20160712171823_remove_award_emojis_with_no_user.rb
...igrate/20160712171823_remove_award_emojis_with_no_user.rb
+21
-0
db/schema.rb
db/schema.rb
+1
-1
No files found.
CHANGELOG
View file @
144d22f7
...
@@ -8,6 +8,7 @@ v 8.10.0 (unreleased)
...
@@ -8,6 +8,7 @@ v 8.10.0 (unreleased)
- Refactor repository paths handling to allow multiple git mount points
- Refactor repository paths handling to allow multiple git mount points
- Optimize system note visibility checking by memoizing the visible reference count !5070
- Optimize system note visibility checking by memoizing the visible reference count !5070
- Add Application Setting to configure default Repository Path for new projects
- Add Application Setting to configure default Repository Path for new projects
- Delete award emoji when deleting a user
- Remove pinTo from Flash and make inline flash messages look nicer !4854 (winniehell)
- Remove pinTo from Flash and make inline flash messages look nicer !4854 (winniehell)
- Wrap code blocks on Activies and Todos page. !4783 (winniehell)
- Wrap code blocks on Activies and Todos page. !4783 (winniehell)
- Align flash messages with left side of page content !4959 (winniehell)
- Align flash messages with left side of page content !4959 (winniehell)
...
...
app/models/user.rb
View file @
144d22f7
...
@@ -87,7 +87,7 @@ class User < ActiveRecord::Base
...
@@ -87,7 +87,7 @@ class User < ActiveRecord::Base
has_many
:builds
,
dependent: :nullify
,
class_name:
'Ci::Build'
has_many
:builds
,
dependent: :nullify
,
class_name:
'Ci::Build'
has_many
:todos
,
dependent: :destroy
has_many
:todos
,
dependent: :destroy
has_many
:notification_settings
,
dependent: :destroy
has_many
:notification_settings
,
dependent: :destroy
has_many
:award_emoji
,
as: :awardable
,
dependent: :destroy
has_many
:award_emoji
,
dependent: :destroy
#
#
# Validations
# Validations
...
...
db/migrate/20160712171823_remove_award_emojis_with_no_user.rb
0 → 100644
View file @
144d22f7
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
RemoveAwardEmojisWithNoUser
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
# existing transaction. When using "add_concurrent_index" make sure that this
# method is the _only_ method called in the migration, any other changes
# should go in a separate migration. This ensures that upon failure _only_ the
# index creation fails and can be retried or reverted easily.
#
# To disable transactions uncomment the following line and remove these
# comments:
# disable_ddl_transaction!
def
up
AwardEmoji
.
joins
(
'LEFT JOIN users ON users.id = user_id'
).
where
(
'users.id IS NULL'
).
destroy_all
end
end
db/schema.rb
View file @
144d22f7
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
# It's strongly recommended that you check this file into your version control system.
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201607
0710433
3
)
do
ActiveRecord
::
Schema
.
define
(
version:
201607
1217182
3
)
do
# These are extensions that must be enabled in order to support this database
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
enable_extension
"plpgsql"
...
...
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