Advertisement
Guest User

Untitled

a guest
Jun 27th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. ##### Generate a dial number for all rooms that don't have one yet
  2.  
  3. ```ruby
  4. BigbluebuttonRoom.where(dial_number: nil).each{ |room| room.update_attributes(dial_number: Mconf::DialNumber.generate) }
  5. ```
  6.  
  7. ##### A user had its email changed in the federation
  8.  
  9. ```ruby
  10. email_old = "old@mail.com"
  11. email_new = "new@mail.com"
  12.  
  13. user = User.where(email: email_old).first
  14. user.shib_token.update_attributes(identifier: email_new)
  15. user.update_attributes(email: email_new)
  16. user.skip_confirmation_notification!
  17. user.confirm!
  18.  
  19. # to confirm that everything's ok
  20. user.email
  21. user.shib_token.identifier
  22. ShibToken.where(identifier: email_old) # should be empty
  23. User.where(email: email_old) # should be empty
  24. ```
  25.  
  26. ##### Number of users that signed in in the last 30 days
  27.  
  28. ```ruby
  29. User.select { |u| u.last_sign_in_at && (u.last_sign_in_at + 30.days) >= Date.today }.count
  30. ```
  31.  
  32. ##### Invalid join requests = invitations without a role
  33.  
  34. ```ruby
  35. JoinRequest.where(role: nil, request_type: "invite")
  36. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement