This project is archived and is in readonly mode.
Small generator issue for generator in config/initializers/session_store.rb (Rails 3.0.0.rc2)
-
Rohit Arondekar
- Assigned user set to José Valim
- Importance changed from to Low
This looks very similar to #5207 rake rails:update replaces application name
Assigning to Jose, since he knew how to fix that issue.
-
Neeraj Singh
- State changed from new to open
- Tag changed from rails:update generator session_store.rb to rails 3, rails:update generator session_store.rb, patch
Attached is code patch.
-
José Valim
Nice Neeraj! Can you try to add a test case? You can reproduce the rake test calls inside app_generator_test.rb!
-
Marjan Krekoten'
I attached patch that fixes this issue. And also added test for it.
-
Marjan Krekoten'
Oops... I missed that there is a patch already :)
-
José Valim
Krekoten, thanks for the patch! Your fix looks good however the test needs to be improved. It relies to heavily on stubs, meaning that minor changes in Thor or Rails can make it fail, even when it should not. Could you please try to provide a test that does not use stubs/mocks?
-
Marjan Krekoten'
Sure, I'll try.
-
Marjan Krekoten'
Well, I didn't find better way. We need that stubs to execute generator with already initialized app or it will not fail.
-
Fred Wu
Hey guys,
Since I was the one who submitted the app_name fix, here's my patch for it. I've improved the tests a bit also.
-
Repository
- State changed from open to resolved
(from [83f4507cf153ea6081dd70326f5f3a0331cc167e]) Fixed the session name generated by the app_generator. Also refactored the corresponding test suites to be cleaner. [#5434 Small generator issue for generator in config/initializers/session_store.rb ... state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/83f4507cf153ea6081dd70326f5f3a... -
Repository
(from [3edd3d052efc6d39345aaa3258109ec2fc92baa4]) Fixed the session name generated by the app_generator. Also refactored the corresponding test suites to be cleaner. [#5434 Small generator issue for generator in config/initializers/session_store.rb ... state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/3edd3d052efc6d39345aaa3258109e... -
Willem van Bergen
The new generator uses the directory name to create the session key prefix, instead of the application name. So, when I fork "MyApp" in a directory called "their_app", this is what I'll get.
MyApp::Application.config.session_store :cookie_store, :key => '_their_app_session'I think it should generate:
MyApp::Application.config.session_store :cookie_store, :key => '_my_app_session'Sorry for nitpicking guys! :)
-
Fred Wu
Good catch Willem.
Here's the patch for it.
-
Marjan Krekoten'
:) last patch almost identical to mine just said in other words...
-
Fred Wu
Ah it appears so. :D
@José: Any change to include either the patch in 3.0.1?
-
José Valim
- State changed from resolved to open
-
Repository
- State changed from open to resolved
(from [51e8435e346c3f2f6356342b661231fcaeaa357a]) Ensures the app generator generates the correct @app_name. [#5434 Small generator issue for generator in config/initializers/session_store.rb ... state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/51e8435e346c3f2f6356342b661231... -
Repository
(from [b0f059136bf9f99095738c5a1f4b57ed927771cd]) Ensures the app generator generates the correct @app_name. [#5434 Small generator issue for generator in config/initializers/session_store.rb ... state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/b0f059136bf9f99095738c5a1f4b57...
