Sha256: addec651d4dc7ef9ee0d58dd411316d2976fa6b6e98dfb3667b6d73be6056dd6
Contents?: true
Size: 422 Bytes
Versions: 10
Compression:
Stored size: 422 Bytes
Contents
module ActiveRecord module SecureMethods protected def check_creator(user) check(user, :creator_id) end def check_user(user) check(user, :user_id) end def check_sharer(user) check(user, :shared_by_id) end def check(user, field) if user && user != :false self.send(field) == user.id || user.admin? else false end end end end
Version data entries
10 entries across 10 versions & 1 rubygems