Module: Diffcrypt::Rails::ApplicationHelper

Defined in:
lib/diffcrypt/rails/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#encrypted(path, key_path: 'config/master.key', env_key: 'RAILS_MASTER_KEY') ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/diffcrypt/rails/application_helper.rb', line 8

def encrypted(path, key_path: 'config/master.key', env_key: 'RAILS_MASTER_KEY')
  config_path, key_path = resolve_encrypted_paths(path, key_path)

  Diffcrypt::Rails::EncryptedConfiguration.new(
    config_path: config_path,
    key_path: key_path,
    env_key: env_key,
    raise_if_missing_key: config.require_master_key,
  )
end