Skip to content

Commit

Permalink
adding database support
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron J. Bedra committed Sep 7, 2008
1 parent d4b1044 commit a41177b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.gem
log
coverage
TAGS
TAGS
db
14 changes: 13 additions & 1 deletion app/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,16 @@
:views => views,
:public => pub_dir

end
$cas_config.cas_adapter.each do |key,value|
if key == "database"
ActiveRecord::Base.establish_connection(
value.each do |key, value|
"#{key.to_sym} => #{value.to_s}"
end
)
end
end

ActiveRecord::Base.logger = Logger.new(STDERR)
ActiveRecord::Migrator.migrate('lib/castronaut/db', ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
end
1 change: 1 addition & 0 deletions castronaut.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
gem :activesupport, '>= 2.1.0'

require 'active_support'
require 'activerecord'
require File.expand_path(File.join(File.dirname(__FILE__), 'lib', 'castronaut'))
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateCASDatabase < ActiveRecord::Migration
class CreateCasDatabase < ActiveRecord::Migration
def self.up
create_table :casserver_lt, :force => true do |t|
t.column :ticket, :string, :null => false
Expand Down

0 comments on commit a41177b

Please sign in to comment.