On 29 April 2011 22:40, David Mr. <[email protected]> wrote: > Colin Law wrote in post #995808: >> On 29 April 2011 17:15, David Mr. <[email protected]> wrote: >>> >>> Just to see if that was the cause of another error. Here is the error >>> that happens when it is not commented out: >>> >>> NoMethodError in SearchesController#create >>> >>> undefined method `each' for true:TrueClass >>> >>> /home/brad/Documents/blogazer/app/models/search.rb:201:in >>> `set_from_sources' >>> /home/brad/Documents/blogazer/app/models/search.rb:107:in `execute' >> >> I think you need to look at the line above in search.rb. It suggests >> you are calling each for something that is not a collection but has >> the value true. >> >> Colin > > Hmmm... > Here is the code from around line 201 in search.rb: > > def set_from_sources(sources) > final = Set.new > sources.each do |source|
The error suggests that sources is not a collection > p = Page.find_by_id source > h = YAML.load(p.data) > final.merge h.keys > end > final > end > > Here is line 107 in search.rb: > gamma[:D] = set_from_sources(gamma[:C]) - (txv[:a] + txv[:b]) So gamma[:C] is not a collection. Have a look at the Rails Guide on debugging and find how to use ruby-debug to break into your code so you can examine gamma. Colin -- 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.

