Class: VirtualUser

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/virtual_user.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#password_confirmationObject

Returns the value of attribute password_confirmation.



11
12
13
# File 'app/models/virtual_user.rb', line 11

def password_confirmation
  @password_confirmation
end

Class Method Details

.drop_domain_from_email_each(users) ⇒ Object



38
39
40
41
42
# File 'app/models/virtual_user.rb', line 38

def self.drop_domain_from_email_each(users)
  users.each do |user|
    user.email.sub!(/@.*/, '')
  end
end

Instance Method Details

#change_data(params) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'app/models/virtual_user.rb', line 28

def change_data(params)
  success = if not params[:password].blank?
    update_with_password(params)
  else
    params.delete(:password)
    update_without_password(params)
  end
  return success
end

#repair_email_formatObject



44
45
46
47
48
49
# File 'app/models/virtual_user.rb', line 44

def repair_email_format
  if self.email !~ /@.*$/
    self.email += "@#{self.virtual_domain.name}"
  end
  true
end