sam / do fork watch download tarball
public
Rubygem
Description: DataObjects
Homepage: http://rubyforge.org/projects/dorb
Clone URL: git://github.com/sam/do.git
Adding Class type support to DO.
sam (author)
Thu May 01 06:01:56 -0700 2008
commit  82fdebc3d31665f08f08b3fdf58102c4e8bd399b
tree    6a6bab31652de52f4b4ec71bda2f87707a8d90a9
parent  6c7a8adfbfedc8ebcb59e23e4248c233bd3beae1
...
125
126
127
 
 
 
128
129
130
...
125
126
127
128
129
130
131
132
133
0
@@ -125,6 +125,9 @@ static VALUE ruby_typecast(sqlite3_value *value, char *type, int original_type)
0
   if ( original_type == SQLITE_NULL ) {
0
     return ruby_value;
0
   }
0
+  else if ( strcmp(type, "Class") == 0) {
0
+    ruby_value = rb_eval(rb_str_new2((char*)sqlite3_value_text(value)));
0
+  }
0
   else if ( strcmp(type, "Object") == 0 ) {
0
     ruby_value = rb_marshal_load(rb_str_new2((char*)sqlite3_value_text(value)));
0
   }
...
26
27
28
29
 
30
31
32
...
26
27
28
 
29
30
31
32
0
@@ -26,7 +26,7 @@ describe "DataObjects::Sqlite3::Result" do
0
   it "should return the affected rows and insert_id" do
0
     command = @connection.create_command("DROP TABLE users")
0
     command.execute_non_query rescue nil
0
-    command = @connection.create_command("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, age INTEGER)")
0
+    command = @connection.create_command("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, type TEXT, age INTEGER)")
0
     result = command.execute_non_query
0
     command = @connection.create_command("INSERT INTO users (name) VALUES ('test')")    
0
     result = command.execute_non_query

Comments