You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

14 lines
412 B

  1. class Document < ApplicationRecord
  2. belongs_to :user
  3. belongs_to :category
  4. has_and_belongs_to_many :tags
  5. has_attached_file :doc,
  6. {
  7. adapter_options: { hash_digest: Digest::SHA256 },
  8. url: "/system/:class/:attachment/:id_partition/:style/:hash.:extension",
  9. hash_secret: Rails.application.secrets.secret_key_base
  10. }
  11. validates_attachment_content_type :doc, content_type: 'application/pdf'
  12. end