Skip to content

tulios/liferay_database_config_reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

<% if RUBY_PLATFORM =~ /java/ and ENV['RAILS_ENV'] == 'production' %>               
production:
  adapter: <%= LiferayDatabaseConfigReader.attr[:adapter] %>
  database: <%= LiferayDatabaseConfigReader.attr[:database] %>
  username: <%= LiferayDatabaseConfigReader.attr[:username] %>
  password: <%= LiferayDatabaseConfigReader.attr[:password] %>
  encoding: unicode
  pool: 5
  timeout: 5000
<% end %>

About

Allow the rails portlet app to read and configure database with liferay portal-ext.properties

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages