Skip to content

Instantly share code, notes, and snippets.

@ab5tract
Created July 23, 2008 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ab5tract/1922 to your computer and use it in GitHub Desktop.
Save ab5tract/1922 to your computer and use it in GitHub Desktop.
# I was hoping something like this might work ....
# The hope was that config.database could as easily be a string as a hash....
+++configurations/development.rb
module Blog
module Configurations
class Development < Default
database 'jdbc:postgresql://localhost/jblog?user=waves'
....
+++layers/orm/sequel.rb
def app.database
if defined?(JRUBY_VERSION)
@sequel ||= ::Sequel.connect config.database
else
@sequel ||= ::Sequel.open( config.database )
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment