0
當rails-api與Authority gem一起使用時,我在控制器中獲得undefined method 'authorize_actions_for'
。任何想法,我需要包括?這裏是我的代碼:Authority gem給出'undefined method'
的Gemfile:
...
gem 'authority', '~> 2.9.0'
gem 'rails-api', '~> 0.1.0'
...
應用程序/授權人/ session_authorizer.rb:
class SessionAuthorizer < ApplicationAuthorizer
def deletable_by?(user)
user.sessions.include?(resource)
end
end
應用程序/控制器/ V1/sessions_controller.rb:
class V1::SessionsController < ApplicationController
authorize_actions_for Session
...
end