From 407a68319e374cf789e90df7bdfa6dee4e894559 Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 25 Nov 2008 18:03:37 -0600 Subject: [PATCH 1/5] explicitly require mysql so that the pure ruby library is not loaded --- binaryattraction_facebooker.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binaryattraction_facebooker.rb b/binaryattraction_facebooker.rb index 7e172e8..785ec8a 100755 --- a/binaryattraction_facebooker.rb +++ b/binaryattraction_facebooker.rb @@ -16,7 +16,7 @@ # # libraries used -%w(rubygems frankie active_record yaml memcache memcache_util).each do |lib| +%w(rubygems frankie mysql active_record yaml memcache memcache_util).each do |lib| require lib end # require AR models From e3c6cf9888613bf3562842c3206f45388cdea283 Mon Sep 17 00:00:00 2001 From: andrew Date: Wed, 26 Nov 2008 11:55:45 -0600 Subject: [PATCH 2/5] do not show facebook users --- app/controllers/users.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users.rb b/app/controllers/users.rb index 4555084..46441e0 100644 --- a/app/controllers/users.rb +++ b/app/controllers/users.rb @@ -6,7 +6,7 @@ class Users < Application def index if current_user.administrator? - @users = User.find :all, :order => 'user_name ASC' + @users = User.find :all, :order => 'user_name ASC', :conditions => 'facebok_id IS NULL' render else redirect url(:user, :id => current_user.user_name) From c72141b84e4e7e2bedd63eed94aa7618ed7b740f Mon Sep 17 00:00:00 2001 From: andrew Date: Wed, 26 Nov 2008 11:57:50 -0600 Subject: [PATCH 3/5] do not show facebook users (real column name) --- app/controllers/users.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users.rb b/app/controllers/users.rb index 46441e0..fd251fd 100644 --- a/app/controllers/users.rb +++ b/app/controllers/users.rb @@ -6,7 +6,7 @@ class Users < Application def index if current_user.administrator? - @users = User.find :all, :order => 'user_name ASC', :conditions => 'facebok_id IS NULL' + @users = User.find :all, :order => 'user_name ASC', :conditions => 'facebook_id IS NULL' render else redirect url(:user, :id => current_user.user_name) From 394bb364e874927c4e28621f88479088239374c0 Mon Sep 17 00:00:00 2001 From: andrew Date: Thu, 4 Dec 2008 22:47:20 -0600 Subject: [PATCH 4/5] anonymous users are not logged in --- app/controllers/users.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users.rb b/app/controllers/users.rb index fd251fd..ac15242 100644 --- a/app/controllers/users.rb +++ b/app/controllers/users.rb @@ -5,7 +5,7 @@ class Users < Application include Ambethia::ReCaptcha::Controller def index - if current_user.administrator? + if logged_in? and current_user.administrator? @users = User.find :all, :order => 'user_name ASC', :conditions => 'facebook_id IS NULL' render else From 773123403274f773082b21974738b91490f348a5 Mon Sep 17 00:00:00 2001 From: andrew Date: Thu, 4 Dec 2008 23:00:12 -0600 Subject: [PATCH 5/5] specify options first --- binaryattraction_facebooker.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/binaryattraction_facebooker.rb b/binaryattraction_facebooker.rb index 2609dc8..5a59fa7 100755 --- a/binaryattraction_facebooker.rb +++ b/binaryattraction_facebooker.rb @@ -46,8 +46,9 @@ configure do log.debug "Using #{Sinatra.env} database environment" db_config = YAML::load_file(File.dirname(__FILE__) + '/config/database.yml')[Sinatra.env] ActiveRecord::Base.logger = log - ActiveRecord::Base.establish_connection db_config ActiveRecord::Base.allow_concurrency = true + ActiveRecord::Base.verification_timeout = 300 + ActiveRecord::Base.establish_connection db_config rescue => exception log.fatal "There was a problem loading the database.yml file:" exception.backtrace.each do |msg|