Permalink
Browse files

update to work properly if models are loaded inside of ERB, eg. in fi…

…xtures
  • Loading branch information...
1 parent ea6a859 commit 4311da14e765ddf8c0ef78cb389c9004c9b11e53 @remi remi committed Oct 10, 2008
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/use_db.rb
View
@@ -55,7 +55,7 @@ def get_use_db_conn_spec(options)
return options
else
str = "#{prefix}#{rails_env}#{suffix}"
- connections = YAML.load(ERB.new(IO.read("#{RAILS_ROOT}/config/database.yml")).result)
+ connections = YAML.load(ERB.new(IO.read("#{RAILS_ROOT}/config/database.yml"), nil, nil, '_use_db_erbout').result)
raise "Cannot find database specification. Configuration '#{str}' expected in config/database.yml" if (connections[str].nil?)
return connections[str]
end
@@ -64,4 +64,4 @@ def get_use_db_conn_spec(options)
class UseDbPluginClass
extend UseDbPlugin
-end
+end

0 comments on commit 4311da1

Please sign in to comment.