From 861014bbe15058c16fe20b114765308a32699eaf Mon Sep 17 00:00:00 2001
From: George Gelashvili and Tira Odhner <pair+ggelashvili+aodhner@pivotal.io>
Date: Tue, 7 Mar 2017 15:13:23 -0500
Subject: [PATCH 4/6] remove some dead code from sqleditor

---
 .../sqleditor/templates/sqleditor/js/sqleditor.js  | 68 ----------------------
 1 file changed, 68 deletions(-)

diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
index 13af2846..911465b5 100644
--- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
@@ -51,74 +51,6 @@ define(
 
     var is_query_running = false;
 
-    // Defining the backbone model for the sql grid
-    var sqlEditorViewModel = Backbone.Model.extend({
-
-      /* Keep track of values for the original primary keys for later reference,
-       * to allow to change the value of primary keys in the model, which will be
-       * required to identify the value of any row in the datagrid for the relation.
-       */
-      parse: function(data) {
-        var self = this;
-        self.grid_keys = {};
-        self.changed_data = false;
-
-        if (data && 'primary_keys' in self && self.primary_keys && _.size(self.primary_keys) > 0) {
-          _.each(self.primary_keys, function (value, key) {
-            // Assumption - the data, which are coming will always have data for primary_keys
-            self.grid_keys[key] = data[key];
-          });
-        }
-
-        return data;
-      },
-      /* We also need primary key along with the original data,
-       * which is required to identify this row in the database for modification.
-       */
-      toJSON: function(overridden, keys_only) {
-        var res = Backbone.Model.prototype.toJSON.apply(this, arguments);
-        if (!overridden) {
-          return res;
-        }
-
-        if (keys_only)
-          return this.grid_keys;
-
-        return {
-          'keys': this.grid_keys,
-          'data': res
-        };
-      },
-
-      // This function updates the primary key if changed.
-      update_keys: function() {
-        var self = this;
-
-        /* If 'grid_keys' present in the changed object
-         * then it is an update else insert.
-         */
-        if ('grid_keys' in self) {
-          /* Iterate through primary keys and check if the key
-           * is updated or not. If it is updated we need to update
-           * the grid_keys of the model as well.
-           */
-          _.each(self.primary_keys, function (value, key) {
-            if (self.grid_keys[key] != self.attributes[key])
-                self.grid_keys[key] = self.attributes[key]
-          });
-        }
-        else {
-          self.grid_keys = {};
-          /* Iterate through primary keys and insert
-           * the values in models grid_keys.
-           */
-          _.each(self.primary_keys, function (value, key) {
-            self.grid_keys[key] = self.attributes[key]
-          });
-        }
-      }
-    });
-
     // Defining Backbone view for the sql grid.
     var SQLEditorView = Backbone.View.extend({
       initialize: function(opts) {
-- 
2.12.0

