1
0
Fork 0
dokkan-data-rails/app/models/evidence.rb

16 lines
551 B
Ruby
Raw Normal View History

2015-10-14 11:24:15 -04:00
class Evidence < ActiveRecord::Base
has_attached_file :screenshot, styles: {
thumb: 'x100',
small: 'x200',
medium: 'x400',
big: 'x600'
}
belongs_to :card
scope :unused, -> { where(card_id: nil) }
scope :for, -> (id) { where(card_id: id) }
validates_attachment_content_type :screenshot, content_type: /\Aimage\/.*\Z/
end