Any chance the 2nd and 3rd lines can be combined in an one-liner and hopefully save one valuable?
def self.date_format
record = find_by_key('strftime')
record ? record.value : "%Y-%b-%d'
end
the above function in a Config
model try to fetch a database record by a key, return a default if not found in database.
Even better if can be written in named scope. Thanks