#24 new
Gaël SECHAUD

Rails compatibility issue (regression error)

Reported by Gaël SECHAUD | May 27th, 2009 @ 09:28 AM

When using a string instead of its symbol for comparison, the comportement of ar-extensions is different : it raises an error (as "nil" value isn't pushed) if a string is used.

Example

Testing
=>Testing(id: integer, name: string, parent_id: integer, lft: integer, rgt: integer) Testing.find(:all, :conditions => {:name=>nil})
=> [] Testing.find(:all, :conditions => {"name"=>nil})
ActiveRecord::PreparedStatementInvalid: wrong number of bind variables (0 for 1) in: testings.name is ?
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2399:in raise_if_bind_arity_mismatch' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2351:inreplace_bind_variables' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2342:in sanitize_sql_array' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2235:insanitize_sql_orig' from /home/my_application/vendor/plugins/ar-extensions/ar-extensions/lib/ar-extensions/finders.rb:37:in sanitize_sql' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1499:inmerge_conditions' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1497:in each' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1497:inmerge_conditions' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1809:in add_conditions!' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1692:inconstruct_finder_sql' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1553:in find_every' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:615:infind_without_default_options' from /home/my_application/vendor/plugins/my_extensions/lib/default_finder.rb:22:in find' from (irb):15 from :0

Comments and changes to this ticket

  • Simple Jack

    Simple Jack September 13th, 2020 @ 07:06 AM

    I don't know what these codes are about. I didn't even know why I am here in this forum. All I know is I love to play gacha life lunime on my PC. It is an anime themed life simulator game, you can dress up your character the way you want, you can even chat with other players around the world if you reached a certain level. Also, I know how to get pokemon go on pc. You can get it using the link I provided.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

ActiveRecord::Extension (aka ar-extensions) is a plugin to extend and
enhance the functionality of ActiveRecord. It starts by adding better
find support for ActiveRecord. It then adds mass data import
capabilities which are highly efficient and lastly it supports to_csv
functionality.

It also introduces a cool concept of creating easily extendable pieces
of ActiveRecord functionality, so developers don't have to understand
ActiveRecord internals or have the fear of breaking ActiveRecord
itself.

People watching this ticket

Pages