-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ブログのWIP機能を実装 #4095
ブログのWIP機能を実装 #4095
Conversation
679dc2c
to
0c6e66c
Compare
@machida |
@kaisumi はい!僕の方で対応しますー |
@kaisumi すいません、articlesのseedデータ(fixturesにあるやつ)に投稿日が入ってないので、投稿日を入れるようにしておいてくださいー。あと、WIP状態のデータもそこに追加しておいていただきたいです🙏 |
@kaisumi デザイン入れましたー mainブランチの最新を取り込んだので、このブランチにpushする際は、
をお願いします🙏 |
@machida デザインとコメントありがとうございました! |
cb5a1a8
to
dc77a6c
Compare
@maeda-seina |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# frozen_string_literal: true | ||
|
||
class CopyTimestampToPublishedAtForBlog < ActiveRecord::Migration[6.1] | ||
def up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
既存のデータ(published_atカラムの中身がnilのデータ)のままではエラーが出てしまう箇所があるんじゃないかな?と思っていたのですが、このような形でdata migrationを書けば良いのですね!!
個人的にとても参考になりました!!
@maeda-seina お疲れ様です!レビューありがとうございました 😄 @komagata お疲れ様です!お手すきの時にレビューをお願いいたします 🙇 |
if admin_or_mentor_login? | ||
Article.all.order(created_at: :desc) | ||
else | ||
Article.all.where(wip: false).order(created_at: :desc) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここをメソッド化して直感的な名前をつけたら読みやすくなるかもと思いまし〜
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@komagata コメントありがとうございます 😄 変更してみました。
ご確認をよろしくお願いします 🙇
@@ -8,6 +8,8 @@ html.is-application lang='ja' | |||
= javascript_include_tag 'application' | |||
= javascript_pack_tag 'application' | |||
= csrf_meta_tags | |||
- if defined?(@article) && @article.wip? | |||
meta name="robots" content="none" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
bf7dae2
to
f6852b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
確認しました、OKですー🙆♂️
Issue: #3730
published_at = created_at
とするデータマイグレーションを追加