Moved utilities out to special controller, took pound sign out of database name
This commit is contained in:
parent
74691228d3
commit
6b1f020839
5 changed files with 63 additions and 57 deletions
|
|
@ -11,57 +11,4 @@ class DashboardsController < ApplicationController
|
|||
render :index
|
||||
end
|
||||
|
||||
def warzombie
|
||||
render :nothing => true
|
||||
if User.owner.email == "tom@tom.joindiaspora.com" && StatusMessage.where(:message => "There's a bomb in the lasagna!?").first == nil
|
||||
StatusMessage.create(:message => "There's a bomb in the lasagna!?", :person => User.owner)
|
||||
Bookmark.create(:title => "xkcd", :link => "http://xkcd.com/743/", :person => User.owner )
|
||||
StatusMessage.create(:message => "I switched to Motoroi today, a Motorola Android-based phone, in Korea. Now, I am using Android phones in both the U.S. and Korea", :person => User.owner, :created_at => Time.now-930)
|
||||
StatusMessage.create(:message => "I had 5 hours to study for it :-( GREs on Thursday. Wunderbar.", :person => User.owner, :created_at => Time.now-43990)
|
||||
StatusMessage.create(:message => "Spotted in toy story 3: google maps, OSX, and windows XP. Two out of three isn't bad.", :person => User.owner, :created_at => Time.now-4390)
|
||||
Bookmark.create( :title => "Reddit", :link => "http://reddit.com", :person => User.owner, :created_at => Time.now-54390)
|
||||
Blog.create(:title => "I Love Rock'N'Roll - Joan Jett & The Blackhearts", :body => "<p>The loudspeakers played this song as we walked into the city pool for the first time this summer. Those loudspeakers make every song sound fresh even if I have heard it a thousand times and their effect on this song was no different. Joan sounded young and strong and ready, and for a moment I forgot where or when I was.</p> <p>also i can tell it won’t be long and also happy summer imaginary constructs -mumblelard</p>", :person => User.owner, :created_at => Time.now-3090)
|
||||
StatusMessage.create(:message => "Commercials for IE make me SO MAD and my friends just don't get why.", :person => User.owner, :created_at => Time.now-30900)
|
||||
Bookmark.create(:title => "Zombo.com", :link => "http://zombo.com", :person => User.owner, :created_at => Time.now-9090)
|
||||
StatusMessage.create(:message => "Why do I have \"No More Heroes\" by Westlife on repeat all day?", :person => User.owner, :created_at => Time.now-590000)
|
||||
StatusMessage.create(:message => "Mmm. Friday night. Acknowledged.", :person => User.owner, :created_at => Time.now-503900)
|
||||
StatusMessage.create(:message => "Getting a universal remote is the epitome of laziness, I do declare.", :person => User.owner, :created_at => Time.now-4400)
|
||||
StatusMessage.create(:message => "Does anyone know how to merge two Skype contact entries of the same person? (i.e. one Skype ID and one mobile number)", :person => User.owner, :created_at => Time.now-400239)
|
||||
StatusMessage.create(:message => "A cool, cool morning for once.", :person => User.owner, :created_at => Time.now-150000)
|
||||
end
|
||||
end
|
||||
|
||||
def zombiefriends
|
||||
render :nothing => true
|
||||
backer_info = ["http://washington.joindiaspora.com/",
|
||||
"http://adams.joindiaspora.com/",
|
||||
"http://jefferson.joindiaspora.com/",
|
||||
"http://madison.joindiaspora.com/",
|
||||
"http://monroe.joindiaspora.com/",
|
||||
"http://quincyadams.joindiaspora.com/",
|
||||
"http://jackson.joindiaspora.com/",
|
||||
"http://buren.joindiaspora.com/",
|
||||
"http://harrison.joindiaspora.com/",
|
||||
"http://tyler.joindiaspora.com/",
|
||||
"http://polk.joindiaspora.com/",
|
||||
#"http://taylor.joindiaspora.com/",
|
||||
#"http://fillmore.joindiaspora.com/",
|
||||
#"http://pierce.joindiaspora.com/",
|
||||
]
|
||||
|
||||
if User.owner.email == "tom@tom.joindiaspora.com" && Person.friends.first.nil?
|
||||
backer_info.each do |backer|
|
||||
logger.info "Zombefriending #{backer}"
|
||||
User.owner.send_friend_request_to(backer)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def zombiefriendaccept
|
||||
render :nothing => true
|
||||
Request.all.each{|r|
|
||||
User.owner.accept_friend_request(r.id)
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
58
app/controllers/dev_utilities_controller.rb
Normal file
58
app/controllers/dev_utilities_controller.rb
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
class DevUtilitiesController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
include ApplicationHelper
|
||||
def warzombie
|
||||
render :nothing => true
|
||||
if User.owner.email == "tom@tom.joindiaspora.com" && StatusMessage.where(:message => "There's a bomb in the lasagna!?").first == nil
|
||||
StatusMessage.create(:message => "There's a bomb in the lasagna!?", :person => User.owner)
|
||||
Bookmark.create(:title => "xkcd", :link => "http://xkcd.com/743/", :person => User.owner )
|
||||
StatusMessage.create(:message => "I switched to Motoroi today, a Motorola Android-based phone, in Korea. Now, I am using Android phones in both the U.S. and Korea", :person => User.owner, :created_at => Time.now-930)
|
||||
StatusMessage.create(:message => "I had 5 hours to study for it :-( GREs on Thursday. Wunderbar.", :person => User.owner, :created_at => Time.now-43990)
|
||||
StatusMessage.create(:message => "Spotted in toy story 3: google maps, OSX, and windows XP. Two out of three isn't bad.", :person => User.owner, :created_at => Time.now-4390)
|
||||
Bookmark.create( :title => "Reddit", :link => "http://reddit.com", :person => User.owner, :created_at => Time.now-54390)
|
||||
Blog.create(:title => "I Love Rock'N'Roll - Joan Jett & The Blackhearts", :body => "<p>The loudspeakers played this song as we walked into the city pool for the first time this summer. Those loudspeakers make every song sound fresh even if I have heard it a thousand times and their effect on this song was no different. Joan sounded young and strong and ready, and for a moment I forgot where or when I was.</p> <p>also i can tell it won’t be long and also happy summer imaginary constructs -mumblelard</p>", :person => User.owner, :created_at => Time.now-3090)
|
||||
StatusMessage.create(:message => "Commercials for IE make me SO MAD and my friends just don't get why.", :person => User.owner, :created_at => Time.now-30900)
|
||||
Bookmark.create(:title => "Zombo.com", :link => "http://zombo.com", :person => User.owner, :created_at => Time.now-9090)
|
||||
StatusMessage.create(:message => "Why do I have \"No More Heroes\" by Westlife on repeat all day?", :person => User.owner, :created_at => Time.now-590000)
|
||||
StatusMessage.create(:message => "Mmm. Friday night. Acknowledged.", :person => User.owner, :created_at => Time.now-503900)
|
||||
StatusMessage.create(:message => "Getting a universal remote is the epitome of laziness, I do declare.", :person => User.owner, :created_at => Time.now-4400)
|
||||
StatusMessage.create(:message => "Does anyone know how to merge two Skype contact entries of the same person? (i.e. one Skype ID and one mobile number)", :person => User.owner, :created_at => Time.now-400239)
|
||||
StatusMessage.create(:message => "A cool, cool morning for once.", :person => User.owner, :created_at => Time.now-150000)
|
||||
end
|
||||
end
|
||||
|
||||
def zombiefriends
|
||||
render :nothing => true
|
||||
backer_info = ["http://washington.joindiaspora.com/",
|
||||
"http://adams.joindiaspora.com/",
|
||||
"http://jefferson.joindiaspora.com/",
|
||||
"http://madison.joindiaspora.com/",
|
||||
"http://monroe.joindiaspora.com/",
|
||||
"http://quincyadams.joindiaspora.com/",
|
||||
"http://jackson.joindiaspora.com/",
|
||||
"http://buren.joindiaspora.com/",
|
||||
"http://harrison.joindiaspora.com/",
|
||||
"http://tyler.joindiaspora.com/",
|
||||
"http://polk.joindiaspora.com/",
|
||||
#"http://taylor.joindiaspora.com/",
|
||||
#"http://fillmore.joindiaspora.com/",
|
||||
#"http://pierce.joindiaspora.com/",
|
||||
]
|
||||
|
||||
if User.owner.email == "tom@tom.joindiaspora.com" && Person.friends.first.nil?
|
||||
backer_info.each do |backer|
|
||||
logger.info "Zombefriending #{backer}"
|
||||
User.owner.send_friend_request_to(backer)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def zombiefriendaccept
|
||||
render :nothing => true
|
||||
Request.all.each{|r|
|
||||
User.owner.accept_friend_request(r.id)
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
|
@ -11,4 +11,5 @@ class GridfsController < ActionController::Metal
|
|||
self.response_body = "File totally imaginary #{gridfs_path}"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
MongoMapper.connection = Mongo::Connection.new('localhost', 27017)
|
||||
|
||||
MongoMapper.database = "#diaspora-#{Rails.env}"
|
||||
MongoMapper.database = "diaspora-#{Rails.env}"
|
||||
|
||||
if defined?(PhusionPassenger)
|
||||
PhusionPassenger.on_event(:starting_worker_process) do |forked|
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ Diaspora::Application.routes.draw do |map|
|
|||
|
||||
match "/images/files/*path" => "gridfs#serve"
|
||||
|
||||
match 'warzombie', :to => "dashboards#warzombie"
|
||||
match 'zombiefriends', :to => "dashboards#zombiefriends"
|
||||
match 'zombiefriendaccept', :to => "dashboards#zombiefriendaccept"
|
||||
match 'warzombie', :to => "dev_utilities#warzombie"
|
||||
match 'zombiefriends', :to => "dev_utilities#zombiefriends"
|
||||
match 'zombiefriendaccept', :to => "dev_utilities#zombiefriendaccept"
|
||||
|
||||
#routes for devise, not really sure you will need to mess with this in the future, lets put default,
|
||||
#non mutable stuff in anohter file
|
||||
|
|
|
|||
Loading…
Reference in a new issue