View Single Post
  #1  
Old 11-21-2008, 05:52 AM
Grzegorz Derebecki Grzegorz Derebecki is offline
Senior Member
 
Join Date: Jun 2007
Posts: 92
Default Rails 2.2 cache_classes problem.

Rails 2.2 is almost done. I'm testing rc release and in railties/lib/initializer they add

require_dependency

As far as i remember litespeed lsapi has problem with this. Let me explain:

When we turn on (in production mode) config.cache_classes = true
Then rails 2.2 will load all models, helpers, controllers only once at first start. But it generate strange errors like:

i will show some exemples:
undefined method `limit' for nil:NilClass
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session/active_record_store.rb:73:in `data_column_size_limit'
----------------------------------------------------------------------
undefined method `zero?' for "1":String
[RAILS_ROOT]/app/controllers/movies/home_controller.rb:17:in `index'

movies/home_controller.rb: 17:
@review = current_movie.random_review unless current_movie.reviews_count.zero?

>> Movie.first.reviews_count.class
Fixnum (it is INTEGER in DB then don't know why it is changed to STRING)

----------------------------------------------------------------------
undefined method `all_hashes' for nil:NilClass
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:564:in `select'


----------------------------------------------------------------------

This errors are only if cache_classes = true but without this it is imposible to run rails application fast.

Rails 2.1 and before didn't used require_dependency to load all classes but some time ago i was traing use it and has simillar isuses (errors in strange places) http://litespeedtech.com/support/for...ead.php?t=1712
Reply With Quote