Liferay Database Config Reader
Setup
jgem install liferay_database_config_reader
Add the gem dependency in config/warble.rb
config.gems << 'liferay_database_config_reader'
Create a preinitializer.rb in config/ if you do not have one, after add the snippet below
if RUBY_PLATFORM =~ /java/ and ENV['RAILS_ENV'] == 'production'
require 'rubygems'
require 'liferay_database_config_reader'
LiferayDatabaseConfigReader.init!
end
Change you config/database.yml
<% l = LiferayDatabaseConfigReader.attr %>
production:
adapter: <%= l[:adapter] %>
database: <%= l[:database] %>
username: <%= l[:username] %>
password: <%= l[:password] %>
encoding: unicode
pool: 5
timeout: 5000