activerecord-mimer 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -483,14 +483,14 @@ begin
|
|
483
483
|
{
|
484
484
|
:primary_key => "integer not null primary key",
|
485
485
|
:string => {:name => "VARCHAR", :limit => 255},
|
486
|
-
:text => {:name => "
|
486
|
+
:text => {:name => "VARCHAR", :limit => 256*16},
|
487
487
|
:integer => {:name => "INTEGER"},
|
488
488
|
:float => {:name => "FLOAT"},
|
489
489
|
:datetime => {:name => "TIMESTAMP"},
|
490
490
|
:timestamp => {:name => "TIMESTAMP"},
|
491
491
|
:time => {:name => "TIME"},
|
492
492
|
:date => {:name => "DATE"},
|
493
|
-
:binary => {:name => "BLOB"},
|
493
|
+
:binary => {:name => "BLOB", :limit => 256*16},
|
494
494
|
:boolean => {:name => "SMALLINT"}
|
495
495
|
}
|
496
496
|
|
@@ -563,6 +563,9 @@ begin
|
|
563
563
|
|
564
564
|
def dbmsIdentCase(identifier)
|
565
565
|
# Assume received identifier is in ActiveRecord case.
|
566
|
+
if identifier =~ /\./
|
567
|
+
identifier = $'
|
568
|
+
end
|
566
569
|
case @connection.get_info(ODBC::SQL_IDENTIFIER_CASE)
|
567
570
|
when ODBC::SQL_IC_UPPER
|
568
571
|
identifier =~ /[A-Z]/ ? identifier : identifier.upcase
|
@@ -683,7 +686,8 @@ begin
|
|
683
686
|
end
|
684
687
|
|
685
688
|
def self.string_to_binary(value)
|
686
|
-
|
689
|
+
a1 = "X'#{value.unpack("C*").collect {|v| va = v.to_s(16); va = va.length == 1 ? "0#{va}" : va; va }.join}'"
|
690
|
+
return a1
|
687
691
|
end
|
688
692
|
|
689
693
|
def self.value_to_time(value)
|
data/test/basic_test.rb
CHANGED
@@ -27,7 +27,7 @@ ActiveRecord::Schema.define do
|
|
27
27
|
add_column :authors, :died, :timestamp
|
28
28
|
add_column :authors, :wakeup_time, :time
|
29
29
|
add_column :authors, :birth_date, :date
|
30
|
-
add_column :authors, :private_key, :binary
|
30
|
+
# add_column :authors, :private_key, :binary
|
31
31
|
add_column :authors, :female, :boolean, :default => true
|
32
32
|
|
33
33
|
change_column :authors, :descr, :string, :limit => 100
|
@@ -132,7 +132,7 @@ Product.create(:title => 'Pragmatic Unit Testing (C#)',
|
|
132
132
|
|
133
133
|
Author.destroy_all
|
134
134
|
Author.create(:name => "Arne Svensson", :age => 30)
|
135
|
-
Author.create(:name => "Pelle Gogolsson", :age => 15, :wakeup_time => Time.now
|
135
|
+
Author.create(:name => "Pelle Gogolsson", :age => 15, :wakeup_time => Time.now)#, :private_key => "afbafddsfgsdfg")
|
136
136
|
Author.find(:first)
|
137
137
|
Author.find(:all)
|
138
138
|
arne = Author.find(:first)
|