app/models/type2.rb
# Never actually destroy, just mark as done. Overrides active_record/persistence.rb
Never actually destroy, just mark as done.
Never actually destroy just mark as done .
def destroy_row
    if self.is_passthrough
      super
    else
      results = []
      relation_for_destroy.each do |x|
        if x.dfrom == self.dfrom
          @dto ||= ActiveRecord::Base.connection.execute("SELECT NOW() AS now;").first["now"]
          x.is_passthrough = true
          x.update(dto: @dto)
          self.dto = @dto
        end
      end
    end
  end
def destroy_row if self . is_passthrough super else results = [ ] relation_for_destroy . each do | x | if x . dfrom == self . dfrom @dto ||= ActiveRecord :: Base . connection . execute ( "SELECT NOW() AS now;" ) . first [ "now" ] x . is_passthrough = true x . update ( dto : @dto ) self . dto = @dto end end end end
Never actually destroy, just mark as done.
Never actually destroy just mark as done .