aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/spam_address.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/spam_address.rb')
-rw-r--r--app/models/spam_address.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/models/spam_address.rb b/app/models/spam_address.rb
new file mode 100644
index 000000000..2c84beaa0
--- /dev/null
+++ b/app/models/spam_address.rb
@@ -0,0 +1,21 @@
+# == Schema Information
+#
+# Table name: spam_addresses
+#
+# id :integer not null, primary key
+# email :string(255) not null
+# created_at :datetime not null
+# updated_at :datetime not null
+#
+
+class SpamAddress < ActiveRecord::Base
+ attr_accessible :email
+
+ validates_presence_of :email, :message => 'Please enter the email address to mark as spam'
+ validates_uniqueness_of :email, :message => 'This address is already marked as spam'
+
+ def self.spam?(email_address)
+ exists?(:email => email_address)
+ end
+
+end