Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does SessionStore work? #56

Closed
adamgotterer opened this issue Nov 1, 2013 · 7 comments
Closed

How does SessionStore work? #56

adamgotterer opened this issue Nov 1, 2013 · 7 comments

Comments

@adamgotterer
Copy link

Trying to set the Rails session store to use Sequel.

App::Application.config.session_store SequelRails::SessionStore

That raises an error saying the class isn't found.

@JonathanTron
Copy link
Member

Hi @adamgotterer, I must confess the SessionStore didn't received much love.

I don't use it myself and no one reported problem previously, thanks for being the first!

Can you try to require the file before setting it as session_store:

require "sequel_rails/session_store"
App::Application.config.session_store SequelRails::SessionStore

@JonathanTron
Copy link
Member

Following the issue, I've added a generator for the session table:

rails g session_migration

I've also added autoloading for SequelRails::SessionStore so that you should not have to require it explicitly anymore.

It would be great if you can test those changes and tell me if they work for you.

@adamgotterer
Copy link
Author

It appears explicitly loading it worked in version 0.7. Thanks!

@JonathanTron
Copy link
Member

Great, thanks for your report.

@adamgotterer
Copy link
Author

While I didn't have an issues including the SessionStore files, I'm finally just running the actual session code for the first time. I'm still investigating, but I just ran into this error:

ArgumentError (wrong number of arguments (4 for 3)):
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/sequel-rails-0.6.1/lib/sequel_rails/session_store.rb:57:in `set_session'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:327:in `commit_session'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:211:in `context'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/cookies.rb:341:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:405:in `_run__960788589609884541__call__4196380997044594967__callbacks'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:405:in `__run_callback'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:81:in `run_callbacks'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/reloader.rb:65:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bugsnag-1.5.2/lib/bugsnag/rack.rb:36:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/better_errors-1.0.1/lib/better_errors/middleware.rb:58:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/railties-3.2.14/lib/rails/rack/logger.rb:32:in `call_app'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/railties-3.2.14/lib/rails/rack/logger.rb:18:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/request_id.rb:22:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/activesupport-3.2.14/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/static.rb:63:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/railties-3.2.14/lib/rails/engine.rb:484:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/railties-3.2.14/lib/rails/application.rb:231:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/railties-3.2.14/lib/rails/railtie/configurable.rb:30:in `method_missing'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/lint.rb:48:in `_call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/lint.rb:36:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/showexceptions.rb:24:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/commonlogger.rb:33:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/sinatra-1.4.3/lib/sinatra/base.rb:212:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/chunked.rb:43:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:552:in `process_client'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:632:in `worker_loop'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:142:in `start'
  /home.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/unicorn-4.6.3/bin/unicorn:126:in `<top (required)>'
  /home.rbenv/versions/1.9.3-p392/bin/unicorn:23:in `load'
  /home.rbenv/versions/1.9.3-p392/bin/unicorn:23:in `<main>'

@JonathanTron
Copy link
Member

Hello @adamgotterer,

can you try to update to at least 0.7.0?

@JonathanTron JonathanTron reopened this Nov 12, 2013
@JonathanTron
Copy link
Member

I'm checking and it looks like the signature of the methods changed since this class was created, I will update them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants