Method: Protector::Adapters::Sequel::Model#visible?

Defined in:
lib/protector/adapters/sequel/model.rb

#visible?Boolean

Checks if current model can be selected in the context of current subject

Returns:

  • (Boolean)


43
44
45
46
# File 'lib/protector/adapters/sequel/model.rb', line 43

def visible?
  return true unless protector_meta.scoped?
  protector_meta.relation.where(pk_hash).any?
end