diff options
Diffstat (limited to 'app/models/widget_vote.rb')
-rw-r--r-- | app/models/widget_vote.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/models/widget_vote.rb b/app/models/widget_vote.rb new file mode 100644 index 000000000..021c38b30 --- /dev/null +++ b/app/models/widget_vote.rb @@ -0,0 +1,19 @@ +# == 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 |