lib/acts_as_versioned.rb
def without_locking(&block)
            current = ActiveRecord::Base.lock_optimistically
            ActiveRecord::Base.lock_optimistically = false if current
            result = block.call
            ActiveRecord::Base.lock_optimistically = true if current
            result
          end
# Turns off optimistic locking for the duration of the block
#
#   Foo.without_locking do
#     @foo.save
#   end
#
Turns off optimistic locking for the duration of the block
Foo.without_locking do
@foo.save
end
Turns off optimistic locking for the duration of the block Foo . without_locking do @foo . save end
def without_locking(&block)
            current = ActiveRecord::Base.lock_optimistically
            ActiveRecord::Base.lock_optimistically = false if current
            result = block.call
            ActiveRecord::Base.lock_optimistically = true if current
            result
          end
def without_locking ( & block ) current = ActiveRecord :: Base . lock_optimistically ActiveRecord :: Base . lock_optimistically = false if current result = block . call ActiveRecord :: Base . lock_optimistically = true if current result end
Turns off optimistic locking for the duration of the block
Foo.without_locking do
@foo.save
end
Turns off optimistic locking for the duration of the block Foo . without_locking do @foo . save end
block