Order relationships by their creation date

Closes #115
This commit is contained in:
Karina Kwiatek 2021-08-11 17:09:04 +02:00
parent 11e8555dae
commit 6b32bddc76
1 changed files with 2 additions and 0 deletions

View File

@ -4,6 +4,8 @@ class Relationship < ApplicationRecord
validates :source_id, presence: true
validates :target_id, presence: true
default_scope { order(created_at: :asc) }
after_create do
Notification.notify target, self