Ordering logs by date
This commit is contained in:
parent
4dcbd365ff
commit
ca7065dd5c
1 changed files with 4 additions and 0 deletions
|
|
@ -9,6 +9,10 @@ class Log < ActiveRecord::Base
|
|||
validates :level, presence: true
|
||||
validates :level, inclusion: { in: ['info', 'error'] }
|
||||
|
||||
default_scope {
|
||||
order('created_at ASC')
|
||||
}
|
||||
|
||||
def self.log(message, section='frontend', level='info')
|
||||
log = Log.new
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue