Nobody has ever encountered this problem before?
On Wed, Nov 19, 2008 at 5:09 PM, John Kopanas <[EMAIL PROTECTED]> wrote:
> More info... the first time when I write to the cache it works
> perfectly fine... the second time around when I am reading from the
> cache the errors start popping up. hmmm...
>
>
> On Wed, Nov 19, 2008 at 5:08 PM, John Kopanas <[EMAIL PROTECTED]> wrote:
>>
>> More info... the first time when I write to the cache it works perfectly
>> fine... the second time around when I am reading from the cache the errors
>> start popping up. hmmm...
>>
>> On Wed, Nov 19, 2008 at 5:02 PM, John Kopanas <[EMAIL PROTECTED]> wrote:
>>>
>>> I have the following:
>>> MODEL:
>>>
>>> def self.get_tag_cloud
>>> Rails.cache.fetch('fetish_tag_cloud', :expires_in => 1.hour) do
>>> find(:all, :conditions => [ "approved_for_tag_cloud = true"], :order
>>> => "LTRIM(name)")
>>> end
>>> end
>>> CONTROLLER:
>>> def index
>>> @fetishes = Fetish.get_tag_cloud
>>> end
>>> VIEW:
>>> ....
>>> <% @fetishes.each do |fetish| -%>
>>> <li><%= link_to fetish.name, "/fetishes/#{fetish.id}", :class =>
>>> "size#{fetish.tag_size}"%></li>
>>> <% end -%>
>>> ....
>>>
>>> I get the following error:
>>> stack level too deep
>>>
>>> /Library/Ruby/Gems/1.8/gems/activerecord-2.1.2/lib/active_record/attribute_methods.rb:244:in
>>> `method_missing'
>>> /Library/Ruby/Gems/1.8/gems/activerecord-2.1.2/lib/active_record/attribute_methods.rb:245:in
>>> `method_missing'
>>> /Library/Ruby/Gems/1.8/gems/activerecord-2.1.2/lib/active_record/base.rb:2163:in
>>> `to_param'
>>> (eval):2:in `fetish_path'
>>> app/views/fetishes/index.html.erb:22:in
>>> `_run_erb_47app47views47fetishes47index46html46erb'
>>> app/views/fetishes/index.html.erb:21:in `each'
>>> app/views/fetishes/index.html.erb:21:in
>>> `_run_erb_47app47views47fetishes47index46html46erb'
>>>
>>> ----
>>> If I do not cache the query it works beautifully... basically when I cache
>>> that query anytime I try to view fetish.id I get a stack level to deep
>>> error... anyone ever get this problem?
>>>
>>>
>>> --
>>> John Kopanas
>>> [EMAIL PROTECTED]
>>>
>>> Blog: http://www.kopanas.com
>>> Conference: http://www.cusec.net
>>> Twits: http://www.twitter.com/kopanas
>>
>>
>>
>> --
>> John Kopanas
>> [EMAIL PROTECTED]
>>
>> Blog: http://www.kopanas.com
>> Conference: http://www.cusec.net
>> Twits: http://www.twitter.com/kopanas
>
>
>
> --
> John Kopanas
> [EMAIL PROTECTED]
>
> Blog: http://www.kopanas.com
> Conference: http://www.cusec.net
> Twits: http://www.twitter.com/kopanas
>
--
John Kopanas
[EMAIL PROTECTED]
Blog: http://www.kopanas.com
Conference: http://www.cusec.net
Twits: http://www.twitter.com/kopanas
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---