All, I am not sure if this is the correct list or not, but here goes. I have the following code: class Interior < ActiveRecord::Base set_table_name "interior_selections" set_primary_key "selection_id" end class InteriorSelectionsController < ApplicationController scaffold :interior end When I run the code under SQL Server, I get the following error: ActiveRecord::StatementInvalid in Interior_selections#index Execute OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server Line 1: Incorrect syntax near '*'. HRESULT error code:0x80020009 Exception occurred.: SELECT * FROM ( SELECT TOP 10 * FROM ( SELECT TOP 10 * FROM interior_SELECT * FROM ( SELECT TOP 10 * FROM ( SELECT TOP 10ions ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY id ASC script/server:49 Show framework trace <http://127.0.0.1:3000/InteriorSelections#> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/abstract_adapter.rb:462:in `log' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/sqlserver_adapter.rb:330:in `select' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/sqlserver_adapter.rb:186:in `select_all' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:376:in `find_by_sql' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:343:in `find' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/deprecated_finders.rb:37:in `find_all' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:161:in `find_collection_for_pagination' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:175:in `paginator_and_collection_for' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:111:in `paginate' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:101:in `list' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:94:in `index' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in `perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in `perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `process' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:105:in `handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:71:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in `dispatch' Request Parameters: None Show session dump <http://127.0.0.1:3000/InteriorSelections#> --- flash: !ruby/hash:ActionController::Flash::FlashHash {} Response Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} Now, I have attempted to run this under MySQL [Not a real option in production] and it works fine with this database name. Thanks in advance, Ron _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
The scaffolding uses the paginator which is generating the "top 10" in the sql. It looks like there is a bug in how the SqlServer adapter adds the "top 10". Why don''t you try overriding the list method in the controller (or create another action/method) where you do @interiors = Interior.find(:all) which should just generate "select * from ..." and see if that works. Ron DiFrango wrote:>All, > >I am not sure if this is the correct list or not, but here goes. I have the following code: > >class Interior < ActiveRecord::Base > set_table_name "interior_selections" > set_primary_key "selection_id" >end > >class InteriorSelectionsController < ApplicationController > scaffold :interior >end > >When I run the code under SQL Server, I get the following error: > > > >ActiveRecord::StatementInvalid in Interior_selections#index > >Execute > OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server > Line 1: Incorrect syntax near ''*''. > HRESULT error code:0x80020009 > Exception occurred.: SELECT * FROM ( SELECT TOP 10 * FROM ( SELECT TOP 10 * FROM interior_SELECT * FROM ( SELECT TOP 10 * FROM ( SELECT TOP 10ions ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY id ASC >script/server:49 >Show framework trace <http://127.0.0.1:3000/InteriorSelections#> >c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/abstract_adapter.rb:462:in `log'' >c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/sqlserver_adapter.rb:330:in `select'' >c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/sqlserver_adapter.rb:186:in `select_all'' >c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:376:in `find_by_sql'' >c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:343:in `find'' >c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/deprecated_finders.rb:37:in `find_all'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:161:in `find_collection_for_pagination'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:175:in `paginator_and_collection_for'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:111:in `paginate'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:101:in `list'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:94:in `index'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `send'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `perform_action_without_filters'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in `perform_action_without_benchmark'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `measure'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in `perform_action'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `send'' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `process'' >c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'' >c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:105:in `handle_dispatch'' >c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:71:in `service'' >c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' >c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' >c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' >c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'' >c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' >c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'' >c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'' >c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'' >c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' >c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' >c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in `dispatch'' > > > > >Request > > >Parameters: None > >Show session dump <http://127.0.0.1:3000/InteriorSelections#> > >--- >flash: !ruby/hash:ActionController::Flash::FlashHash {} > >Response > >Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} > >Now, I have attempted to run this under MySQL [Not a real option in production] and it works fine with this database name. > >Thanks in advance, > >Ron > > >------------------------------------------------------------------------ > >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >
Steve, That will work, although I hate writing code if I do not have to :-( Does anyone know where the SqlServer adapter code is that addes in the top 10 code so I can look at fixing it? From what I can tell it is some sort of regular expression type search on SELECT and since my talbe name has the wor "selections" in it, ths search & replace is failing to do it properly. Ron -----Original Message----- From: Steve Downey [mailto:sldowney@berkeley.edu] Sent: Sat 8/13/2005 10:30 AM To: rails@lists.rubyonrails.org Cc: Subject: Re: [Rails] Microsoft SQL Server issue The scaffolding uses the paginator which is generating the "top 10" in the sql. It looks like there is a bug in how the SqlServer adapter adds the "top 10". Why don't you try overriding the list method in the controller (or create another action/method) where you do @interiors = Interior.find(:all) which should just generate "select * from ..." and see if that works. Ron DiFrango wrote: >All, > >I am not sure if this is the correct list or not, but here goes. I have the following code: > >class Interior < ActiveRecord::Base > set_table_name "interior_selections" > set_primary_key "selection_id" >end > >class InteriorSelectionsController < ApplicationController > scaffold :interior >end > >When I run the code under SQL Server, I get the following error: > > > >ActiveRecord::StatementInvalid in Interior_selections#index > >Execute > OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server > Line 1: Incorrect syntax near '*'. > HRESULT error code:0x80020009 > Exception occurred.: SELECT * FROM ( SELECT TOP 10 * FROM ( SELECT TOP 10 * FROM interior_SELECT * FROM ( SELECT TOP 10 * FROM ( SELECT TOP 10ions ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY id ASC >script/server:49 >Show framework trace <http://127.0.0.1:3000/InteriorSelections#> >c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/abstract_adapter.rb:462:in `log' >c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/sqlserver_adapter.rb:330:in `select' >c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/sqlserver_adapter.rb:186:in `select_all' >c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:376:in `find_by_sql' >c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:343:in `find' >c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/deprecated_finders.rb:37:in `find_all' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:161:in `find_collection_for_pagination' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:175:in `paginator_and_collection_for' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:111:in `paginate' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:101:in `list' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:94:in `index' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `send' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `perform_action_without_filters' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in `perform_action_without_benchmark' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `measure' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in `perform_action' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `send' >c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `process' >c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch' >c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:105:in `handle_dispatch' >c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:71:in `service' >c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' >c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' >c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread' >c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start' >c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread' >c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start' >c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each' >c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start' >c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start' >c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start' >c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in `dispatch' > > > > >Request > > >Parameters: None > >Show session dump <http://127.0.0.1:3000/InteriorSelections#> > >--- >flash: !ruby/hash:ActionController::Flash::FlashHash {} > >Response > >Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} > >Now, I have attempted to run this under MySQL [Not a real option in production] and it works fine with this database name. > >Thanks in advance, > >Ron > > >------------------------------------------------------------------------ > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Ron DiFrango wrote:>Steve, > >That will work, although I hate writing code if I do not have to :-( > >Does anyone know where the SqlServer adapter code is that addes in the top 10 code so I can look at fixing it? From what I can tell it is some sort of regular expression type search on SELECT and since my talbe name has the wor "selections" in it, ths search & replace is failing to do it properly. > >my path to the dir is: C:\ruby\lib\ruby\gems\1.8\gems\activerecord-1.11.1.1962\lib\active_record\connection_adapters you want to look for sql_server_adapter.rb in the add_limit_offset! method. It looks like it is adding the "top N" code twice.
Your table name ''interior_selections'' is getting munged by a regex-replace on SELECT during the pagination code. This is because sql server(7/2000) does not implement LIMIT/OFFSET, so the T-Sql to perform a LIMIT/OFFSET is painful. SqlServerAdapter#add_limit_offset uses replace on the select to get the records. You could: A) rename the table. B) look into http://wiki.rubyonrails.com/rails/show/How%20to%20Paginate%20With%20Ajax C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? Peter J. Fitzgibbons Applications Manager Lakewood Homes - "The American Dream Builder"(r) Peter.Fitzgibbons-STCS76aLmhk1y/cD6r8xzl6hYfS7NtTn@public.gmane.org (847) 884-8800 ________________________________ From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ron DiFrango Sent: Saturday, August 13, 2005 8:39 AM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Microsoft SQL Server issue All, I am not sure if this is the correct list or not, but here goes. I have the following code: class Interior < ActiveRecord::Base set_table_name "interior_selections" set_primary_key "selection_id" end class InteriorSelectionsController < ApplicationController scaffold :interior end When I run the code under SQL Server, I get the following error: ActiveRecord::StatementInvalid in Interior_selections#index Execute OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server Line 1: Incorrect syntax near ''*''. HRESULT error code:0x80020009 Exception occurred.: SELECT * FROM ( SELECT TOP 10 * FROM ( SELECT TOP 10 * FROM interior_SELECT * FROM ( SELECT TOP 10 * FROM ( SELECT TOP 10ions ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY id ASC script/server:49 Show framework trace <http://127.0.0.1:3000/InteriorSelections#> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/con nection_adapters/abstract_adapter.rb:462:in `log'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/con nection_adapters/sqlserver_adapter.rb:330:in `select'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/con nection_adapters/sqlserver_adapter.rb:186:in `select_all'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/bas e.rb:376:in `find_by_sql'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/bas e.rb:343:in `find'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/dep recated_finders.rb:37:in `find_all'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pa gination.rb:161:in `find_collection_for_pagination'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pa gination.rb:175:in `paginator_and_collection_for'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pa gination.rb:111:in `paginate'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/sc affolding.rb:101:in `list'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/sc affolding.rb:94:in `index'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/ba se.rb:756:in `send'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/ba se.rb:756:in `perform_action_without_filters'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/fi lters.rb:295:in `perform_action_without_benchmark'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/be nchmarking.rb:41:in `perform_action_without_rescue'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/be nchmarking.rb:41:in `measure'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/be nchmarking.rb:41:in `perform_action_without_rescue'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/re scue.rb:80:in `perform_action'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/ba se.rb:356:in `send'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/ba se.rb:356:in `process'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:105:in `handle_dispatch'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:71:in `service'' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in `dispatch'' Request Parameters: None Show session dump <http://127.0.0.1:3000/InteriorSelections#> --- flash: !ruby/hash:ActionController::Flash::FlashHash {} Response Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} Now, I have attempted to run this under MySQL [Not a real option in production] and it works fine with this database name. Thanks in advance, Ron _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? Check out the \b anchor: /\bSELECT\b/ The \b requires that SELECT be preceded and followed by a "word boundary", i.e. some character that is not in the "\w" set. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Steve, Where is this code found? Can I fix this myself? Ron -----Original Message----- From: Steve Downey [mailto:sldowney@berkeley.edu] Sent: Sun 8/14/2005 1:05 PM To: rails@lists.rubyonrails.org Cc: Subject: Re: [Rails] RE: Microsoft SQL Server issue C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? Check out the \b anchor: /\bSELECT\b/ The \b requires that SELECT be preceded and followed by a "word boundary", i.e. some character that is not in the "\w" set. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
on my system its at: \ruby\lib\ruby\gems\1.8\gems\activerecord-1.11.1\lib\active_record\conne ction_adapters\sqlserver_adapter.rb ________________________________ From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 11:19 AM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve, Where is this code found? Can I fix this myself? Ron -----Original Message----- From: Steve Downey [mailto:sldowney-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org] Sent: Sun 8/14/2005 1:05 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Cc: Subject: Re: [Rails] RE: Microsoft SQL Server issue C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? Check out the \b anchor: /\bSELECT\b/ The \b requires that SELECT be preceded and followed by a "word boundary", i.e. some character that is not in the "\w" set. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Steve/Neville, The fix got me closer now. The select looks correct now, but now it seems to not be pulling the ID column correctly as it is hard coded as follows: ||= "id ASC" not knowing Ruby or RAILS very well I tried the following to get the correct column: ||= "#{primary_key} ASC" But that was not correct? What is the correct syntax to pull the correct primary key column [given that I over rode it] Ron -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell@bmsoft.com.au] Sent: Sun 8/14/2005 10:11 PM To: rails@lists.rubyonrails.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue on my system its at: \ruby\lib\ruby\gems\1.8\gems\activerecord-1.11.1\lib\active_record\connection_adapters\sqlserver_adapter.rb _____ From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 11:19 AM To: rails@lists.rubyonrails.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve, Where is this code found? Can I fix this myself? Ron -----Original Message----- From: Steve Downey [mailto:sldowney@berkeley.edu] Sent: Sun 8/14/2005 1:05 PM To: rails@lists.rubyonrails.org Cc: Subject: Re: [Rails] RE: Microsoft SQL Server issue C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? Check out the \b anchor: /\bSELECT\b/ The \b requires that SELECT be preceded and followed by a "word boundary", i.e. some character that is not in the "\w" set. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
on 8/14/2005 6:18 PM Ron DiFrango said the following:>Steve, > >Where is this code found? Can I fix this myself? > >Ron > > -----Original Message----- > From: Steve Downey [mailto:sldowney-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org] > > C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? > > > Check out the \b anchor: > > /\bSELECT\b/ > > The \b requires that SELECT be preceded and followed by a "word boundary", i.e. some character that is not in the "\w" set. > >Ron, You reported the file where in your original stack trace: c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/sqlserver_adapter.rb:330:in `select'' Actually, the error happens somewhere just before that, on line 307 as Steve points out. (By the way, it looks like line 309 needs the same change.) Yes, you can change this yourself. I''m not clear that the proposed change is ideal though. The relevant code (slightly simplified) is sql.gsub!( /SELECT/i, "SELECT TOP x * FROM ( SELECT TOP x+y")<<" ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY ASC and the proposed change is sql.gsub!( /\bSELECT\b/i, "SELECT TOP x * FROM ( SELECT TOP x+y")<<" ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY ASC The first code matchs _every_ occurrence of SELECT, without regard to case, with SELECT TOP x * FROM ( SELECT TOP x+y, and then appends the code to choose the bottom y of the top x. I don''t think that this is what the code should do. I assume that original author thought that they were handling nested queries: SELECT * FROM A where B in (SELECT B FROM C where D). After a full substitution the substituted code would give select the top x results out of the top x results of the subquery. This will return fewer than x results almost every time, and some results could be omitted as you traversed the results. Pseudo code example: SELECT the top 2 results evenly divisible by 3 from the (SELECT top 2 even integers from the ordered set of integers) Returns nothing on the first call (neither 2, nor 4 are divisible by 3), 6 on the second call, none on the third call, 12 on the fourth, etc. In reality this code should be: SELECT the top 2 results evenly divisible by 3 from (SELECT even from the ordered set of integers) Returns 6,12 on the first call, 18, 24 on the second, etc. So I propose sql.sub! instead of sql.gsub! so that the code be changed to sql.sub!( /\bSELECT\b/i, "SELECT TOP x * FROM ( SELECT TOP x+y")<<" ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY ASC Am I missing some cases? In any case you should file a bug about both lines 307 and 309. Something like, SQL Server adapter add_limit_offset fails if table or column names include the string "SELECT". Include your patch. Ray
Hi Ron, I haven''t tried this, but perhaps try: ||= "#{get_identity_column(get_table_name(sql))} ASC" Neville -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 12:54 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve/Neville, The fix got me closer now. The select looks correct now, but now it seems to not be pulling the ID column correctly as it is hard coded as follows: ||= "id ASC" not knowing Ruby or RAILS very well I tried the following to get the correct column: ||= "#{primary_key} ASC" But that was not correct? What is the correct syntax to pull the correct primary key column [given that I over rode it] Ron -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell-uEDVyssJ3mUpAS55Wn97og@public.gmane.org] Sent: Sun 8/14/2005 10:11 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue on my system its at: \ruby\lib\ruby\gems\1.8\gems\activerecord-1.11.1\lib\active_record\conne ction_adapters\sqlserver_adapter.rb _____ From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 11:19 AM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve, Where is this code found? Can I fix this myself? Ron -----Original Message----- From: Steve Downey [mailto:sldowney-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org] Sent: Sun 8/14/2005 1:05 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Cc: Subject: Re: [Rails] RE: Microsoft SQL Server issue C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? Check out the \b anchor: /\bSELECT\b/ The \b requires that SELECT be preceded and followed by a "word boundary", i.e. some character that is not in the "\w" set.
Where do I submit the bug to? Is it a Rails bug? And yes I did have to change it on both lines [307 & 309]. Also, I have seperate one on the ID column as well as that is hard coded on line 302. -----Original Message----- From: Ray Baxter [mailto:ray.baxter@mindspring.com] Sent: Sun 8/14/2005 11:14 PM To: rails@lists.rubyonrails.org Cc: Subject: Re: [Rails] RE: Microsoft SQL Server issue on 8/14/2005 6:18 PM Ron DiFrango said the following: >Steve, > >Where is this code found? Can I fix this myself? > >Ron > > -----Original Message----- > From: Steve Downey [mailto:sldowney@berkeley.edu] > > C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? > > > Check out the \b anchor: > > /\bSELECT\b/ > > The \b requires that SELECT be preceded and followed by a "word boundary", i.e. some character that is not in the "\w" set. > > Ron, You reported the file where in your original stack trace: c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/sqlserver_adapter.rb:330:in `select' Actually, the error happens somewhere just before that, on line 307 as Steve points out. (By the way, it looks like line 309 needs the same change.) Yes, you can change this yourself. I'm not clear that the proposed change is ideal though. The relevant code (slightly simplified) is sql.gsub!( /SELECT/i, "SELECT TOP x * FROM ( SELECT TOP x+y")<<" ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY ASC and the proposed change is sql.gsub!( /\bSELECT\b/i, "SELECT TOP x * FROM ( SELECT TOP x+y")<<" ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY ASC The first code matchs _every_ occurrence of SELECT, without regard to case, with SELECT TOP x * FROM ( SELECT TOP x+y, and then appends the code to choose the bottom y of the top x. I don't think that this is what the code should do. I assume that original author thought that they were handling nested queries: SELECT * FROM A where B in (SELECT B FROM C where D). After a full substitution the substituted code would give select the top x results out of the top x results of the subquery. This will return fewer than x results almost every time, and some results could be omitted as you traversed the results. Pseudo code example: SELECT the top 2 results evenly divisible by 3 from the (SELECT top 2 even integers from the ordered set of integers) Returns nothing on the first call (neither 2, nor 4 are divisible by 3), 6 on the second call, none on the third call, 12 on the fourth, etc. In reality this code should be: SELECT the top 2 results evenly divisible by 3 from (SELECT even from the ordered set of integers) Returns 6,12 on the first call, 18, 24 on the second, etc. So I propose sql.sub! instead of sql.gsub! so that the code be changed to sql.sub!( /\bSELECT\b/i, "SELECT TOP x * FROM ( SELECT TOP x+y")<<" ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY ASC Am I missing some cases? In any case you should file a bug about both lines 307 and 309. Something like, SQL Server adapter add_limit_offset fails if table or column names include the string "SELECT". Include your patch. Ray _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Nope, "#{get_identity_column(get_table_name(sql))} ASC" did not work... I have tried: #{primary_key} and #{id} None of which worked. -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell@bmsoft.com.au] Sent: Sun 8/14/2005 11:19 PM To: rails@lists.rubyonrails.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue Hi Ron, I haven't tried this, but perhaps try: ||= "#{get_identity_column(get_table_name(sql))} ASC" Neville -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 12:54 PM To: rails@lists.rubyonrails.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve/Neville, The fix got me closer now. The select looks correct now, but now it seems to not be pulling the ID column correctly as it is hard coded as follows: ||= "id ASC" not knowing Ruby or RAILS very well I tried the following to get the correct column: ||= "#{primary_key} ASC" But that was not correct? What is the correct syntax to pull the correct primary key column [given that I over rode it] Ron -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell@bmsoft.com.au] Sent: Sun 8/14/2005 10:11 PM To: rails@lists.rubyonrails.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue on my system its at: \ruby\lib\ruby\gems\1.8\gems\activerecord-1.11.1\lib\active_record\conne ction_adapters\sqlserver_adapter.rb _____ From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 11:19 AM To: rails@lists.rubyonrails.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve, Where is this code found? Can I fix this myself? Ron -----Original Message----- From: Steve Downey [mailto:sldowney@berkeley.edu] Sent: Sun 8/14/2005 1:05 PM To: rails@lists.rubyonrails.org Cc: Subject: Re: [Rails] RE: Microsoft SQL Server issue C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? Check out the \b anchor: /\bSELECT\b/ The \b requires that SELECT be preceded and followed by a "word boundary", i.e. some character that is not in the "\w" set. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I took a deeper look and this will only work if happenstance is on your side, ie, that your id column override as per: set_primary_key "selection_id" Is actually reported as an identity column. The problem you face is that the ActiveRecord object representing your table isnt anywhere to be seen in the stock SQL Adapter code which is only dealing with strings. To use the ''primary_key'' method, which is the correct approach, you would first have to find the ActiveRecord object for the ''get_table_name(sql)'' -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Neville Burnell Sent: Monday, 15 August 2005 1:20 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Hi Ron, I haven''t tried this, but perhaps try: ||= "#{get_identity_column(get_table_name(sql))} ASC" Neville -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 12:54 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve/Neville, The fix got me closer now. The select looks correct now, but now it seems to not be pulling the ID column correctly as it is hard coded as follows: ||= "id ASC" not knowing Ruby or RAILS very well I tried the following to get the correct column: ||= "#{primary_key} ASC" But that was not correct? What is the correct syntax to pull the correct primary key column [given that I over rode it] Ron -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell-uEDVyssJ3mUpAS55Wn97og@public.gmane.org] Sent: Sun 8/14/2005 10:11 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue on my system its at: \ruby\lib\ruby\gems\1.8\gems\activerecord-1.11.1\lib\active_record\conne ction_adapters\sqlserver_adapter.rb _____ From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 11:19 AM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve, Where is this code found? Can I fix this myself? Ron -----Original Message----- From: Steve Downey [mailto:sldowney-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org] Sent: Sun 8/14/2005 1:05 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Cc: Subject: Re: [Rails] RE: Microsoft SQL Server issue C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? Check out the \b anchor: /\bSELECT\b/ The \b requires that SELECT be preceded and followed by a "word boundary", i.e. some character that is not in the "\w" set. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Okay, I lied. I must have cut and pasted wrong. It NOW Works! Thanks to all. It looks like 2 bug reports are in order. On for the select substitution and one for the Id column issue. Thanks again all for the pointers, code, etc. Ron -----Original Message----- From: Ron DiFrango on behalf of Ron DiFrango Sent: Sun 8/14/2005 11:26 PM To: rails@lists.rubyonrails.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue Nope, "#{get_identity_column(get_table_name(sql))} ASC" did not work... I have tried: #{primary_key} and #{id} None of which worked. -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell@bmsoft.com.au] Sent: Sun 8/14/2005 11:19 PM To: rails@lists.rubyonrails.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue Hi Ron, I haven't tried this, but perhaps try: ||= "#{get_identity_column(get_table_name(sql))} ASC" Neville -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 12:54 PM To: rails@lists.rubyonrails.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve/Neville, The fix got me closer now. The select looks correct now, but now it seems to not be pulling the ID column correctly as it is hard coded as follows: ||= "id ASC" not knowing Ruby or RAILS very well I tried the following to get the correct column: ||= "#{primary_key} ASC" But that was not correct? What is the correct syntax to pull the correct primary key column [given that I over rode it] Ron -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell@bmsoft.com.au] Sent: Sun 8/14/2005 10:11 PM To: rails@lists.rubyonrails.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue on my system its at: \ruby\lib\ruby\gems\1.8\gems\activerecord-1.11.1\lib\active_record\conne ction_adapters\sqlserver_adapter.rb _____ From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 11:19 AM To: rails@lists.rubyonrails.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve, Where is this code found? Can I fix this myself? Ron -----Original Message----- From: Steve Downey [mailto:sldowney@berkeley.edu] Sent: Sun 8/14/2005 1:05 PM To: rails@lists.rubyonrails.org Cc: Subject: Re: [Rails] RE: Microsoft SQL Server issue C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? Check out the \b anchor: /\bSELECT\b/ The \b requires that SELECT be preceded and followed by a "word boundary", i.e. some character that is not in the "\w" set. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Ron DiFrango wrote:>Okay, I lied. I must have cut and pasted wrong. It NOW Works! Thanks to all. > >It looks like 2 bug reports are in order. On for the select substitution and one for the Id column issue. > >As I found out last week, getting ActiveRecord to work with an Microsoft''s database naming conventions (where everything is named in CamelCase, no underscores) is quite a pain. I ended up hacking the Inflector, eventually. That wasn''t very pretty. I wonder if there is enough interest in making this SQLServer naming convention supported by Rails out of the box. The naming convention I''m talking about is as illustrated here: CREATE TABLE FooBar ( FooBarId IDENTITY(1, 1) int NOT NULL, Content varchar ) CREATE TABLE FooBarChild ( FooBarChildId IDENTITY(1, 1) int NOT NULL, -- primary key FooBarId int NOT NULL -- foreign key ) class FooBar < ActiveRecord::Base has_many :foo_bar_children end class FooBarChild < ActiveRecord::Base belongs_to :foo_bar end Changes required to make it work are mostly in the Inflector. Alternatively, they can be concentrated in the sql_server_adapter.rb, (basically, something needs to remove all the underscores before sending the query to the database, and insert underscores / lowercase capital characters when AR queries the table structure :) Best regards, Alex
there is actually a third bug in this OFFSET / LIMIT code which I dont know how to fix ... perhaps someone can help with the syntax the problem is that the following line in the SQL Adapter does not take into account the options[:conditions] total_rows = @connection.select_all("SELECT count(*) as TotalRows from #{get_table_name(sql)})[0][:TotalRows].to_i The fix would look something like: conditions = options[:conditions] ? "WHERE #{sanitize_sql(options[:conditions])}" : "" total_rows = @connection.select_all("SELECT count(*) as TotalRows from #{get_table_name(sql)} #{conditions}")[0][:TotalRows].to_i The problem with the above is that ''sanitize_sql'' is part of ActiveRecord::Base and is not visible to the SQL Adapter as is ... Any suggestions? Neville
Neville, I found that out as well. But how do I get a hold of the a primary key that is not an identity column? -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell@bmsoft.com.au] Sent: Sun 8/14/2005 11:30 PM To: rails@lists.rubyonrails.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue I took a deeper look and this will only work if happenstance is on your side, ie, that your id column override as per: set_primary_key "selection_id" Is actually reported as an identity column. The problem you face is that the ActiveRecord object representing your table isnt anywhere to be seen in the stock SQL Adapter code which is only dealing with strings. To use the 'primary_key' method, which is the correct approach, you would first have to find the ActiveRecord object for the 'get_table_name(sql)' -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Neville Burnell Sent: Monday, 15 August 2005 1:20 PM To: rails@lists.rubyonrails.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Hi Ron, I haven't tried this, but perhaps try: ||= "#{get_identity_column(get_table_name(sql))} ASC" Neville -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 12:54 PM To: rails@lists.rubyonrails.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve/Neville, The fix got me closer now. The select looks correct now, but now it seems to not be pulling the ID column correctly as it is hard coded as follows: ||= "id ASC" not knowing Ruby or RAILS very well I tried the following to get the correct column: ||= "#{primary_key} ASC" But that was not correct? What is the correct syntax to pull the correct primary key column [given that I over rode it] Ron -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell@bmsoft.com.au] Sent: Sun 8/14/2005 10:11 PM To: rails@lists.rubyonrails.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue on my system its at: \ruby\lib\ruby\gems\1.8\gems\activerecord-1.11.1\lib\active_record\conne ction_adapters\sqlserver_adapter.rb _____ From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 11:19 AM To: rails@lists.rubyonrails.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve, Where is this code found? Can I fix this myself? Ron -----Original Message----- From: Steve Downey [mailto:sldowney@berkeley.edu] Sent: Sun 8/14/2005 1:05 PM To: rails@lists.rubyonrails.org Cc: Subject: Re: [Rails] RE: Microsoft SQL Server issue C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? Check out the \b anchor: /\bSELECT\b/ The \b requires that SELECT be preceded and followed by a "word boundary", i.e. some character that is not in the "\w" set. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Ron, I can only think of using a brute force approach of searching the objectspace, like so: ar_table = nil tname = get_table_name(sql) ObjectSpace.each_object(ActiveRecord::Base) { |x| ar_table = x if x.table_name == tname } options[:order] ||= "#{ar_table.primary_key} ASC" #this will fail if the table is not found ie, ar_table is nil ________________________________ From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 10:50 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Neville, I found that out as well. But how do I get a hold of the a primary key that is not an identity column? -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell-uEDVyssJ3mUpAS55Wn97og@public.gmane.org] Sent: Sun 8/14/2005 11:30 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue I took a deeper look and this will only work if happenstance is on your side, ie, that your id column override as per: set_primary_key "selection_id" Is actually reported as an identity column. The problem you face is that the ActiveRecord object representing your table isnt anywhere to be seen in the stock SQL Adapter code which is only dealing with strings. To use the ''primary_key'' method, which is the correct approach, you would first have to find the ActiveRecord object for the ''get_table_name(sql)'' -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Neville Burnell Sent: Monday, 15 August 2005 1:20 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Hi Ron, I haven''t tried this, but perhaps try: ||= "#{get_identity_column(get_table_name(sql))} ASC" Neville -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 12:54 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve/Neville, The fix got me closer now. The select looks correct now, but now it seems to not be pulling the ID column correctly as it is hard coded as follows: ||= "id ASC" not knowing Ruby or RAILS very well I tried the following to get the correct column: ||= "#{primary_key} ASC" But that was not correct? What is the correct syntax to pull the correct primary key column [given that I over rode it] Ron -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell-uEDVyssJ3mUpAS55Wn97og@public.gmane.org] Sent: Sun 8/14/2005 10:11 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue on my system its at: \ruby\lib\ruby\gems\1.8\gems\activerecord-1.11.1\lib\active_record\conne ction_adapters\sqlserver_adapter.rb _____ From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 11:19 AM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve, Where is this code found? Can I fix this myself? Ron -----Original Message----- From: Steve Downey [mailto:sldowney-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org] Sent: Sun 8/14/2005 1:05 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Cc: Subject: Re: [Rails] RE: Microsoft SQL Server issue C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? Check out the \b anchor: /\bSELECT\b/ The \b requires that SELECT be preceded and followed by a "word boundary", i.e. some character that is not in the "\w" set. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Neville, Thanks for the tip. Too bad it is so difficult to get the primary key in the adaptor code. I should be easier than that. Ron -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell@bmsoft.com.au] Sent: Mon 8/15/2005 8:59 PM To: rails@lists.rubyonrails.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue Ron, I can only think of using a brute force approach of searching the objectspace, like so: ar_table = nil tname = get_table_name(sql) ObjectSpace.each_object(ActiveRecord::Base) { |x| ar_table = x if x.table_name == tname } options[:order] ||= "#{ar_table.primary_key} ASC" #this will fail if the table is not found ie, ar_table is nil ________________________________ From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 10:50 PM To: rails@lists.rubyonrails.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Neville, I found that out as well. But how do I get a hold of the a primary key that is not an identity column? -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell@bmsoft.com.au] Sent: Sun 8/14/2005 11:30 PM To: rails@lists.rubyonrails.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue I took a deeper look and this will only work if happenstance is on your side, ie, that your id column override as per: set_primary_key "selection_id" Is actually reported as an identity column. The problem you face is that the ActiveRecord object representing your table isnt anywhere to be seen in the stock SQL Adapter code which is only dealing with strings. To use the 'primary_key' method, which is the correct approach, you would first have to find the ActiveRecord object for the 'get_table_name(sql)' -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Neville Burnell Sent: Monday, 15 August 2005 1:20 PM To: rails@lists.rubyonrails.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Hi Ron, I haven't tried this, but perhaps try: ||= "#{get_identity_column(get_table_name(sql))} ASC" Neville -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 12:54 PM To: rails@lists.rubyonrails.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve/Neville, The fix got me closer now. The select looks correct now, but now it seems to not be pulling the ID column correctly as it is hard coded as follows: ||= "id ASC" not knowing Ruby or RAILS very well I tried the following to get the correct column: ||= "#{primary_key} ASC" But that was not correct? What is the correct syntax to pull the correct primary key column [given that I over rode it] Ron -----Original Message----- From: Neville Burnell [mailto:Neville.Burnell@bmsoft.com.au] Sent: Sun 8/14/2005 10:11 PM To: rails@lists.rubyonrails.org Cc: Subject: RE: [Rails] RE: Microsoft SQL Server issue on my system its at: \ruby\lib\ruby\gems\1.8\gems\activerecord-1.11.1\lib\active_record\conne ction_adapters\sqlserver_adapter.rb _____ From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Ron DiFrango Sent: Monday, 15 August 2005 11:19 AM To: rails@lists.rubyonrails.org Subject: RE: [Rails] RE: Microsoft SQL Server issue Steve, Where is this code found? Can I fix this myself? Ron -----Original Message----- From: Steve Downey [mailto:sldowney@berkeley.edu] Sent: Sun 8/14/2005 1:05 PM To: rails@lists.rubyonrails.org Cc: Subject: Re: [Rails] RE: Microsoft SQL Server issue C) someone else help me here with the regex on SqlServerAdapter#add_limit_offset.307 .. we need to change the gsub! match to "match whole word only" on SELECT. ?? Check out the \b anchor: /\bSELECT\b/ The \b requires that SELECT be preceded and followed by a "word boundary", i.e. some character that is not in the "\w" set. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
This query on the INFORMATION_SCHEMA views will return all the PKs viewable by the user: --SS2000/2K3: get list of primary keys select tc.table_catalog, tc.table_schema, tc.table_name, tc.constraint_name, tc.constraint_type, ccu.column_name, kcu.ordinal_position, cc.column_default, cc.is_nullable, cc.data_type from information_schema.table_constraints tc inner join information_schema.constraint_column_usage ccu on tc.constraint_name = ccu.constraint_name inner join information_schema.key_column_usage kcu on kcu.constraint_name = ccu.constraint_name and kcu.column_name = ccu.column_name inner join information_schema.columns cc on cc.table_name ccu.table_name and cc.column_name = ccu.column_name where tc.constraint_type = ''PRIMARY KEY'' I think this is what the specific adapters should be kind of hitting, allowing for the inclusion of a method to allow client-side PK generation functions for composite or non-autonumber id fields, as well as detecting composite primary keys. For SQL Server and GUID (uniqueidentifier fields), this could include either calling the server (i.e., select GetID()) to get a GUID before inserting the record, or writing a client-side GUID generator (there''s some VBScript code to do it - how to do it client-side, probably via JavaScript/VBScript in the view?), etc. In fact, I have a database right now (AdventureWorks2000...not sure where I got it) that has GUID fields in the tables, and creating a new record on them fails spectacularly when saving, even though they have the GetID() function on their default values in the db. This could also be used to get the other constraints (i.e., FOREIGN KEY, CHECK, UNIQUE)... It''s not that it''s *hard* go get the PK in the adapter code, it doesn''t really look like it supports it at all. It''s a layer of complexity that hasn''t been looked at, but probably needs to one of these days. -corey On 8/15/05, Ron DiFrango <rdifrango-wfttzDtloRfhmZgEOWDAxUEOCMrvLtNR@public.gmane.org> wrote:> Neville, > > Thanks for the tip. Too bad it is so difficult to get the primary key in the adaptor code. I should be easier than that. > > Ron > > -----Original Message----- > From: Neville Burnell [mailto:Neville.Burnell-uEDVyssJ3mUpAS55Wn97og@public.gmane.org] > Sent: Mon 8/15/2005 8:59 PM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Cc: > Subject: RE: [Rails] RE: Microsoft SQL Server issue > > > > Ron, > > I can only think of using a brute force approach of searching the > objectspace, like so: > > ar_table = nil > tname = get_table_name(sql) > > ObjectSpace.each_object(ActiveRecord::Base) { |x| ar_table = x if > x.table_name == tname } > options[:order] ||= "#{ar_table.primary_key} ASC" #this will fail if the > table is not found ie, ar_table is nil > > ________________________________ > > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ron DiFrango > Sent: Monday, 15 August 2005 10:50 PM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: RE: [Rails] RE: Microsoft SQL Server issue > > > Neville, I found that out as well. But how do I get a hold of the a > primary key that is not an identity column? > > -----Original Message----- > From: Neville Burnell [mailto:Neville.Burnell-uEDVyssJ3mWXj1p+fO2waQ@public.gmane.orgau] > Sent: Sun 8/14/2005 11:30 PM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Cc: > Subject: RE: [Rails] RE: Microsoft SQL Server issue > > > > I took a deeper look and this will only work if happenstance is > on your > side, ie, that your id column override as per: > > set_primary_key "selection_id" > > Is actually reported as an identity column. > > The problem you face is that the ActiveRecord object > representing your > table isnt anywhere to be seen in the stock SQL Adapter code > which is > only dealing with strings. To use the ''primary_key'' method, > which is the > correct approach, you would first have to find the ActiveRecord > object > for the ''get_table_name(sql)'' > > -----Original Message----- > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of > Neville > Burnell > Sent: Monday, 15 August 2005 1:20 PM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: RE: [Rails] RE: Microsoft SQL Server issue > > Hi Ron, > > I haven''t tried this, but perhaps try: > > ||= "#{get_identity_column(get_table_name(sql))} ASC" > > Neville > > -----Original Message----- > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ron > DiFrango > Sent: Monday, 15 August 2005 12:54 PM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: RE: [Rails] RE: Microsoft SQL Server issue > > Steve/Neville, > > The fix got me closer now. The select looks correct now, but > now it > seems to not be pulling the ID column correctly as it is hard > coded as > follows: > > ||= "id ASC" > > not knowing Ruby or RAILS very well I tried the following to get > the > correct column: > > ||= "#{primary_key} ASC" > > But that was not correct? What is the correct syntax to pull > the > correct primary key column [given that I over rode it] > > > Ron > > > -----Original Message----- > From: Neville Burnell > [mailto:Neville.Burnell-uEDVyssJ3mUpAS55Wn97og@public.gmane.org] > Sent: Sun 8/14/2005 10:11 PM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Cc: > Subject: RE: [Rails] RE: Microsoft SQL Server issue > > > on my system its at: > > > > \ruby\lib\ruby\gems\1.8\gems\activerecord-1.11.1\lib\active_record\conne > ction_adapters\sqlserver_adapter.rb > > _____ > > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ron > DiFrango > Sent: Monday, 15 August 2005 11:19 AM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: RE: [Rails] RE: Microsoft SQL Server issue > > > Steve, > > Where is this code found? Can I fix this myself? > > Ron > > -----Original Message----- > From: Steve Downey > [mailto:sldowney-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org] > Sent: Sun 8/14/2005 1:05 PM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Cc: > Subject: Re: [Rails] RE: Microsoft SQL Server > issue > > > > > C) someone else help me here with the > regex on > SqlServerAdapter#add_limit_offset.307 .. we need to change the > gsub! > match to "match whole word only" on SELECT. ?? > > > Check out the \b anchor: > > /\bSELECT\b/ > > The \b requires that SELECT be preceded and > followed by > a "word boundary", i.e. some character that is not in the "\w" > set. > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >