init push - laying out the project

This commit is contained in:
Mike Sutton
2022-11-12 02:27:46 +01:00
commit 14e163a1a5
183 changed files with 20069 additions and 0 deletions

View File

@ -0,0 +1,20 @@
module Loggable
extend ActiveSupport::Concern
def set_log(s)
log_this(s, false)
end
def log_this(s, append = true)
x = append ? log || [] : []
x << "[#{Time.now}]: #{s}"
update(log: x)
end
def show_log
x = log || []
return 'Nothing logged' if x.length.zero?
x.join(',')
end
end