[Rails] Re: find_by_sql - ActiveRecord - Help please.

2012-11-07 Thread 7stud --
Another example: data = Array.new(10, nil) p data --output:-- [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil] p data.size --output:-- 10 puts data[0].province --output:-- 1.rb:4:in `': undefined method `province' for nil:NilClass (NoMethodError) -- Posted via http://www.ruby-forum.com/

Re: [Rails] Re: find_by_sql - ActiveRecord - Help please.

2012-11-07 Thread Colin Law
On 7 November 2012 22:06, Jeff Lockyer wrote: > Hi Colin, > > This is old code (Rails v 1.1.6 - Ruby 1.8.5) that I am working with, > and don't want to migrate it too to current version because it is not > long term. > > The code is almost exactly as cited above, just have the column names > remov

[Rails] Re: find_by_sql - ActiveRecord - Help please.

2012-11-07 Thread Jeff Lockyer
Hi Colin, This is old code (Rails v 1.1.6 - Ruby 1.8.5) that I am working with, and don't want to migrate it too to current version because it is not long term. The code is almost exactly as cited above, just have the column names removed. The error code tells me that NoMethodError (undefined