Added validation for TOS agreement

Tests are currently broken, will fix later
This commit is contained in:
Gnat
2012-12-03 05:22:30 +00:00
parent e39ec4c5f8
commit 12b3bdd432

View File

@@ -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