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
f1ecf53c
Commit
f1ecf53c
authored
Nov 12, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Broadcast message model + migrations
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
0a08c775
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
1 deletion
+44
-1
app/models/broadcast_message.rb
app/models/broadcast_message.rb
+5
-0
db/migrate/20131112114325_create_broadcast_messages.rb
db/migrate/20131112114325_create_broadcast_messages.rb
+12
-0
db/schema.rb
db/schema.rb
+10
-1
spec/factories/broadcast_messages.rb
spec/factories/broadcast_messages.rb
+10
-0
spec/models/broadcast_message_spec.rb
spec/models/broadcast_message_spec.rb
+7
-0
No files found.
app/models/broadcast_message.rb
0 → 100644
View file @
f1ecf53c
class
BroadcastMessage
<
ActiveRecord
::
Base
attr_accessible
:alert_type
,
:ends_at
,
:message
,
:starts_at
validates
:message
,
presence:
true
end
db/migrate/20131112114325_create_broadcast_messages.rb
0 → 100644
View file @
f1ecf53c
class
CreateBroadcastMessages
<
ActiveRecord
::
Migration
def
change
create_table
:broadcast_messages
do
|
t
|
t
.
text
:message
,
null:
false
t
.
datetime
:starts_at
t
.
datetime
:ends_at
t
.
integer
:alert_type
t
.
timestamps
end
end
end
db/schema.rb
View file @
f1ecf53c
...
...
@@ -11,7 +11,16 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
20131106151520
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
20131112114325
)
do
create_table
"broadcast_messages"
,
:force
=>
true
do
|
t
|
t
.
text
"message"
,
:null
=>
false
t
.
datetime
"starts_at"
t
.
datetime
"ends_at"
t
.
integer
"alert_type"
t
.
datetime
"created_at"
,
:null
=>
false
t
.
datetime
"updated_at"
,
:null
=>
false
end
create_table
"deploy_keys_projects"
,
:force
=>
true
do
|
t
|
t
.
integer
"deploy_key_id"
,
:null
=>
false
...
...
spec/factories/broadcast_messages.rb
0 → 100644
View file @
f1ecf53c
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl
.
define
do
factory
:broadcast_message
do
message
"MyText"
starts_at
"2013-11-12 13:43:25"
ends_at
"2013-11-12 13:43:25"
alert_type
1
end
end
spec/models/broadcast_message_spec.rb
0 → 100644
View file @
f1ecf53c
require
'spec_helper'
describe
BroadcastMessage
do
subject
{
create
(
:broadcast_message
)
}
it
{
should
be_valid
}
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