aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/widget_vote.rb
blob: dda77007f0066abe77a33756744d0a7a21c7a5ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# -*- encoding : utf-8 -*-
# == Schema Information
#
# Table name: widget_votes
#
#  id              :integer          not null, primary key
#  cookie          :string(255)
#  info_request_id :integer          not null
#  created_at      :datetime         not null
#  updated_at      :datetime         not null
#

class WidgetVote < ActiveRecord::Base
  belongs_to :info_request
  validates :info_request, :presence => true

  attr_accessible :cookie
  validates :cookie, :length => { :is => 20 }
  validates_uniqueness_of :cookie, :scope => :info_request_id
end