这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/acts_as_indexed/class_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ def build_index
def sort(ranked_records)
ranked_records.sort { |a, b|
a_score = a.last
a_id = a.first.is_a?(Fixnum) ? a.first : a.first.id
a_id = a.first.is_a?(Integer) ? a.first : a.first.id

b_score = b.last
b_id = b.first.is_a?(Fixnum) ? b.first : b.first.id
b_id = b.first.is_a?(Integer) ? b.first : b.first.id

if a_score == b_score
a_id <=> b_id
Expand All @@ -230,4 +230,4 @@ def new_index

end

end
end