provide debug method

This commit is contained in:
Alexander Meindl 2020-12-11 13:35:37 +01:00
parent 3a6c22fbd9
commit df94d40b73

View File

@ -93,6 +93,12 @@ module Additionals
false
end
def debug(message)
return if Rails.env.production?
Rails.logger.debug "#{Time.current.strftime('%H:%M:%S')} DEBUG [#{caller_locations(1..1).first.label}]: #{message}"
end
def class_prefix(klass)
klass_name = klass.is_a?(String) ? klass : klass.name
klass_name.underscore.tr '/', '_'