Forum: Ruby on Rails Inconsistency of data in controller and irb

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
D51a24ae1017f53158d70b621494255d?d=identicon&s=25 Bontina Chen (abon)
on 2007-01-23 14:07
I have a find query in a controller like this

def loadtags(product)
    @tags =
  puts @tags.collect{|x|}
  @tags.collect!{|x|}.collect!{|x| Tag.find(x)}
  puts @tags.collect{|x|}
  puts '----------------------------'

and I test with the same parameters in irb

but get different search results.

The one in controller returns  some taggings I already deleted in the
database while it returns the right data while in irb.
I thought there may be some caching undergoing.
So I restarted the app.
But the situation remains.

Any one can solve the mystery here?
Many thanks,
This topic is locked and can not be replied to.