このコミットが含まれているのは:
@@ -36,8 +36,8 @@ class PostsController < ApplicationController
|
|||||||
offset = (page - 1) * limit
|
offset = (page - 1) * limit
|
||||||
|
|
||||||
pt_max_sql =
|
pt_max_sql =
|
||||||
PostTag
|
PostVersion
|
||||||
.select('post_id, MAX(updated_at) AS max_updated_at')
|
.select('post_id, MAX(created_at) AS max_updated_at')
|
||||||
.group('post_id')
|
.group('post_id')
|
||||||
.to_sql
|
.to_sql
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ class Post < ApplicationRecord
|
|||||||
|
|
||||||
has_many :post_tags, dependent: :destroy, inverse_of: :post
|
has_many :post_tags, dependent: :destroy, inverse_of: :post
|
||||||
has_many :tags, through: :post_tags
|
has_many :tags, through: :post_tags
|
||||||
|
has_many :active_tags, -> { where(tags: { discarded_at: nil }) },
|
||||||
|
through: :post_tags,
|
||||||
|
source: :tag
|
||||||
|
|
||||||
has_many :user_post_views, dependent: :delete_all
|
has_many :user_post_views, dependent: :delete_all
|
||||||
has_many :post_similarities, dependent: :delete_all
|
has_many :post_similarities, dependent: :delete_all
|
||||||
|
|||||||
新しいイシューから参照
ユーザーをブロックする