class Denouncement < ActiveRecord::Base
  attr_accessible :plate, :place, :comment, :complaint_date, :picture

  validates :plate, presence: true
  validates :place, presence: true
  validates :comment, presence: true
  validates :complaint_date, presence: true

  has_one :denouncement_tracking

  has_attached_file :picture, :styles => lambda {|a| { :icon=>"x240", :mailer=>"800x600" }}, 
                            :convert_options => { :icon => "-quality 75" }, 
                            :processor => :MiniMagick
  validates_attachment_content_type :picture,
                                    :content_type => [ 'image/jpeg', 'image/png', 'image/gif', 'image/jpg', 'image/x-png', 'image/pjpeg' ]
end
