Class: News::Connection
- Inherits:
-
Object
- Object
- News::Connection
- Defined in:
- lib/pluto/news.rb
Instance Method Summary collapse
-
#initialize ⇒ Connection
constructor
convenience shortcut w/ automigrate.
Constructor Details
#initialize ⇒ Connection
convenience shortcut w/ automigrate
259 260 261 262 263 264 265 266 267 268 |
# File 'lib/pluto/news.rb', line 259 def initialize # convenience shortcut w/ automigrate config = if News.config.database.is_a?(Hash) News.config.database else ## assume a string (e.g. :memory:, or <path> AND sqlite3 adapter) { adapter: 'sqlite3', database: News.config.database } end Pluto.connect( config ) Pluto.auto_migrate! end |