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/
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
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
3 matches
Mail list logo