File tree Expand file tree Collapse file tree 4 files changed +12
-16
lines changed
Integration/CachedBuilder Expand file tree Collapse file tree 4 files changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public function make(
39
39
$ key .= $ this ->getOffsetClause ();
40
40
$ key .= $ this ->getLimitClause ();
41
41
$ key .= $ keyDifferentiator ;
42
- dump ( " key " , $ key );
42
+
43
43
return $ key ;
44
44
}
45
45
Original file line number Diff line number Diff line change @@ -37,9 +37,10 @@ public static function bootCachable()
37
37
$ instance ->checkCooldownAndFlushAfterPersiting ($ instance );
38
38
});
39
39
40
- static ::restored (function ($ instance ) {
41
- $ instance ->checkCooldownAndFlushAfterPersiting ($ instance );
42
- });
40
+ // TODO: figure out how to add this listener
41
+ // static::restored(function ($instance) {
42
+ // $instance->checkCooldownAndFlushAfterPersiting($instance);
43
+ // });
43
44
44
45
static ::pivotAttached (function ($ instance ) {
45
46
$ instance ->checkCooldownAndFlushAfterPersiting ($ instance );
Original file line number Diff line number Diff line change @@ -42,21 +42,16 @@ public function testWithCountUpdatesAfterRecordIsAdded()
42
42
$ this ->assertEquals ($ author1 ->books_count + 1 , $ author2 ->books_count );
43
43
}
44
44
45
- /** @group test */
46
45
public function testWithCountOnMorphManyRelationshipUpdatesAfterRecordIsAdded ()
47
46
{
48
47
$ book1 = (new Book )
49
48
->withCount ("comments " )
50
49
->first ();
51
- dump ("start " );
52
- factory (Comment::class, 1 )
53
- ->make ()
54
- ->each (function ($ comment ) use ($ book1 ) {
55
- $ comment ->commentable_id = $ book1 ->id ;
56
- $ comment ->commentable_type = $ book1 ->getTable ();
57
- $ comment ->save ();
58
- });
59
- dump ("end " );
50
+ $ comment = factory (Comment::class, 1 )
51
+ ->create ()
52
+ ->first ();
53
+
54
+ $ book1 ->comments ()->save ($ comment );
60
55
61
56
$ book2 = (new Book )
62
57
->withCount ("comments " )
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ public function up()
11
11
$ table ->increments ('id ' );
12
12
$ table ->timestamps ();
13
13
14
- $ table ->unsignedInteger ("commentable_id " );
15
- $ table ->string ("commentable_type " );
14
+ $ table ->unsignedInteger ("commentable_id " )-> nullable () ;
15
+ $ table ->string ("commentable_type " )-> nullable () ;
16
16
$ table ->text ("description " );
17
17
$ table ->string ("subject " );
18
18
});
You can’t perform that action at this time.
0 commit comments