On Sat, Jun 30, 2012 at 4:17 PM, Felipe Pieretti Umpierre
<[email protected]> wrote:
> irb(main):001:0> task = Task.all
Model.all is clearly intended to return multiple results; it would be
more appropriate to say `tasks = Task.all`
> irb(main):002:0> task.project
> NoMethodError: undefined method `project' for #<Array:0x482b068>
in which case you would be calling e.g.
tasks.first.project
or
tasks.each{ |task| puts task.project.inspect }
or whatever
--
Hassan Schroeder ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en-US.