Merge branch 'master' of git@github.com:penguincoder/binaryattraction
commit
872c832f38
|
@ -5,8 +5,8 @@ class Users < Application
|
||||||
include Ambethia::ReCaptcha::Controller
|
include Ambethia::ReCaptcha::Controller
|
||||||
|
|
||||||
def index
|
def index
|
||||||
if current_user.administrator?
|
if logged_in? and current_user.administrator?
|
||||||
@users = User.find :all, :order => 'user_name ASC'
|
@users = User.find :all, :order => 'user_name ASC', :conditions => 'facebook_id IS NULL'
|
||||||
render
|
render
|
||||||
else
|
else
|
||||||
redirect url(:user, :id => current_user.user_name)
|
redirect url(:user, :id => current_user.user_name)
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
# libraries used
|
# 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
|
require lib
|
||||||
end
|
end
|
||||||
# require AR models
|
# require AR models
|
||||||
|
@ -46,8 +46,9 @@ configure do
|
||||||
log.debug "Using #{Sinatra.env} database environment"
|
log.debug "Using #{Sinatra.env} database environment"
|
||||||
db_config = YAML::load_file(File.dirname(__FILE__) + '/config/database.yml')[Sinatra.env]
|
db_config = YAML::load_file(File.dirname(__FILE__) + '/config/database.yml')[Sinatra.env]
|
||||||
ActiveRecord::Base.logger = log
|
ActiveRecord::Base.logger = log
|
||||||
ActiveRecord::Base.establish_connection db_config
|
|
||||||
ActiveRecord::Base.allow_concurrency = true
|
ActiveRecord::Base.allow_concurrency = true
|
||||||
|
ActiveRecord::Base.verification_timeout = 300
|
||||||
|
ActiveRecord::Base.establish_connection db_config
|
||||||
rescue => exception
|
rescue => exception
|
||||||
log.fatal "There was a problem loading the database.yml file:"
|
log.fatal "There was a problem loading the database.yml file:"
|
||||||
exception.backtrace.each do |msg|
|
exception.backtrace.each do |msg|
|
||||||
|
|
Reference in New Issue