flexirecord 1.0.0 → 1.0.1

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 +5 -0
  2. data/lib/flexirecord.rb +3 -3
  3. metadata +1 -1
data/CHANGELOG CHANGED
@@ -52,3 +52,8 @@
52
52
  PostgreSQL's types 'date', 'timestamp' and 'timestamptz' now get converted to a ruby Time object, when being read from the database. Ruby Time objects get converted to the following string representation, when being written to the database: 'YYYY-MM-DD HH:MM:SS.uuuuuu+/-hh', where hh is the offset in hours from UTC. This string can be (implicitly or explicitly) type casted by PostgreSQL to a Date/Time type.
53
53
 
54
54
  - Release of version 1.0.0.
55
+
56
+ - 2007-03-02:
57
+ - >
58
+ Fixed a bug leading to wrong microseconds in timestamps read from the database.
59
+
data/lib/flexirecord.rb CHANGED
@@ -1328,12 +1328,12 @@ module FlexiRecord
1328
1328
  unless value_string =~ /^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})(\.([0-9]*))?$/
1329
1329
  raise "Unexpected format for timestamp without time zone from database."
1330
1330
  end
1331
- Time.local($1.to_i, $2.to_i, $3.to_i, $4.to_i, $5.to_i, $6.to_i, $8.to_i)
1331
+ Time.local($1.to_i, $2.to_i, $3.to_i, $4.to_i, $5.to_i, $6.to_i, $8.to_i * 10 ** (6 - $8.to_s.length))
1332
1332
  elsif data_type == "timestamptz"
1333
- unless value_string =~ /^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})(\.([0-9]*))?([+-][0-9]{2})$/
1333
+ unless value_string =~ /^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})(\.([0-9]*))?( ?[+-][0-9]{2})$/
1334
1334
  aise "Unexpected format for timestamp with time zone from database."
1335
1335
  end
1336
- (Time.utc($1.to_i, $2.to_i, $3.to_i, $4.to_i, $5.to_i, $6.to_i, $8.to_i) - (3600 * $9.to_i)).localtime
1336
+ (Time.utc($1.to_i, $2.to_i, $3.to_i, $4.to_i, $5.to_i, $6.to_i, $8.to_i * 10 ** (6 - $8.to_s.length)) - (3600 * $9.to_i)).localtime
1337
1337
  else
1338
1338
  value_string
1339
1339
  end
metadata CHANGED
@@ -3,7 +3,7 @@ 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.0
6
+ version: 1.0.1
7
7
  date: 2007-03-02 00:00:00 +00:00
8
8
  summary: Object-Oriented Database Access Library (ORM layer)
9
9
  require_paths: