flexirecord 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/CHANGELOG +10 -0
  2. data/lib/flexirecord.rb +4 -4
  3. metadata +2 -2
data/CHANGELOG CHANGED
@@ -71,6 +71,16 @@
71
71
  - >
72
72
  Added support for floats in addition to rationals/numerics.
73
73
 
74
+ - Release of version 1.0.3
75
+
76
+ - 2007-03-15:
77
+ - >
78
+ A bug in the preloader has been fixed, which caused trouble when a record array contained duplicate objects (with the same primary key).
79
+
80
+ - Release of version 1.0.4
81
+
82
+
83
+
74
84
 
75
85
 
76
86
 
@@ -279,7 +279,7 @@ module FlexiRecord
279
279
  )
280
280
  destination_record_hash = {}
281
281
  destination_records.each do |destination_record|
282
- destination_record_hash[@destination_columns.collect { |column| destination_record[column] }] = destination_record
282
+ (destination_record_hash[@destination_columns.collect { |column| destination_record[column] }] ||= []) << destination_record
283
283
  destination_record[@dst_to_src_attr, *arguments] =
284
284
  if self.many_to_one?
285
285
  FlexiRecord::RecordArray.new(@source_class)
@@ -288,11 +288,11 @@ module FlexiRecord
288
288
  end
289
289
  end
290
290
  source_records.each do |source_record|
291
- destination_record = destination_record_hash[@source_columns.collect { |column| source_record[column] }]
291
+ matching_destination_records = destination_record_hash[@source_columns.collect { |column| source_record[column] }] || []
292
292
  if @src_to_dst_attr
293
- source_record[@src_to_dst_attr] = destination_record
293
+ source_record[@src_to_dst_attr] = matching_destination_records.first
294
294
  end
295
- if destination_record
295
+ matching_destination_records.each do |destination_record|
296
296
  if self.many_to_one?
297
297
  destination_record[@dst_to_src_attr, *arguments] << source_record
298
298
  else
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: flexirecord
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.3
7
- date: 2007-03-10 00:00:00 +00:00
6
+ version: 1.0.4
7
+ date: 2007-03-15 00:00:00 +00:00
8
8
  summary: Object-Oriented Database Access Library (ORM layer)
9
9
  require_paths:
10
10
  - lib/