Skip to content

Commit

Permalink
fixed the exception when use ranked-model with default scope that joi…
Browse files Browse the repository at this point in the history
…ns other table which cause ambiguous id error
  • Loading branch information
rociiu authored and mixonic committed Jun 25, 2012
1 parent 43ba9b5 commit b95e2e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ranked-model/ranker.rb
Expand Up @@ -209,7 +209,7 @@ def finder
_finder = _finder.where \
instance.class.arel_table[:id].not_eq(instance.id)
end
_finder.order(instance.class.arel_table[ranker.column].asc).select([:id, ranker.column])
_finder.order(instance.class.arel_table[ranker.column].asc).select([instance.class.arel_table[:id], instance.class.arel_table[ranker.column]])
end
end

Expand Down

0 comments on commit b95e2e8

Please sign in to comment.