Class: WinewooCore::Repositories::Mongo::InterproWinewooUsersMongoRepo

Inherits:
Object
  • Object
show all
Defined in:
lib/winewoo_core/repositories/mongo/interpro_winewoo_users_mongo_repo.rb

Instance Method Summary collapse

Instance Method Details

#create(interpro, winewoo_user_params) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/winewoo_core/repositories/mongo/interpro_winewoo_users_mongo_repo.rb', line 9

def create(interpro, winewoo_user_params)
  wuser = User.create(winewoo_user_params.get)
  wuser.email = generate_email if wuser.email.blank?
  wuser.password = Devise.friendly_token.first(8) if wuser.password.blank?
  wuser.save_for_interpro(interpro) if interpro
  device = create_device(wuser, winewoo_user_params)
  return wuser, device
end

#get(winewoo_user_id) ⇒ Object



4
5
6
# File 'lib/winewoo_core/repositories/mongo/interpro_winewoo_users_mongo_repo.rb', line 4

def get(winewoo_user_id)
  User.find(winewoo_user_id)
end