Skip to content

Instantly share code, notes, and snippets.

@nfelger
Created August 5, 2010 14:43
Show Gist options
  • Save nfelger/509832 to your computer and use it in GitHub Desktop.
Save nfelger/509832 to your computer and use it in GitHub Desktop.
require 'sequel'
class Configuration
# ... logic for finding configuration strings for different environments / applications.
def self.datastore
@datastore ||= Sequel.connect(connection_uri)
end
end
class Event < Sequel::Model(Configuration.datastore[:events])
# ...
end
Event.first # => nil
# sudo /etc/init.d/mysql restart
Event.first # => Mysql::Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment