Skip to content
Snippets Groups Projects
download.rb 576 B
Newer Older
# == Schema Information
#
# Table name: downloads
#
#  id                :integer          not null, primary key
#  downloadable_id   :integer
#  downloadable_type :string
#  user_id           :integer
#  created_at        :datetime         not null
#  updated_at        :datetime         not null
#

Mateus Rambo Strey's avatar
Mateus Rambo Strey committed
class Download < ApplicationRecord
  # *current_user* download *downloadable*
  include Trackable

  belongs_to :downloadable, polymorphic: true, counter_cache: true

  validates_presence_of :user, :downloadable