Permalink
Browse files

Merge branch 'master' of git@github.com:towski/twitbook

  • Loading branch information...
2 parents 0881c83 + 91c7385 commit 7059bc5dd3dfea6827018ff77d0710745bdad14d @towski committed Jan 26, 2009
Showing with 14 additions and 5 deletions.
  1. +2 −2 app/controllers/status_controller.rb
  2. +9 −0 db/migrate/20090126000938_rename_user_column.rb
  3. +2 −2 db/schema.rb
  4. +1 −1 script/pull_statuses
@@ -7,10 +7,10 @@ def index
@facebook_user = session[:facebook_session].user
@user = FacebookUser.find_or_initialize_by_id @facebook_user.id
@user.save if @user.new_record?
- @statuses = @user.statuses + FacebookStatus.all(:conditions => {:user_id => @facebook_user.friends.map(&:id)})
+ @statuses = @user.statuses + FacebookStatus.all(:conditions => {:facebook_user_id => @facebook_user.friends.map(&:id)})
@statuses = @statuses.sort_by(&:created_at)
@statuses.reverse!
- @status = Facebooktatus.new(params[:status])
+ @status = FacebookStatus.new(params[:status])
else
redirect_to '/'
end
@@ -0,0 +1,9 @@
+class RenameUserColumn < ActiveRecord::Migration
+ def self.up
+ rename_column :facebook_statuses, :user_id, :facebook_user_id
+ end
+
+ def self.down
+ rename_column :facebook_statuses, :facebook_user_id, :user_id
+ end
+end
View
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20090115015128) do
+ActiveRecord::Schema.define(:version => 20090126000938) do
create_table "delayed_jobs", :force => true do |t|
t.integer "priority", :default => 0
@@ -26,7 +26,7 @@
create_table "facebook_statuses", :force => true do |t|
t.text "message"
- t.integer "user_id"
+ t.integer "facebook_user_id"
t.datetime "created_at"
t.datetime "updated_at"
end
View
@@ -1,4 +1,4 @@
-#!/usr/bin/env ruby
+#!/usr/local/bin/ruby
ENV['RAILS_ENV'] ||= "production"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
FacebookUser.all do |user|

0 comments on commit 7059bc5

Please sign in to comment.