Sha256: 2ffad612faae84c55b06f155fe051a34af54a83efaf06a5716bf15a8d4af83aa
Contents?: true
Size: 803 Bytes
Versions: 6
Compression:
Stored size: 803 Bytes
Contents
module CanCan module ControllerResourceSanitizer protected def sanitize_parameters case params_method when Symbol @controller.send(params_method) when String @controller.instance_eval(params_method) when Proc params_method.call(@controller) end end def params_methods methods = ["#{@params[:action]}_params".to_sym, "#{name}_params".to_sym, :resource_params] methods.unshift(@options[:param_method]) if @options[:param_method].present? methods end def params_method params_methods.each do |method| return method if (method.is_a?(Symbol) && @controller.respond_to?(method, true)) || method.is_a?(String) || method.is_a?(Proc) end nil end end end
Version data entries
6 entries across 6 versions & 1 rubygems