educoder/app/models/attachment_history.rb

24 lines
341 B

6 years ago
class AttachmentHistory < ApplicationRecord
include Publishable
include Publicable
belongs_to :attachment, foreign_key: 'attachment_id'
def title
filename
end
def downloads_count
downloads
end
def quotes_count
quotes.nil? ? 0 : quotes
end
def public?
is_public == 1
end
end