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
Boxiang Sun
gitlab-ce
Commits
89ea6a99
Commit
89ea6a99
authored
Jan 26, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Callout model
parent
4376be84
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
app/models/callout.rb
app/models/callout.rb
+3
-0
app/models/user.rb
app/models/user.rb
+1
-0
db/migrate/20180125214301_create_callouts.rb
db/migrate/20180125214301_create_callouts.rb
+19
-0
No files found.
app/models/callout.rb
0 → 100644
View file @
89ea6a99
class
Callout
<
ActiveRecord
::
Base
belongs_to
:user
end
app/models/user.rb
View file @
89ea6a99
...
...
@@ -137,6 +137,7 @@ class User < ActiveRecord::Base
has_many
:assigned_merge_requests
,
dependent: :nullify
,
foreign_key: :assignee_id
,
class_name:
"MergeRequest"
# rubocop:disable Cop/ActiveRecordDependent
has_many
:custom_attributes
,
class_name:
'UserCustomAttribute'
has_many
:callouts
#
# Validations
...
...
db/migrate/20180125214301_create_callouts.rb
0 → 100644
View file @
89ea6a99
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
CreateCallouts
<
ActiveRecord
::
Migration
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
def
change
create_table
:callouts
do
|
t
|
t
.
string
:feature_name
,
null:
false
t
.
boolean
:dismissed_state
,
null:
false
t
.
references
:user
,
index:
true
,
foreign_key:
{
on_delete: :cascade
},
null:
false
t
.
timestamps_with_timezone
null:
false
end
add_index
:callouts
,
:feature_name
,
unique:
true
end
end
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