Dear sybase_adaptor.rb developers.
Please check this patch.
Problem:
User.find("1") will fail when numconvert set to false.
* At least above code work find with MySQL
* User is a ActiveRecord Object. "1" is primary key(id column).
* It is need to use the following case
class UsersController < ApplicationController
....
def show
@user = User.find(params[:id])
end
About numconvert:
http://wiki.rubyonrails.org/rails/pages/HowToSetupSybaseAdapterOnRails
Patch:
copy from connection_adapters/abstract/quoting.rb
--- sybase_adapter.rb.org 2007-04-09 12:20:06.000000000 +0900
+++ sybase_adapter.rb 2007-04-09 12:39:29.000000000 +0900
@@ -283,6 +283,9 @@
when String
if column && column.type == :binary &&
column.class.respond_to?(:string_to_binary)
"#{quote_string(column.class.string_to_binary(value))}"
+ elsif column && [:integer, :float].include?(column.type)
+ value = column.type == :integer ? value.to_i :
value.to_f
+ value.to_s
elsif @numconvert && force_numeric?(column) && value =~ /
^[+-]?[0-9]+$/o
value
else
Environment
activerecord-1.15.3
--
Hiroyuki Sato.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---