Class: News::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/pluto/news.rb

Instance Method Summary collapse

Constructor Details

#initializeConnection

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