Module: PunditExtraExtra::ResourceAutoload::ClassMethods

Defined in:
lib/pundit_extraextra/resource_autoload.rb

Instance Method Summary collapse

Instance Method Details

#authorize_resource(resource_name_or_options = {}, options = {}) ⇒ Object



18
19
20
# File 'lib/pundit_extraextra/resource_autoload.rb', line 18

def authorize_resource(resource_name_or_options = {}, options = {})
  store_resource_options(:authorize, resource_name_or_options, options)
end

#load_and_authorize_resource(resource_name_or_options = {}, options = {}) ⇒ Object



26
27
28
# File 'lib/pundit_extraextra/resource_autoload.rb', line 26

def load_and_authorize_resource(resource_name_or_options = {}, options = {})
  store_resource_options(:load_and_authorize, resource_name_or_options, options)
end

#load_resource(resource_name_or_options = {}, options = {}) ⇒ Object



14
15
16
# File 'lib/pundit_extraextra/resource_autoload.rb', line 14

def load_resource(resource_name_or_options = {}, options = {})
  store_resource_options(:load, resource_name_or_options, options)
end

#skip_authorization(options = {}) ⇒ Object



22
23
24
# File 'lib/pundit_extraextra/resource_autoload.rb', line 22

def skip_authorization(options = {})
  before_action :skip_authorization_and_scope, options.dup
end