aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/info_request.rb1
-rw-r--r--app/models/widget_vote.rb18
2 files changed, 19 insertions, 0 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 7f6b358db..505b9d140 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -50,6 +50,7 @@ class InfoRequest < ActiveRecord::Base
has_many :info_request_events, :order => 'created_at'
has_many :user_info_request_sent_alerts
has_many :track_things, :order => 'created_at desc'
+ has_many :widget_votes
has_many :comments, :order => 'created_at'
has_many :censor_rules, :order => 'created_at desc'
has_many :mail_server_logs, :order => 'mail_server_log_done_id'
diff --git a/app/models/widget_vote.rb b/app/models/widget_vote.rb
new file mode 100644
index 000000000..33697f0fb
--- /dev/null
+++ b/app/models/widget_vote.rb
@@ -0,0 +1,18 @@
+# == 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 }
+end