#111 ✓resolved
mayoral

ActiveRecord session store not creating new records with Thin 1.2.4 and Rails 2.2.2

Reported by mayoral | 2009-09-07 04:41:49 UTC | in Future

When updated to Thin 1.2.4, session store stops creating new session records in the database in an app with Rails 2.2.2. If i revert to Thin 1.2.2 the app starts again to record sessions in the database.

Another app with almost the same code and Rails 2.3.4 seems not to be afected by this behaviour in Thin 1.2.4.

Comments and changes to this ticket

  • macournoyer

    macournoyer 2009-09-07 16:19:14 UTC

    Is there any error in Rails log or thin.log ?

  • macournoyer

    macournoyer 2009-09-10 10:19:52 UTC

    • State changed from “new” to “open”

    I cannot reproduce, can you post your environment.rb or the where your configure the session store (don't forget to hide the secret key).

    Are you using Ruby 1.8.7?

    What changed in 1.2.4 is that Thin now uses Rails Rack base interface if available. Maybe that is causing the issue.

  • macournoyer

    macournoyer 2009-09-10 10:53:45 UTC

    Ah! 2.2.2 IS rack based, I guess it's broken or was not complete. I'll try to refine the logic to check when to use the Rack-base interface: http://github.com/macournoyer/thin/blob/66bd68c2faccad3e5d5b5de48e2...

  • macournoyer

    macournoyer 2009-10-07 20:41:06 UTC

    Can you try w/ this patch and let me know if it fixes it?
    I tested w/ Rails 2.3.2 and it worked.

    diff --git a/lib/rack/adapter/rails.rb b/lib/rack/adapter/rails.rb
    index 8e5fd81..24c3c06 100644
    --- a/lib/rack/adapter/rails.rb
    +++ b/lib/rack/adapter/rails.rb
    @@ -32,9 +32,7 @@ module Rack
           end
           
           def rack_based?
    -        ActionController.const_defined?(:Dispatcher) &&
    -          (ActionController::Dispatcher.instance_methods.include?(:call) ||
    -           ActionController::Dispatcher.instance_methods.include?("call"))
    +        Rails::VERSION::MAJOR >= 2 && Rails::VERSION::MINOR >= 3 && Rails::VERSION::TINY >= 2
           end
           
           def load_application
    
  • macournoyer

    macournoyer 2009-10-08 08:00:05 UTC

    Oops, this one should work for real now:

    diff --git a/lib/rack/adapter/rails.rb b/lib/rack/adapter/rails.rb
    index 8e5fd81..24c3c06 100644
    --- a/lib/rack/adapter/rails.rb
    +++ b/lib/rack/adapter/rails.rb
    @@ -32,9 +32,7 @@ module Rack
           end
           
           def rack_based?
    -        ActionController.const_defined?(:Dispatcher) &&
    -          (ActionController::Dispatcher.instance_methods.include?(:call) ||
    -           ActionController::Dispatcher.instance_methods.include?("call"))
    +        ::Rails::VERSION::MAJOR >= 2 && ::Rails::VERSION::MINOR >= 3 && ::Rails::VERSION::TINY >= 2
           end
           
           def load_application
    
  • macournoyer

    macournoyer 2009-10-13 22:26:47 UTC

    • State changed from “open” to “resolved”

    (from [b16e72ff779d9c077d24462666d4a5487449627c]) Ensure Rack base API is used in Rails adapter only if version >= 2.3.2 [#111 state:resolved] http://github.com/macournoyer/thin/commit/b16e72ff779d9c077d2446266...

  • macournoyer

    macournoyer 2009-11-05 09:54:35 UTC

    This should be fixed in version 1.2.5 deployed yesterday on gemcutter.org

  • John

    John 2024-04-09 11:00:11 UTC

    Onestamente, sono pochi i casinò che offrono grandi bonus. Se dai un'occhiata al Winnita Casinò casinò ti assicurerai che è qualcosa che può aiutarti a smettere di fare il lavoro che odi. Se vuoi lasciare il tuo lavoro e guadagnarti da vivere giocando al casinò, è la scelta https://winnitacasino-it.com/ migliore!

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Referenced by

Pages