I have a query I am running from the console that is eager loading the
address on the people model:
people = People.find(:all,
:include => [:address],
:limit => 50)
Trying to output that to yaml via:
people.to_yaml
Produces the following exception:
TypeError: wrong argument type nil (expected Data)
from /usr/local/lib/ruby/1.8/yaml.rb:387:in emit' from /usr/local/lib/ruby/1.8/yaml.rb:387:inquick_emit’
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:107:in `to_yaml’
from (irb):10
I don’t see any nil data in the include… thoughts?
I’ve been trying to find the root of this for a few days now and its
getting a little frustrating. I’ve tried to re-open the class and do the
following (because I noticed the error doesn’t occur when I clone the
object and then call to_yaml).
Scott wrote:
I have a query I am running from the console that is eager loading the
address on the people model:
people = People.find(:all,
:include => [:address],
:limit => 50)
Trying to output that to yaml via:
people.to_yaml
Produces the following exception:
TypeError: wrong argument type nil (expected Data)
from /usr/local/lib/ruby/1.8/yaml.rb:387:in emit' from /usr/local/lib/ruby/1.8/yaml.rb:387:inquick_emit’
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:107:in `to_yaml’
from (irb):10
I don’t see any nil data in the include… thoughts?
Thanks,
Scott
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.