parent
41ea3a1baf
commit
0b6168c7fd
@ -0,0 +1,5 @@
|
||||
class ContestNotificationController
|
||||
def show
|
||||
|
||||
end
|
||||
end
|
@ -0,0 +1,3 @@
|
||||
class ContestNotification < ActiveRecord::Base
|
||||
attr_accessible :content, :title
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
class CreateContestNotifications < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :contest_notifications do |t|
|
||||
t.text :title
|
||||
t.text :content
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,19 @@
|
||||
# -*coding:utf-8 -*-
|
||||
class SetNotification < ActiveRecord::Migration
|
||||
def change
|
||||
notifications = ContestNotification.all
|
||||
if notifications.nil? || notifications.count == 0
|
||||
notification = ContestNotification.new
|
||||
notification.title = "2014年Android程序设计大赛获奖名单"
|
||||
notification.content = "<div><span style='color: red'>一等奖:</span> <span style='color: #1166AD'>消灭那怪兽</span></div>
|
||||
<div><span style='color: red'>二等奖:</span> <span style='color: #1166AD'>兄弟向前冲 </span></div>
|
||||
<div><span style='color: red'>二等奖:</span> <span style='color: #1166AD'>鸟鸟文件管理器(银河之光版)</span></div>
|
||||
<div><span style='color: red'>三等奖:</span> <span style='color: #1166AD'>疯狂猜图</span></div>
|
||||
<div><span style='color: red'>三等奖:</span> <span style='color: #1166AD'>愉快的定向越野 </span></div>
|
||||
<div><span style='color: red'>三等奖:</span> <span style='color: #1166AD'>体能训练助手 </span></div>
|
||||
<div><span style='color: red'>三等奖:</span> <span style='color: #1166AD'>迷你日记本 </span></div>
|
||||
<div><span style='color: red'>三等奖:</span> <span style='color: #1166AD'>永齐飞机大战</span></div>"
|
||||
notification.save
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue