mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-30 10:36:35 +02:00
a96734f5be
This reverts commit 0b6f5581f0
.
It causes too many conflicts with pull requests.
37 lines
792 B
JavaScript
37 lines
792 B
JavaScript
const BaseModel = require('lib/BaseModel.js');
|
|
const BaseItem = require('lib/models/BaseItem.js');
|
|
|
|
class MasterKey extends BaseItem {
|
|
static tableName() {
|
|
return 'master_keys';
|
|
}
|
|
|
|
static modelType() {
|
|
return BaseModel.TYPE_MASTER_KEY;
|
|
}
|
|
|
|
static encryptionSupported() {
|
|
return false;
|
|
}
|
|
|
|
static latest() {
|
|
return this.modelSelectOne('SELECT * FROM master_keys WHERE created_time >= (SELECT max(created_time) FROM master_keys)');
|
|
}
|
|
|
|
static allWithoutEncryptionMethod(masterKeys, method) {
|
|
return masterKeys.filter(m => m.encryption_method !== method);
|
|
}
|
|
|
|
static async save(o, options = null) {
|
|
return super.save(o, options).then(item => {
|
|
this.dispatch({
|
|
type: 'MASTERKEY_UPDATE_ONE',
|
|
item: item,
|
|
});
|
|
return item;
|
|
});
|
|
}
|
|
}
|
|
|
|
module.exports = MasterKey;
|