santana / activerecord-informix-adapter

ActiveRecord adapter for Informix
http://rails-informix.rubyforge.org
11 stars 7 forks source link

Compatibility with Recent Versions of ActiveRecord #4

Open PriceHardman opened 11 years ago

PriceHardman commented 11 years ago

Hi there,

I've been trying to use activerecord-informix-adapter with the most current version of ActiveRecord (3.2.13), and it appears that changes made to the structure of ActiveRecord in recent versions are at odds with activerecord-informix-adapter. Specifically, I've noticed ArgumentError incompatibilities with database statements.

For instance, Screenshot from 2013-03-19 11:52:19

At left is the source for ActiveRecord 3.2.13's database statements (select_all, select_one, etc). Notice the number of arguments for select_all (on line 17): def select_all(arel,name = nil, binds = []) #3 arguments

Whereas activerecord-informix-adapter's version of select_all (at right on line 149) takes two arguments: def select_all(sql, name= nil)

I don't know enough about the inner workings of either Informix or ActiveRecord to suggest a fix for this, but perhaps it would be worth noting in the readme the version after which this incompatibility begins?

I'll try to look into this further and possibly submit a pull request. Thanks!

Price H.

PriceHardman commented 11 years ago

It looks like the syntax for the select_all statement (i.e. the introduction of binds, and the transition from 2 to 3 arguments, began with ActiveRecord version 3.1 stable). Versions before that appear to be compatible.

santana commented 11 years ago

Hi,

indeed, there have been a lot of changes in Rails that activerecord-informix-adapter is unusuable as it is right now.

Sadly I'm not using Informix any more. Feel free to make it work or fork it.

PriceHardman commented 11 years ago

Hi Gerardo,

I actually found that a different Ruby ORM (Sequel) comes prepackaged with an Informix adapter (which relies on your ruby-informix gem) and works great. Sequel's odbc adapter also works for connecting to Informix databases.

Thanks for the work you've put in over the years on trying to make Ruby and Informix play nice. Cheers!