Skip to content

Commit

Permalink
Fixed Zeitwerk autoloading error with MetalDecorator
Browse files Browse the repository at this point in the history
  • Loading branch information
damianlegawiec committed Sep 6, 2019
1 parent 15d7431 commit d7d08d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/metal_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# For the API
ActionController::Metal.class_eval do
module MetalDecorator
def spree_current_user
@spree_current_user ||= if defined? env
env['warden'].user
Expand All @@ -8,3 +8,5 @@ def spree_current_user
end
end
end

ActionController::Metal.prepend(MetalDecorator)

0 comments on commit d7d08d2

Please sign in to comment.