Skip to content

Commit

Permalink
update to work properly if models are loaded inside of ERB, eg. in fi…
Browse files Browse the repository at this point in the history
…xtures
  • Loading branch information
remi committed Oct 10, 2008
1 parent ea6a859 commit 4311da1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/use_db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.