You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$this->assertQuery('select "foo"."id" as "__f__foo.id", "foo"."title" as "__f__foo.title", "foo"."created_at" as "__f__foo.created_at", "foo"."updated_at" as "__f__foo.updated_at", "bars".* from "bars" left join "foos" as "foo" on "foo"."id" = "bars"."foo_id" where "bars"."id" = ? limit 1');
78
+
$this->assertQuery('select "foo"."id" as "__f__foo---id", "foo"."title" as "__f__foo---title", "foo"."created_at" as "__f__foo---created_at", "foo"."updated_at" as "__f__foo---updated_at", "bars".* from "bars" left join "foos" as "foo" on "foo"."id" = "bars"."foo_id" where "bars"."id" = ? limit 1');
79
79
80
80
$this->assertQueryCount(1);
81
81
}
@@ -87,7 +87,7 @@ public function it_replaces_subqueries_with_left_join_using_includes()
87
87
$this->assertEquals('First Foo First Baz Bar', $bar->title);
$this->assertQuery('select "foo"."id" as "__f__foo.id", "foo"."title" as "__f__foo.title", "foo"."created_at" as "__f__foo.created_at", "foo"."updated_at" as "__f__foo.updated_at", "bars".* from "bars" left join "foos" as "foo" on "foo"."id" = "bars"."foo_id" where "bars"."id" = ? limit 1');
90
+
$this->assertQuery('select "foo"."id" as "__f__foo---id", "foo"."title" as "__f__foo---title", "foo"."created_at" as "__f__foo---created_at", "foo"."updated_at" as "__f__foo---updated_at", "bars".* from "bars" left join "foos" as "foo" on "foo"."id" = "bars"."foo_id" where "bars"."id" = ? limit 1');
91
91
92
92
$this->assertQueryCount(1);
93
93
}
@@ -99,7 +99,7 @@ public function it_joins_table_by_relation_name_as_alias()
99
99
$this->assertEquals('First Foo First Baz Bar', $bar->title);
$this->assertQuery('select "foo"."id" as "__f__foo.id", "foo"."title" as "__f__foo.title", "foo"."created_at" as "__f__foo.created_at", "foo"."updated_at" as "__f__foo.updated_at", "bars".* from "bars" left join "foos" as "foo" on "foo"."id" = "bars"."foo_id" where "foo"."id" = ? limit 1');
102
+
$this->assertQuery('select "foo"."id" as "__f__foo---id", "foo"."title" as "__f__foo---title", "foo"."created_at" as "__f__foo---created_at", "foo"."updated_at" as "__f__foo---updated_at", "bars".* from "bars" left join "foos" as "foo" on "foo"."id" = "bars"."foo_id" where "foo"."id" = ? limit 1');
103
103
104
104
$this->assertQueryCount(1);
105
105
}
@@ -112,7 +112,7 @@ public function it_support_multiple_flat_joins()
$this->assertQuery('select "foo"."id" as "__f__foo.id", "foo"."title" as "__f__foo.title", "foo"."created_at" as "__f__foo.created_at", "foo"."updated_at" as "__f__foo.updated_at", "baz"."id" as "__f__baz.id", "baz"."title" as "__f__baz.title", "baz"."created_at" as "__f__baz.created_at", "baz"."updated_at" as "__f__baz.updated_at", "bars".* from "bars" left join "foos" as "foo" on "foo"."id" = "bars"."foo_id" left join "bazs" as "baz" on "baz"."id" = "bars"."baz_id" where "foo"."id" = ? and "baz"."id" = ? limit 1');
115
+
$this->assertQuery('select "foo"."id" as "__f__foo---id", "foo"."title" as "__f__foo---title", "foo"."created_at" as "__f__foo---created_at", "foo"."updated_at" as "__f__foo---updated_at", "baz"."id" as "__f__baz---id", "baz"."title" as "__f__baz---title", "baz"."created_at" as "__f__baz---created_at", "baz"."updated_at" as "__f__baz---updated_at", "bars".* from "bars" left join "foos" as "foo" on "foo"."id" = "bars"."foo_id" left join "bazs" as "baz" on "baz"."id" = "bars"."baz_id" where "foo"."id" = ? and "baz"."id" = ? limit 1');
116
116
117
117
$this->assertQueryCount(1);
118
118
}
@@ -125,7 +125,7 @@ public function it_can_combine_with_and_joins()
$this->assertQuery('select "baz"."id" as "__f__baz.id", "baz"."title" as "__f__baz.title", "baz"."created_at" as "__f__baz.created_at", "baz"."updated_at" as "__f__baz.updated_at", "bars".* from "bars" left join "bazs" as "baz" on "baz"."id" = "bars"."baz_id" where "baz"."id" = ? limit 1');
128
+
$this->assertQuery('select "baz"."id" as "__f__baz---id", "baz"."title" as "__f__baz---title", "baz"."created_at" as "__f__baz---created_at", "baz"."updated_at" as "__f__baz---updated_at", "bars".* from "bars" left join "bazs" as "baz" on "baz"."id" = "bars"."baz_id" where "baz"."id" = ? limit 1');
129
129
$this->assertQuery('select * from "foos" where "foos"."id" in (?)');
130
130
131
131
$this->assertQueryCount(2);
@@ -139,7 +139,7 @@ public function it_supports_nested_relations()
139
139
$this->assertEquals('First Foo First Baz Bar', $bom->bar->title);
$this->assertQuery('select "bar"."id" as "__f__bar.id", "bar"."title" as "__f__bar.title", "bar"."foo_id" as "__f__bar.foo_id", "bar"."created_at" as "__f__bar.created_at", "bar"."updated_at" as "__f__bar.updated_at", "bar"."baz_id" as "__f__bar.baz_id", "foo"."id" as "__f__bar.__f__foo.id", "foo"."title" as "__f__bar.__f__foo.title", "foo"."created_at" as "__f__bar.__f__foo.created_at", "foo"."updated_at" as "__f__bar.__f__foo.updated_at", "boms".* from "boms" left join "bars" as "bar" on "bar"."id" = "boms"."bar_id" left join "foos" as "foo" on "foo"."id" = "bar"."foo_id" where "foo"."id" = ? limit 1');
142
+
$this->assertQuery('select "bar"."id" as "__f__bar---id", "bar"."title" as "__f__bar---title", "bar"."foo_id" as "__f__bar---foo_id", "bar"."created_at" as "__f__bar---created_at", "bar"."updated_at" as "__f__bar---updated_at", "bar"."baz_id" as "__f__bar---baz_id", "foo"."id" as "__f__bar---__f__foo---id", "foo"."title" as "__f__bar---__f__foo---title", "foo"."created_at" as "__f__bar---__f__foo---created_at", "foo"."updated_at" as "__f__bar---__f__foo---updated_at", "boms".* from "boms" left join "bars" as "bar" on "bar"."id" = "boms"."bar_id" left join "foos" as "foo" on "foo"."id" = "bar"."foo_id" where "foo"."id" = ? limit 1');
0 commit comments