diff options
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/fake_record.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/support/fake_record.rb b/test/support/fake_record.rb index ed4420a2cd..035a7a46cf 100644 --- a/test/support/fake_record.rb +++ b/test/support/fake_record.rb @@ -60,9 +60,13 @@ module FakeRecord end def quote thing, column = nil - if column && column.type == :integer - return 'NULL' if thing.nil? - return thing.to_i + if column && !thing.nil? + case column.type + when :integer + thing = thing.to_i + when :string + thing = thing.to_s + end end case thing @@ -111,6 +115,10 @@ module FakeRecord def schema_cache connection end + + def quote thing, column = nil + connection.quote thing, column + end end class Base |