Module: Sinatra::DataMapperExtension::Helpers

Defined in:
lib/sinatra/dm.rb

Instance Method Summary collapse

Instance Method Details

#databaseObject

Access to the database settings, should you need them within your app

Examples

if database.name == :default
  # do something...


164
165
166
# File 'lib/sinatra/dm.rb', line 164

def database 
  settings.database
end

#db_loggerObject

Handy alias to the DataMapper logger

Examples

db_logger.info("message")


177
178
179
# File 'lib/sinatra/dm.rb', line 177

def db_logger
  self.class.database_logger
end