From 12b3bdd432ff8d55d37e14ec9e2a4071eee5d56d Mon Sep 17 00:00:00 2001 From: Gnat Date: Mon, 3 Dec 2012 05:22:30 +0000 Subject: [PATCH] Added validation for TOS agreement Tests are currently broken, will fix later --- app/models/user.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 31f46227d..b19dd4d74 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -13,13 +13,17 @@ class User < ActiveRecord::Base # Setup accessible (or protected) attributes for your model attr_accessible :username, :email, :password, :password_confirmation, - :remember_me, :login + :remember_me, :login, :tos_agreement # attr_accessible :title, :body # Virtual attribute for authenticating by either username or email # This is in addition to a real persisted field like 'username' attr_accessor :login + # Requires acceptance of the Terms of Service + validates_acceptance_of :tos_agreement, :allow_nil => false, + :accept => true + # allow login via either username or email address def self.find_first_by_auth_conditions(warden_conditions) conditions = warden_conditions.dup