Commit f4831b21 by liyijie

Add klass underscore gsub

parent f52f7261
File added
...@@ -10,7 +10,7 @@ module RailsApiAuthentication ...@@ -10,7 +10,7 @@ module RailsApiAuthentication
klasses = self.class.action_classes klasses = self.class.action_classes
klasses.each do |klass| klasses.each do |klass|
@current_auth = klass.auth!(request) rescue next @current_auth = klass.auth!(request) rescue next
sym = klass.name.underscore.to_sym sym = klass.name.underscore.gsub('/', '_').to_sym
instance_variable_set("@current_#{sym}", @current_auth) instance_variable_set("@current_#{sym}", @current_auth)
break break
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment