Displaying 20 results from an estimated 1200 matches similar to: "Problem with ActiveRecordStore"
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 create
self.current_user = User.authenticate(params[:login],
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"
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 number of ways but I get all kinds of
weird errors, as
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
To
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 "This" database, instead of the
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 ''session_key''. My problem is that I can''t access
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
2005 Feb 24
9
[0.10.0] Update problem
Upgrading to rails 0.10.0 leads to the following:
-----
=> Rails application started on http://0.0.0.0:3002
[2005-02-24 16:45:35] INFO WEBrick 1.3.1
[2005-02-24 16:45:35] INFO ruby 1.8.2 (2004-12-25) [powerpc-darwin7.7.0]
[2005-02-24 16:45:35] WARN TCPServer Error: Address already in use -
bind(2)
[2005-02-24 16:45:35] INFO WEBrick::HTTPServer#start: pid=936 port=3002
#<NameError:
2007 Aug 06
4
problem with rails_root
Hi everybody,
I used a openseradmin who is based on rubygem (i suppose ), so when i
start my server of this openseradmin in the http://localhost:3000, i
reciceved some messages like this:
SocketError in LoginController#login
getaddrinfo: Name or service not known
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace
2008 Feb 04
1
Error on nil.build
I can''t figure out why I am getting an error for one of the tests below:
========================
describe AccountsController, "POST" do
before :each do
@user = mock_model(User)
@account = mock_model(Account, :id => 1, :valid => true, :save =>
true, :users => mock("users", :build => @user))
Account.should_receive(:new).and_return(@account)
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''
#
2008 Apr 23
0
How i write the respec in this situation??
Hi all guys!im new in rails!
i have a forum,have_many topics,and the topic also has_many
replies.Now i want to write the respec for the repliescontroller:
describe RepliesController do
controller_name :repies
describe "All Requests",:share=>true do
before do
@forum = mock_model(Forum,:id=>''1'')
@topic =
2007 Jul 12
3
Agh, this is annoying. Why is this happening?
My problem:
Mock ''Task_1005'' received unexpected message :user_id= with (1)
No matter what I do to try to stub that out it will still fail out and give
me that message.
Here is my spec
describe TasksController, "handling POST /tasks" do
before(:each) do
@task = mock_model(Task, :to_param => "1", :save => true)
2007 Aug 21
2
using restful_authentication current_user inside controller specs
I''m using restful_authentication in my app and I have the before filters in
my application rhtml:
before_filter :login_required
around_filter :set_timezone
around_filter :catch_errors
Currently I have them commented out while rspec''in but I''ll need to add them
in my specs.
def create
@ticket = Ticket.new(params[:ticket])
@ticket.user = current_user
if
2005 Jun 01
3
Mixing Controllers
I have a login section that is part of my view from my sign_up
controller. Validating my user happens through a login_controller.
Now if validation is good it is ok because I have a redirect in my
login_controller. But if the login is not successful I have to go
back to my view from my sign_up controller. Using redirect makes no
sense because my @user_login object is lost and so are
2011 Dec 02
2
problem setting expectation for test with delayed::job
I''ve got something like this:
# post_observer.rb
after_create
# ...stuff
Delayed::Job.enqueue(PostSharer.new(post, post.user))
end
...
# post_sharer.rb
class PostSharer < Struct.new(:post, user)
def perform
# Delayed::Job calls .perform on the object passed into enqueue
end
end
# post_controller_spec.rb
it "shares the post" do
2006 Apr 06
9
How to get Form values in RubyOnRails
Hi
I want the FORM values on my controller.i.e. I want the values of login_loginname(Form variable) and login_password(Form variable) on login_controller.rb
How can i do that?
Table Name is: logins
Model:: Login.rb
Controller:: login_controller.rb
Below is my test form
loginname
password
Hoping for reply
Regards
Parikshit
2007 Jan 30
5
errors while testing resource controller using rpec
I am testing a resource called venue in this piece of code (generated
using script/rspec_resource)
====================
context "Requesting /venues using POST" do
controller_name :venues
setup do
@mock_venue = mock(''Venue'')
@mock_venue.stub!(:save).and_return(true)
@mock_venue.stub!(:to_param).and_return(1)
Venue.stub!(:new).and_return(@mock_venue)