lib/simple_auth/authentication.rb in di-simple_auth-0.2.4 vs lib/simple_auth/authentication.rb in di-simple_auth-0.2.5
- old
+ new
@@ -103,10 +103,10 @@
end
end
def permission_from_token(invoice)
if current_user
- current_user.permissions(invoice).max(&:index)
+ current_user.permissions(invoice).max_by{|v| v.index }
elsif params[:token][10..-1]
::Permission.find_by_token(token)
end
end
\ No newline at end of file