From 0 to 5 in severity:
debug
- for debugging purposes, onlyinfo
- an informative messagewarn
- this may or may not be an issueerror
- this is an issue, but the application can continue running
Bash reads different configuration files depending on how the shell session is started.
Aggregate tables, in general, are simply database tables that contain aggregated values.
An aggregate fact table is simply one that combines multiple rows of data, loses some detail and aggregates numerical values.
Instead of defining an included
method to handle extending a class, we can
extend ActiveSupport::Concern
.
It is actually a pretty simple but powerful concept. It has to do with code reuse as in the example below. Basically, the idea is to extract common and/or context specific chunks of code in order to clean up the models and avoid them getting too fat and messy.
module TimeHelper | |
def now | |
Time.new.to_i | |
end | |
def time_ago(seconds, now = Time.now.to_i) | |
minutes = (now - seconds) / 60 | |
quantity = [minutes / 525600, minutes / 43200, minutes / 1440, minutes / 60, minutes] | |
%w(year month day hour minute).each_with_index do |type, i| |