# File lib/stickshift-controller/app/models/usage_record.rb, line 14 def initialize(event=nil, user=nil, time=nil, uuid=nil, usage_type=nil) self.uuid = uuid ? uuid : StickShift::Model.gen_uuid self.event = event self.time = time ? time : Time.now.utc self.user = user self.usage_type = usage_type self.sync_time = nil end
Deletes the usage record from the datastore
# File lib/stickshift-controller/app/models/usage_record.rb, line 24 def delete super(user.login) end
# File lib/stickshift-controller/app/models/usage_record.rb, line 33 def delete_by_gear_uuid StickShift::DataStore.instance.delete_usage_record_by_gear_uuid(user.login, gear_uuid, usage_type) end
Saves the usage record to the datastore
# File lib/stickshift-controller/app/models/usage_record.rb, line 29 def save super(user.login) end