Flowdock
method

destroy_row

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: ActiveRecord::Locking::Optimistic
destroy_row() private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/locking/optimistic.rb, line 108
        def destroy_row
          return super unless locking_enabled?

          locking_column = self.class.locking_column

          affected_rows = self.class._delete_record(
            self.class.primary_key => id_in_database,
            locking_column => read_attribute_before_type_cast(locking_column)
          )

          if affected_rows != 1
            raise ActiveRecord::StaleObjectError.new(self, "destroy")
          end

          affected_rows
        end
Register or log in to add new notes.