Module: Pubcookie::UserExtensions::ClassMethods

Defined in:
lib/pubcookie/user_extensions.rb

Instance Method Summary collapse

Instance Method Details

#create_admin_from_netid(netid, options = {}) ⇒ Object



21
22
23
24
25
# File 'lib/pubcookie/user_extensions.rb', line 21

def create_admin_from_netid(netid, options={})
  user = self.create_from_netid(netid, options)
  user.group_ids = ["2","3"]
  return user
end

#create_from_netid(netid, email) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/pubcookie/user_extensions.rb', line 27

def create_from_netid(netid, email)
  # create a bogus password - pubcookie won't use it
  password = make_token

  params = {
    :login => netid,
    :first_name=> "",
    :last_name => "",
    :email => email,
    :password => password,
    :password_confirmation => password
  }

  return create(params)

end