search for: activerecordstore

Displaying 20 results from an estimated 55 matches for "activerecordstore".

2008 May 21
2
Replacing ActiveRecordStore::Session with a custom model
Has anyone managed to replace ActiveRecordStore::Session with their own model? In the source (http://dev.rubyonrails.org/browser/trunk/actionpack/lib/ action_controller/session/active_record_store.rb) it says you can override the default by setting CGI::Session::ActiveRecordStore.session_class = MySessionClass I have tried doing this in a num...
2005 Aug 06
2
Problem with 0.13.1 ActiveRecordStore with PG 8.0.3.
Hi, I put the following in my environment.rb file: ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update (:database_manager => CGI::Session::ActiveRecordStore) Runnning WEBrick via "script/server" and trying to load any page served by a controller results in an error like the following: #<ActiveRecord::StatementInvalid: ERROR: null value in column "id" violates not-null constraint : INSERT INTO session ("id", &quot...
2005 Jan 19
1
Problem with ActiveRecordStore
I''m having an issue using the ActiveRecordStore for sessions with Rails 0.9.4.1. When I setup the session object during login I get the following stack trace: IndexError in Login#auth string not matched /app/controllers/login_controller.rb:26:in `auth'' gems/gems/actionpack-1.3.1/lib/action_controller/base.rb:596:in `send'' g...
2006 Oct 29
1
ActiveRecordStore: Where is the session id generated?
Where can I find the algorithm that generates the session ids for the ActiveRecordStore (sql session)? Thanks, Shimon Amit --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org...
2008 Mar 07
0
ActiveRecordStore: cleanup & avoiding duplication
Hi, I''m using ActiveRecordStore to track user sessions. I''ve used as a base the next sources: - http://blog.levicole.com/articles/category/ror - http://matt-beedle.com/2006/12/13/rails-how-to-find-out-who-is-online/ - http://www.williambharding.com/blog/?p=99 This is what I currently do: IN SESSION CONTROLLER def cre...
2006 May 17
3
Session in ActiveRecordStore
The Agile book seems to say I should specify this as follows, probably in the environments.rb: ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] = CGI::Session::ActiveRecordStore BUT the environments.rb file would have me Un-Comment this: config.action_controller.session_store = :active_record_store Anyway, I''ve tried both, and in both cases it generates new sessions all too quickly, so that no page sees the same session as the page before it. The sessio...
2006 Jun 09
0
How to specify database for ActiveRecordStore?
Hi, Is there a way to specify which database to use (other than the default) for storing sessions via ActiveRecordStore? I have a replication setup in MySQL with my application set to read from the slave db, and don''t want the sessions to be written there. thanks. -michael -- Posted via http://www.ruby-forum.com/.
2006 Mar 13
0
Flash keeping forever when using ActiveRecordStore
Hello, I''m hosting the app on Dreamhost and when I set the session store to ActiveRecordStore (after creating sessions table), Flash is suddenly keeping forever - it is not being cleared out automatically. On Webrick with default session store everything works fine. Any ideas how to solve this? Thanks! -- Posted via http://www.ruby-forum.com/.
2005 Sep 09
0
ActiveRecordStore session.id
Hi, I am using ActiveRecordStore for my sessions. I have another model called PageView that stores a record each time a page is viewed (page_id, session_id). In order to implement this, however, I need to be able to access the session''s primary ''id'' value, the integer, not the long encoded ''se...
2006 Nov 04
0
Session::ActiveRecordStore
Hi, I''m trying to use the ACtiveRecordStore option to accelerate the respone time, since I will a hugo object stored inside the session object. Everything works fine, however, I want to know if the "sessions" table must be set on the default database like pro. test, dev. Or Can I tell rails for the sessions table you should look at...
2006 May 05
5
Sessid.
How can I get the sessid from the current session object? For instance, I log in the system, and want to know which sessid I''m using. I''m storing the session using active_record. Later on, I want to restore a session finding it using the sessid. Thanks in advance. Fernando Lujan
2007 Jun 08
0
problem with rake db:sessions:clear and session_table_name
The comments in: actionpack/lib/action_controller/session/activerecord_store.rb document this method for changing the session table_name: # You may configure the table name, primary key, and data column. # For example, at the end of config/environment.rb: # CGI::Session::ActiveRecordStore::Session.table_name = ''legacy_session_table'' # CGI::Session::ActiveRecordStore::Session.primary_key = ''session_id'' # CGI::Session::ActiveRecordStore::Session.data_column_name = ''legacy_session_data'' I am using this method to set a c...
2008 Dec 25
2
Switching to active_record_store session management errors out
Hello, Running Ruby 1.8.6 and Rails 2.2.2 against an Oracle XE database (sigh). I just upgraded Rails from 1.2.3 to 2.2.2, which made my cookie based system for storing session information to error out due to the 4Kb limit. So, I tried to turn on the active_record_store system by un- commenting out the "config.action_controller.session_store = :active_record_store" line in
2009 Apr 20
11
manual access to session data outside of request?
So, given a sessionID, I have need to read and write the session stored information ''manually'', from _outside_ an actual Rails request/controller. Readers, I know your first response may be to tell me I don''t really want to do that. Trust me though, I really do, it makes sense for me in my case. I know this wouldn''t work if you''re using the new cookie
2008 Mar 14
15
Is anyone running Rails 2.x against a MS SQL Server DB?
I am unable to get ActiveRecord session support to work under 2.x against a SQL Server database. I''m starting to wonder if anyone is running 2.x against SQL Server? Is anyone running under the following configuration: Rails 2.x SQL Server 2000 DB (using AR adapter in ODBC mode) AR store for ActionController session store. I''d like to chat with you if you are. Thanks, Wes --
2006 Jul 29
3
Engines question
I would like to get at all models in a rails application to be able to add a field to every one of them as part of a migration. Something like the following: Appmodels.each { |x| add_column x.table_name.to_s, :foo, :text } I understand I can get the table name using ActiveRecord::Base#table_name, but how do I get all the models into an array that I can use in the above manner? -- Cheers, Hasan
2006 Dec 01
2
ActiveRecord Sessions
...p it lean and mean. I would however like to access my active_record_session from my Rails app. Is this built into merb yet? Or is it OK to just add require ''action_controller/session/ active_record_store'' to merb_init.rb and then create my own session object (CGI::Session::ActiveRecordStore::Session.find_by_session_id (cookies[''_session_id'']))? Thanks a lot. Erik
2009 Oct 17
3
Security problems with CookieStore and CSRF protection
...ted, and replay that session. The obvious fix is to include nonce-checking for every session object to ensure its freshness, but this may require storing nonces in the database, which may go against the point of using CookieStore. Are most users of Rails aware of this problem? How many actually use ActiveRecordStore instead of CookieStore? If the latter is by far the most common mode, then we believe that default should be ActiveRecordStore, as it is much less susceptible to this problem. (Session ids are usually not stateful in a bad way.) 2. The CSRF protection, at least in Rails 2.2.2, seems too weak. Rail...
2006 Jan 05
1
Looping through all models in the application
Hello. I have an application that depends on a table/model (ModelInternationalization) that provides international translations in various languages for all the model/table and columns names as well as some other stuff (whether the column is visible on forms, dropdowns, lists, reports etc). I need to create a management interface for this translation stuff (the plaintext stuff, btw, will be
2006 Aug 08
11
Newb question- method not working
I know this shouldn''t be in the view but to test the code it is. Anyway if I do just session[user] I get back the user id (the id from the user table) which is good. However this code does not work. <% a = session[:user] %> <% uname = User.find(:first, :conditions => id = a) %> <%= @uname %> TIA Stuart