Skip to content
Browse files

tiny fix

  • Loading branch information...
1 parent 164847b commit c519abe7bd43e389a4be44abfb3c1d12fc00317a @funny-falcon committed Sep 10, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/ar_pg_array/references_by.rb
View
2 lib/ar_pg_array/references_by.rb
@@ -15,7 +15,7 @@ module ReferencesBy
class RelationHolder < Struct.new(:relation, :field, :klass)
def referenced(obj)
- ids = obj[field] || []
+ ids = (obj[field] || []).map{|i| i.to_i}
objs = klass.find_all_by_id( ids.sort )
if ids.size < 20
objs.sort_by{|o| ids.index(o.id)}

0 comments on commit c519abe

Please sign in to comment.
Something went wrong with that request. Please try again.