ar_pg_array 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/ar_pg_array/references_by.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.4
|
@@ -15,7 +15,7 @@ module PGArrays
|
|
15
15
|
class RelationHolder < Struct.new(:relation, :field, :klass)
|
16
16
|
|
17
17
|
def referenced(obj)
|
18
|
-
ids = obj[field] || []
|
18
|
+
ids = (obj[field] || []).map{|i| i.to_i}
|
19
19
|
objs = klass.find_all_by_id( ids.sort )
|
20
20
|
if ids.size < 20
|
21
21
|
objs.sort_by{|o| ids.index(o.id)}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ar_pg_array
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 4
|
10
|
+
version: 0.9.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sokolov Yura aka funny_falcon
|