momomoto 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/momomoto/base.rb CHANGED
@@ -169,7 +169,7 @@ module Momomoto
169
169
  end
170
170
  store = instance_variable_get(:@data)
171
171
  value = data_type.filter_set( value )
172
- if store[index] != value
172
+ if !data_type.equal( value, store[index] )
173
173
  mark_dirty( field_name )
174
174
  store[index] = value
175
175
  end
@@ -25,6 +25,10 @@ module Momomoto
25
25
  value
26
26
  end
27
27
 
28
+ def equal( a, b )
29
+ a == b
30
+ end
31
+
28
32
  def escape( input )
29
33
  input.nil? ? "NULL" : "'" + Database.escape_string( input.to_s ) + "'"
30
34
  end
@@ -2,6 +2,10 @@ module Momomoto
2
2
  module Datatype
3
3
  class Text < Base
4
4
 
5
+ def equal( a, b )
6
+ a.to_s == b.to_s
7
+ end
8
+
5
9
  def escape( input )
6
10
  if input.nil? || input.empty?
7
11
  "NULL"
@@ -5,6 +5,10 @@ module Momomoto
5
5
  module Datatype
6
6
  class Time_without_time_zone < Base
7
7
 
8
+ def equal( a, b )
9
+ escape(a) == escape(b)
10
+ end
11
+
8
12
  def escape( value )
9
13
  case value
10
14
  when nil then 'NULL'
data/lib/momomoto/row.rb CHANGED
@@ -80,7 +80,7 @@ module Momomoto
80
80
  end
81
81
  value = table.columns[column.to_sym].filter_set( value )
82
82
  index = table.column_order.index( column.to_sym )
83
- if @data[index] != value
83
+ if !table.columns[column.to_sym].equal( value, @data[index] )
84
84
  mark_dirty( column )
85
85
  @data[index] = value
86
86
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: momomoto
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.5
7
- date: 2007-09-15 00:00:00 +02:00
6
+ version: 0.1.6
7
+ date: 2007-09-24 00:00:00 +02:00
8
8
  summary: Momomoto is an object relational mapper for PostgreSQL.
9
9
  require_paths:
10
10
  - lib