Permalink
Browse files

Forwarding column, and surfaceTables for all 1-operand relations

  • Loading branch information...
1 parent c63591c commit cdd092d0fcf0fd7aa80cf44bb176e3bd7d7fdcbd @nathansobo committed Jan 5, 2011
@@ -1,6 +1,7 @@
(function(Monarch) {
_.constructor("Monarch.Model.Relations.Limit", Monarch.Model.Relations.Relation, {
+
initialize: function(operand, n) {
this.operand = operand;
this.n = n;
@@ -24,22 +24,10 @@ _.constructor("Monarch.Model.Relations.Ordering", Monarch.Model.Relations.Relati
return new Monarch.Model.Relations.Ordering(this.operand.evaluateInRepository(repository), this.sortSpecifications);
},
- primaryTable: function() {
- return this.operand.primaryTable();
- },
-
wireRepresentation: function() {
return this.operand.wireRepresentation();
},
- surfaceTables: function() {
- return this.operand.surfaceTables();
- },
-
- column: function(name) {
- return this.operand.column(name);
- },
-
isEqual: function(other) {
if (other.constructor !== this.constructor) return false;
return _.isEqual(this.sortSpecifications, other.sortSpecifications) && this.operand.isEqual(other.operand);
@@ -215,6 +215,14 @@ _.constructor("Monarch.Model.Relations.Relation", {
return this.storedTuples.indexOf(sortKey);
},
+ surfaceTables: function() {
+ return this.operand.surfaceTables();
+ },
+
+ column: function(name) {
+ return this.operand.column(name);
+ },
+
// private
memoizeTuples: function() {
@@ -42,18 +42,6 @@ _.constructor("Monarch.Model.Relations.Selection", Monarch.Model.Relations.Relat
return new Monarch.Model.Relations.Selection(this.operand.evaluateInRepository(repository), this.predicate);
},
- primaryTable: function() {
- return this.operand.primaryTable();
- },
-
- column: function(name) {
- return this.operand.column(name);
- },
-
- surfaceTables: function() {
- return this.operand.surfaceTables();
- },
-
isEqual: function(other) {
if (other.constructor !== Monarch.Model.Relations.Selection) return false;
return this.predicate.isEqual(other.predicate) && this.operand.isEqual(other.operand);
@@ -178,10 +178,6 @@ _.constructor("Monarch.Model.Relations.Table", Monarch.Model.Relations.Relation,
return repository.tables[this.globalName];
},
- primaryTable: function() {
- return this;
- },
-
isEqual: function(other) {
return this === other;
}

0 comments on commit cdd092d

Please sign in to comment.