class Ppa::ImpressaoDaReceita < ApplicationRecord
	has_paper_trail
	has_attached_file :imagem, styles: { large: "800x800>", medium: "300x300>", thumb: "100x100>" }

	belongs_to :ppa

	validates_presence_of :ppa_id, :ordem
	validates :ppa_id, immutable: true

	validates_attachment_content_type :imagem, content_type: /\Aimage\/.*\Z/
	validates_attachment_size :imagem, in: 0..2.megabytes

	def imagem_path
		self.imagem.path
	end
end