mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-24 16:58:35 -04:00
Added validation for TOS agreement
Tests are currently broken, will fix later
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user