Class: Log

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/log.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.latestObject



17
18
19
# File 'app/models/log.rb', line 17

def self.latest
  Log.first # default_scope sorts in descending order.
end

Instance Method Details

#some_content_present?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/models/log.rb', line 21

def some_content_present?
  errors.add(:content, :blank) if file.blank? && content.blank?
end