From 62292797eccc5bcf47abae9f4daaa2c186660644 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 4 Nov 2016 19:12:59 +0100 Subject: Adding hashtag model --- app/models/account.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/models/account.rb') diff --git a/app/models/account.rb b/app/models/account.rb index 0a6ba182b..9999f05dd 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -33,12 +33,12 @@ class Account < ApplicationRecord has_many :active_relationships, class_name: 'Follow', foreign_key: 'account_id', dependent: :destroy has_many :passive_relationships, class_name: 'Follow', foreign_key: 'target_account_id', dependent: :destroy - has_many :following, -> { order('follows.created_at desc') }, through: :active_relationships, source: :target_account - has_many :followers, -> { order('follows.created_at desc') }, through: :passive_relationships, source: :account + has_many :following, -> { order('follows.id desc') }, through: :active_relationships, source: :target_account + has_many :followers, -> { order('follows.id desc') }, through: :passive_relationships, source: :account # Block relationships has_many :block_relationships, class_name: 'Block', foreign_key: 'account_id', dependent: :destroy - has_many :blocking, -> { order('blocks.created_at desc') }, through: :block_relationships, source: :target_account + has_many :blocking, -> { order('blocks.id desc') }, through: :block_relationships, source: :target_account has_many :media_attachments, dependent: :destroy -- cgit