6277: add default_empty_manifest before_validation filter and update the tests accord...
[arvados.git] / services / api / app / models / api_client_authorization.rb
index 2488d8322fbc97dfb9d3ee3446bf902bf581a9ce..b9442d64e78bf888741e9e47d532f53d73059e22 100644 (file)
@@ -30,7 +30,7 @@ class ApiClientAuthorization < ArvadosModel
     self.user.andand.uuid
   end
   def owner_uuid_was
-    self.user_id_changed? ? User.find(self.user_id_was).andand.uuid : self.user.andand.uuid
+    self.user_id_changed? ? User.where(id: self.user_id_was).first.andand.uuid : self.user.andand.uuid
   end
   def owner_uuid_changed?
     self.user_id_changed?
@@ -71,7 +71,7 @@ class ApiClientAuthorization < ArvadosModel
   end
 
   def scopes_allow_request?(request)
-    scopes_allow? [request.method, request.path].join(' ')
+    scopes_allow? [request.request_method, request.path].join(' ')
   end
 
   def logged_attributes
@@ -80,6 +80,10 @@ class ApiClientAuthorization < ArvadosModel
     attrs
   end
 
+  def self.default_orders
+    ["#{table_name}.id desc"]
+  end
+
   protected
 
   def permission_to_create