public
Fork of sam/dm-core
Description: DataMapper - Core
Homepage: http://datamapper.org
Clone URL: git://github.com/thewordnerd/dm-core.git
Added DM::Types::Binary to list of allowed primitives and make it dump to 
Extlib::ByteArray.
thewordnerd (author)
Sun Jul 20 07:03:01 -0700 2008
commit  52024880baf0865e9b3e04c65e7ee49b09c7c639
tree    89507ea2e152a581819eb32bccb0de99712f9641
parent  4fbc15b587f6a03680af84a39160dd78e13937fe
...
265
266
267
268
 
 
269
270
271
...
265
266
267
 
268
269
270
271
272
0
@@ -265,7 +265,8 @@ module DataMapper
0
       Object,
0
       Class,
0
       DataMapper::Types::Discriminator,
0
- DataMapper::Types::Serial
0
+ DataMapper::Types::Serial,
0
+ Extlib::ByteArray
0
     ]
0
 
0
     IMMUTABLE_TYPES = [ TrueClass, Float, Integer, BigDecimal]
...
5
6
7
8
9
 
 
10
11
12
...
5
6
7
 
 
8
9
10
11
12
0
@@ -5,8 +5,8 @@ module DataMapper
0
       lazy true
0
 
0
       def self.dump(value, property)
0
- puts value.class
0
- value
0
+ return nil if value.nil?
0
+ return Extlib::ByteArray.new(value) if value.class == String
0
       end
0
 
0
     end # class Binary

Comments

    No one has commented yet.