Module: Sinatra::DataMapperExtension::Helpers
- Defined in:
- lib/sinatra/dm.rb
Instance Method Summary collapse
-
#database ⇒ Object
Access to the database settings, should you need them within your app ==== Examples.
-
#db_logger ⇒ Object
Handy alias to the DataMapper logger ==== Examples.
Instance Method Details
#database ⇒ Object
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_logger ⇒ Object
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 |