Method: Logisticed::Logistic.as_user
- Defined in:
- lib/logisticed/logistic.rb
.as_user(user) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/logisticed/logistic.rb', line 7 def self.as_user(user) last_logisticed_user = ::Logisticed.store[:logisticed_user] ::Logisticed.store[:logisticed_user] = user yield ensure ::Logisticed.store[:logisticed_user] = last_logisticed_user end |