search for: find_each_by_sql

Displaying 1 result from an estimated 1 matches for "find_each_by_sql".

2008 Nov 28
1
True ActiveRecord result set iteration
...er adapters can be extended easily, too. We also tried JRuby 1.1.x, which is sometimes faster than Ruby 1.8.6, but a patch is needed to bring the Java part of the connection adapter into shape for a result set iteration. Okay, you''re about to ask: how does it work. Here we go: MyTable.find_each_by_sql("some SQL here") { |my_table| ... } MyTable.find_each(:all, :conditions => ..., :include => ...) { |my_table| ... } Attached you find the magic code which can be used as a plugin for Rails. When testing, please keep in mind that only Oracle and MySQL is fully supported. JDBC...