Skip to content

Commit

Permalink
Remove obsolete line.
Browse files Browse the repository at this point in the history
Related to #67.
  • Loading branch information
franzliedke committed May 8, 2015
1 parent 535276c commit df8a035
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/Core/Models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public static function boot()
parent::boot();

static::creating(function ($post) {
$post->type = $post::$type;
$post->number = ++$post->discussion->number_index;
$post->discussion->save();
});
Expand Down

6 comments on commit df8a035

@tobyzerner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eee no I think this is an important line :3 it's needed to set the type column to the appropriate value, as defined in subclasses of Post (CommentPost, DiscussionRenamedPost)

@franzliedke
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? Then why do all posts (in the posts seeder) set the type column manually? Also, the static $type property does not seem to exists, see #67.

@franzliedke
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, it only exists for subtypes, I think. So, I think we should only overwrite $post->type if it doesn't already exist (to fix the seeders) or update the seeders...

@tobyzerner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the seeder is out of date. It's a static property I added in f2056c4 to make things a bit cleaner. Forgot to add it to the base class. Post should be an abstract class, and the seeder should use CommentPost and DiscussionRenamedPost.

@franzliedke
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll fix that.

@tobyzerner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks

Please sign in to comment.