Module: BridgetownActiveRecord

Defined in:
lib/bridgetown-activerecord/version.rb,
lib/bridgetown-activerecord/initializer.rb

Constant Summary collapse

VERSION =
"2.2.0"

Class Method Summary collapse

Class Method Details

.db_configuration(config) ⇒ Object



14
15
16
# File 'lib/bridgetown-activerecord/initializer.rb', line 14

def self.db_configuration(config)
  ActiveSupport::ConfigurationFile.parse(File.join(config.root_dir, "config", "database.yml"))
end

.load_tasks(models_dir: "models") ⇒ Object



9
10
11
12
# File 'lib/bridgetown-activerecord/initializer.rb', line 9

def self.load_tasks(models_dir: "models")
  ENV["BRIDGETOWN_ACTIVERECORD_MODELS_DIR"] ||= models_dir
  load File.expand_path("../tasks/database.rake", __dir__)
end

.log_writerObject



18
19
20
# File 'lib/bridgetown-activerecord/initializer.rb', line 18

def self.log_writer
  Bridgetown::LogWriter.new.tap(&:enable_prefix)
end