Module: Mongoid::OptimisticLocking::ThreadedWithUnlocked::ClassMethods
- Defined in:
- lib/mongoid/optimistic_locking/threaded_with_unlocked.rb
Instance Method Summary collapse
- #clear_options! ⇒ Object
- #optimistic_locking? ⇒ Boolean
- #unlocked ⇒ Object
- #unlocked=(value) ⇒ Object
Instance Method Details
#clear_options! ⇒ Object
21 22 23 24 |
# File 'lib/mongoid/optimistic_locking/threaded_with_unlocked.rb', line 21 def self.unlocked = false super end |
#optimistic_locking? ⇒ Boolean
9 10 11 |
# File 'lib/mongoid/optimistic_locking/threaded_with_unlocked.rb', line 9 def optimistic_locking? !unlocked end |
#unlocked ⇒ Object
13 14 15 |
# File 'lib/mongoid/optimistic_locking/threaded_with_unlocked.rb', line 13 def unlocked !!Thread.current["[mongoid]:unlocked"] end |
#unlocked=(value) ⇒ Object
17 18 19 |
# File 'lib/mongoid/optimistic_locking/threaded_with_unlocked.rb', line 17 def unlocked=(value) Thread.current["[mongoid]:unlocked"] = value end |