Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed ActiveRecord connection when racked in an application with it's…

… own ActiveRecord connection
  • Loading branch information...
commit 8176cc69efc68bdac1b26117a1b353cb19411d1b 1 parent 9eee1b4
@breadbeard breadbeard authored zuk committed
Showing with 5 additions and 3 deletions.
  1. +1 −0  Gemfile
  2. +4 −3 lib/casserver/server.rb
View
1  Gemfile
@@ -1,2 +1,3 @@
source "http://rubygems.org"
gemspec
+
View
7 lib/casserver/server.rb
@@ -252,10 +252,9 @@ def self.init_logger!
end
def self.init_database!
- #CASServer::Model::Base.establish_connection(config[:database])
- ActiveRecord::Base.establish_connection(config[:database])
-
+
unless config[:disable_auto_migrations]
+ ActiveRecord::Base.establish_connection(config[:database])
print_cli_message "Running migrations to make sure your database schema is up to date..."
prev_db_log = ActiveRecord::Base.logger
ActiveRecord::Base.logger = Logger.new(STDOUT)
@@ -264,6 +263,8 @@ def self.init_database!
ActiveRecord::Base.logger = prev_db_log
print_cli_message "Your database is now up to date."
end
+
+ CASServer::Model::Base.establish_connection(config[:database])
end
configure do
Please sign in to comment.
Something went wrong with that request. Please try again.