Created
August 26, 2011 22:57
-
-
Save DavidMah/1174646 to your computer and use it in GitHub Desktop.
Fill up your Postercloud Rails Backend with stuff.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_sites(options = {}) | |
times = options[:times] ? options[:times] : 50 | |
users = options[:users] ? options[:users] : User.all | |
times.times do |t| | |
n = Site.new | |
begin | |
n.user = users.sample | |
n.hostname = "siteno#{t}" | |
n.save | |
puts t | |
rescue | |
puts $! | |
end | |
end | |
end | |
def make_notifications(options = {}) | |
times = options[:times] ? options[:times] : 50 | |
posts = options[:posts] ? options[:posts] : Post.all | |
users = options[:users] ? options[:users] : User.all | |
post_ids = posts.collect(&:id) | |
50.times do |t| | |
n = Notification.new | |
n.notifiable_type = 'Post' | |
begin | |
n.notifiable_id = post_ids | |
n.user = users.sample | |
n.save | |
puts t | |
rescue | |
puts $! | |
end | |
end | |
end | |
def make_likes(options = {}) | |
times = options[:times] ? options[:times] : 50 | |
users = options[:users] ? options[:users] : User.all | |
posts = options[:posts] ? options[:posts] : Post.all | |
times.times do |t| | |
n = Comment.new | |
begin | |
n.post = posts.sample | |
n.user = users.sample | |
n.comment_type = 1 | |
n.body = "" | |
n.save | |
puts t | |
rescue | |
puts $! | |
end | |
end | |
end | |
def make_comments(options = {}) | |
times = options[:times] ? options[:times] : 50 | |
users = options[:users] ? options[:users] : User.all | |
posts = options[:posts] ? options[:posts] : Post.all | |
times.times do |t| | |
n = Comment.new | |
begin | |
n.post = posts.sample | |
n.user = users.sample | |
n.body = "朝 目が覚めて | |
真っ先に思い浮かぶ 君のこと | |
思い切って 前髪を切った | |
「どうしたの?」って 聞かれたくて | |
ピンクのスカート お花の髪飾り | |
さして 出かけるの | |
今日の私はかわいいのよ! | |
メルト 溶けてしまいそう | |
好きだなんて 絶対にいえない… だけど | |
メルト 目も合わせられない | |
恋に恋なんてしないわ わたし | |
だって 君のことが …好きなの | |
天気予\報が ウソ\をついた | |
土砂降りの雨が降る | |
カバンに入れたままの オリタタミ傘 うれしくない | |
ためいきをついた そんなとき | |
「しょうがないから入ってやる」なんて | |
隣にいる きみが笑う | |
恋に落ちる音がした | |
メルト 息がつまりそう | |
君に触れてる右手が 震える | |
高鳴る胸 はんぶんこの傘 | |
手を伸ばせば届く距離 どうしよう…! | |
想いよ届け 君に | |
お願い時間を止めて 泣きそうなの | |
でも嬉しくて 死んでしまうわ! | |
メルト 駅に着いてしまう… | |
もう会えない 近くて 遠いよ だから | |
メルト 手をつないで歩きたい! | |
もうバイバイしなくちゃいけないの? | |
今すぐ わたしを抱きしめて! | |
…なんてね" | |
n.comment_type = 2 | |
n.save | |
puts t | |
rescue | |
puts $! | |
end | |
end | |
end | |
def make_posts(options = {}) | |
times = options[:times] ? options[:times] : 50 | |
sites = options[:sites] ? options[:sites] : Site.all | |
times.times do |t| | |
n = Post.new | |
begin | |
n.site = sites.sample | |
n.body = "君と眺めてた | |
星を集めたに | |
映してた | |
また 指折り数えた | |
瞬間(とき)を重ねた夜に | |
問いかけた | |
時を止めた | |
すきだよと言えば はぐらかした | |
気がつかないフリは | |
もうやめて>< | |
隣にいるとき | |
私の軌道はいつも | |
周極星 | |
トレモロみたいに | |
波打つ思考の角度 | |
つかめない 君を追えば | |
なにかを失ってしまいそうな | |
想い浮かべ 船を出す | |
抱きしめて 出会わなければ 個々 | |
受け止めて デネボラを 飛び越え行くわ | |
ワガママな歳差(さいさ) 星(きみ)のようだね | |
追いかけて うかぶパノラマ | |
五線の上で 流れ星 | |
いま歌うから 照らしてよね スピカ | |
笑っていたいよ ひとりはイヤだよ | |
答えが聞きたい 怖くて聞けない | |
夜を いくつも 過ごして | |
未来へ 繋ぐの | |
またたく星をよけ 探してた | |
神話は 誰の味方なの | |
ため息で 落ち込んでいた 午後 | |
想うだけ 君の名を一人つぶやくわ | |
あさはかな愛じゃ 届かないよね | |
会いたくて ピアノ奏でた 音 | |
苦しくて 溢れ出す | |
余韻嫋々(じょうじょう) 君に届け | |
抱きしめて 出会わなければ 個々 | |
受け止めて デネボラを 飛び越え行くわ | |
ワガママな歳差(さいさ) 星(きみ)のようだね | |
追いかけて うかぶパノラマ | |
五線の上で 流れ星 | |
いま歌うから 照らしてよね スピカ " | |
n.save | |
puts t | |
rescue | |
puts $! | |
end | |
end | |
end | |
make_sites( :times => 50) | |
make_posts( :times => 1000) | |
make_comments(:times => 3000) | |
make_likes( :times => 3000) | |
make_notifs( :times => 400) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment