Class: AwsTickwork::DbDataStore

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/aws_tickwork/db_data_store.rb

Class Method Summary collapse

Class Method Details

.read(key) ⇒ Object


15
16
17
# File 'app/models/aws_tickwork/db_data_store.rb', line 15

def read(key)
  DbDataStore.where(key: key).take&.value
end

.write(key, value) ⇒ Object


18
19
20
# File 'app/models/aws_tickwork/db_data_store.rb', line 18

def write(key, value)
  DbDataStore.find_or_initialize_by(key: key).update_attributes!(value: value)
end