module Lrcat::Catalog

The Catalog module takes care of the ActiveRecord connection and contains the ActiveRecord models.

Public Class Methods

close() click to toggle source

Close the connection.

# File lib/lrcat/catalog.rb, line 32
def self.close
  ActiveRecord::Base.remove_connection
end
open(path) click to toggle source

Establish the connection to the catalog.

@param path [String] the path to the catalog file.

# File lib/lrcat/catalog.rb, line 27
def self.open(path)
  ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: path)
end