Class: MongoidAbility::ResolveDefaultLocks

Inherits:
ResolveLocks
  • Object
show all
Defined in:
lib/mongoid_ability/resolve_default_locks.rb

Instance Attribute Summary

Attributes inherited from ResolveLocks

#action, #options, #owner, #subject, #subject_class, #subject_id, #subject_type

Instance Method Summary collapse

Methods inherited from ResolveLocks

call, #initialize

Constructor Details

This class inherits a constructor from MongoidAbility::ResolveLocks

Instance Method Details

#callObject



4
5
6
7
# File 'lib/mongoid_ability/resolve_default_locks.rb', line 4

def call
  return false if default_locks.any?{ |l| l.closed?(options) }
  return true if default_locks.any?{ |l| l.open?(options) }
end