Module: DoorkeeperMongodb::Compatible

Extended by:
ActiveSupport::Concern
Included in:
Doorkeeper::AccessGrant, Doorkeeper::AccessToken, Doorkeeper::Application
Defined in:
lib/doorkeeper-mongodb/compatible.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#lock!(_ = true) ⇒ Object



31
32
33
34
# File 'lib/doorkeeper-mongodb/compatible.rb', line 31

def lock!(_ = true)
  reload if persisted?
  self
end

#transaction(options = {}, &block) ⇒ Object



23
24
25
# File 'lib/doorkeeper-mongodb/compatible.rb', line 23

def transaction(options = {}, &block)
  self.class.transaction(options, &block)
end

#update_column(column, value) ⇒ Object



27
28
29
# File 'lib/doorkeeper-mongodb/compatible.rb', line 27

def update_column(column, value)
  update_attribute(column, value)
end

#with_lock(&_block) ⇒ Object



36
37
38
39
# File 'lib/doorkeeper-mongodb/compatible.rb', line 36

def with_lock(&_block)
  lock!
  yield
end