1234567891011121314151617181920212223242526272829 |
- # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
- class Store
- module Provider
- class DB < ApplicationModel
- self.table_name = 'store_provider_dbs'
- def self.add(data, sha)
- Store::Provider::DB.create(
- data: data,
- sha: sha,
- )
- true
- end
- def self.get(sha)
- file = Store::Provider::DB.find_by(sha: sha)
- return if !file
- file.data
- end
- def self.delete(sha)
- Store::Provider::DB.where(sha: sha).destroy_all
- true
- end
- end
- end
- end
|