Permalink
Browse files

Fixed database table creation in plugin mode

  • Loading branch information...
1 parent d73c0a1 commit ba0754d686013fde5ec2122d8695bcc448f0d650 Alex Lebedev committed Apr 1, 2009
Showing with 10 additions and 2 deletions.
  1. +5 −1 subscription_management/tasks/schema.rb
  2. +5 −1 tracker/tasks/schema.rb
@@ -38,10 +38,14 @@
connected = false
begin
begin
+ Rake::Task[:environment].invoke
connected = true if ActiveRecord::Base.connection
rescue ActiveRecord::ConnectionNotEstablished
+ # ignore
+ rescue RuntimeError
+ puts "no database configuration found"
end
- rescue NameError # ActiveRecord not loaded
+ rescue NameError # ActiveRecord not loaded, use test mode
end
require File.dirname(__FILE__) + "/../test/connection" unless connected
end
View
@@ -54,10 +54,14 @@
connected = false
begin
begin
+ Rake::Task[:environment].invoke
connected = true if ActiveRecord::Base.connection
rescue ActiveRecord::ConnectionNotEstablished
+ # ignore
+ rescue RuntimeError
+ puts "no database configuration found"
end
- rescue NameError # ActiveRecord not loaded
+ rescue NameError # ActiveRecord not loaded, use test mode
end
require File.dirname(__FILE__) + "/../test/connection" unless connected
end

0 comments on commit ba0754d

Please sign in to comment.