Sha256: 9df82b614f047fdfddb3e506fd948daf12e08236bf29c323613c21bd08058afc
Contents?: true
Size: 666 Bytes
Versions: 53
Compression:
Stored size: 666 Bytes
Contents
require 'set' module ActiveModel module MassAssignmentSecurity class PermissionSet < Set def +(values) super(values.map(&:to_s)) end def include?(key) super(remove_multiparameter_id(key)) end def deny?(key) raise NotImplementedError, "#deny?(key) suppose to be overwritten" end protected def remove_multiparameter_id(key) key.to_s.gsub(/\(.+/m, '') end end class WhiteList < PermissionSet def deny?(key) !include?(key) end end class BlackList < PermissionSet def deny?(key) include?(key) end end end end
Version data entries
53 entries across 44 versions & 9 rubygems