Module: Lrcat::Catalog

Defined in:
lib/lrcat/catalog.rb,
lib/lrcat/catalog/lens.rb,
lib/lrcat/catalog/image.rb,
lib/lrcat/catalog/camera_model.rb,
lib/lrcat/catalog/library_file.rb,
lib/lrcat/catalog/camera_serial.rb,
lib/lrcat/catalog/exif_metadata.rb,
lib/lrcat/catalog/library_folder.rb,
lib/lrcat/catalog/develop_settings.rb,
lib/lrcat/catalog/additional_metadata.rb,
lib/lrcat/catalog/library_root_folder.rb

Overview

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

Defined Under Namespace

Classes: AdditionalMetadata, CameraModel, CameraSerial, DevelopSettings, ExifMetadata, Image, Lens, LibraryFile, LibraryFolder, LibraryRootFolder

Class Method Summary collapse

Class Method Details

.closeObject

Close the connection.



32
33
34
# File 'lib/lrcat/catalog.rb', line 32

def self.close
  ActiveRecord::Base.remove_connection
end

.open(path) ⇒ Object

Establish the connection to the catalog.

Parameters:

  • path (String)

    the path to the catalog file.



27
28
29
# File 'lib/lrcat/catalog.rb', line 27

def self.open(path)
  ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: path)
end