rewrote order by to not be raw sql

This commit is contained in:
Brenda
2020-08-02 08:43:17 +12:00
parent fc72f0072c
commit a11db6767b

View File

@@ -4,7 +4,7 @@ class Comment < ApplicationRecord
belongs_to :author, class_name: 'Member', inverse_of: :comments
belongs_to :post, counter_cache: true
scope :post_order, -> { reorder("created_at ASC") } # for display on post page
scope :post_order, -> { order(created_at: :asc) } # for display on post page
after_create do
recipient = post.author.id