diff options
author | Akihiko Odaki (@fn_aki@pawoo.net) <akihiko.odaki.4i@stu.hosei.ac.jp> | 2017-07-03 20:17:27 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-07-03 13:17:27 +0200 |
commit | f85dbe83c8e982f9685fbc802031b74c7c319bc7 (patch) | |
tree | 8274ae5461de597c38e1d7faed3a9062e6113d7f /spec | |
parent | a9c326b200247c1dc943c3e2467381772d37bfc8 (diff) |
Remove sort in Feed (#4050)
In from_redis method, statuses retrieved from the database was mapped to the IDs retrieved from Redis. It was equivalent to order from high to low because those IDs are sorted in the same order. Statuses are ordered with the ID by default, so we do not have to reorder. Sorting statuses in the database is even faster since the IDs are indexed with B-tree.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/feed_spec.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/models/feed_spec.rb b/spec/models/feed_spec.rb index 1cdb3a783..1c377c17f 100644 --- a/spec/models/feed_spec.rb +++ b/spec/models/feed_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' RSpec.describe Feed, type: :model do describe '#get' do - it 'gets statuses with ids in the range, maintining the order from Redis' do + it 'gets statuses with ids in the range' do account = Fabricate(:account) Fabricate(:status, account: account, id: 1) Fabricate(:status, account: account, id: 2) |