Displaying 1 result from an estimated 1 matches for "target_subdomain".
2011 Dec 05
2
How to bypass a create record after validation wo error ?
...form ( email /pwd /pwd
confirmation )
I wrote a UserValidator class to check the uniqueness of the email
field
# if no user registered w this email, then no error , can proceed to
create
User.where(:email => self.email).empty? # no error
# if a user is already registered w this email,
target_subdomain = Subdomain.find(self.subdomain_id)
unless target_subdomain.members.where(;email => self;email).empty?
record.errors[:email] << "is already a member" # error
else # user is not a not a member of this subdomain....
existing_user = User.where(:email => self...