Merge pull request #188 from Retrospring/fix/relationship-ordering

Order relationships by their creation date
This commit is contained in:
Karina Kwiatek 2021-08-11 22:07:41 +02:00 committed by GitHub
commit 3438534ca1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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