Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. From: /opt/gitlab/gitlab/gdk-ce/gitlab/lib/gitlab/i18n.rb @ line 61 Gitlab::I18n#with_user_locale:
  2.  
  3. 60: def with_user_locale(user, &block)
  4. => 61: with_locale(user&.preferred_language, &block)
  5. 62: end
  6.  
  7. [57] pry(Gitlab::I18n)> user
  8. => nil
  9. [58] pry(Gitlab::I18n)> show-source block
  10.  
  11. From: /opt/gitlab/gitlab/.rvm/gems/ruby-2.5.3/gems/activesupport-5.0.7.1/lib/active_support/callbacks.rb
  12. Number of lines: 3
  13.  
  14. user_callback.call(target, value) {
  15. run.call.value
  16. }
  17. [59] pry(Gitlab::I18n)> down
  18.  
  19. From: /opt/gitlab/gitlab/gdk-ce/gitlab/lib/gitlab/i18n.rb @ line 54 Gitlab::I18n#with_locale:
  20.  
  21. 51: def with_locale(locale_string)
  22. 52: original_locale = locale
  23. 53:
  24. => 54: self.locale = locale_string
  25. 55: yield
  26. 56: ensure
  27. 57: self.locale = original_locale
  28. 58: end
  29.  
  30. [59] pry(Gitlab::I18n)>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement