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

Cannot pass options to cache_store memory_store #38532

Closed
kritik opened this issue Feb 20, 2020 · 9 comments
Closed

Cannot pass options to cache_store memory_store #38532

kritik opened this issue Feb 20, 2020 · 9 comments

Comments

@kritik
Copy link

kritik commented Feb 20, 2020

Steps to reproduce

1.In Gemile gem 'rails', git: 'https://github.com/rails/rails.git', branch: '6-0-stable'
2. in development.rb config.cache_store = :memory_store, { size: 64.megabytes } as proposed in guides.
3. rails s

Seems that this commit sends several params to cache store. But MemoryStore is not updated to receive more params https://github.com/rails/rails/blob/master/activesupport/lib/active_support/cache/memory_store.rb#L21

Expected behavior

Rails should be started

Actual behavior

/memory_store.rb:21:in `initialize': wrong number of arguments (given 2, expected 0..1) (ArgumentError)

System configuration

Rails version: 6.0.2.1 eef309e

Ruby version:
ruby -v
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]

Last lines

	 6: from /Users/Vladimir/.rvm/gems/ruby-2.6.0@shoperb/bundler/gems/rails-eef309eb6dda/railties/lib/rails/initializable.rb:61:in `block in run_initializers'
	 5: from /Users/Vladimir/.rvm/gems/ruby-2.6.0@shoperb/bundler/gems/rails-eef309eb6dda/railties/lib/rails/initializable.rb:32:in `run'
	 4: from /Users/Vladimir/.rvm/gems/ruby-2.6.0@shoperb/bundler/gems/rails-eef309eb6dda/railties/lib/rails/initializable.rb:32:in `instance_exec'
	 3: from /Users/Vladimir/.rvm/gems/ruby-2.6.0@shoperb/bundler/gems/rails-eef309eb6dda/railties/lib/rails/application/bootstrap.rb:59:in `block in <module:Bootstrap>'
	 2: from /Users/Vladimir/.rvm/gems/ruby-2.6.0@shoperb/bundler/gems/rails-eef309eb6dda/activesupport/lib/active_support/cache.rb:60:in `lookup_store'
	 1: from /Users/Vladimir/.rvm/gems/ruby-2.6.0@shoperb/bundler/gems/rails-eef309eb6dda/activesupport/lib/active_support/cache.rb:60:in `new'
/Users/Vladimir/.rvm/gems/ruby-2.6.0@shoperb/bundler/gems/rails-eef309eb6dda/activesupport/lib/active_support/cache/memory_store.rb:21:in `initialize': wrong number of arguments (given 2, expected 0..1) (ArgumentError)
@hahmed
Copy link
Contributor

hahmed commented Feb 21, 2020

@kritik mind posting an app that reproduces this error please?

@kritik
Copy link
Author

kritik commented Feb 22, 2020

@hahmed do you want zip file or repo?

@hahmed
Copy link
Contributor

hahmed commented Feb 22, 2020

@kritik if you can post a link to a Github repo that would be nice, once the issue is replicated, I can have a look into the issue 👍🏼

@kritik
Copy link
Author

kritik commented Feb 23, 2020

@hahmed, will do but @eugeneius patch seems to be working

@kritik
Copy link
Author

kritik commented Feb 23, 2020

@hahmed
Copy link
Contributor

hahmed commented Feb 24, 2020

@kritik thanks for reproducing the issue, can you check your repo against master please? I believe the issue has been fixed in fa986ae

@kritik
Copy link
Author

kritik commented Feb 24, 2020

@hahmed Yes, you're right. It works! So, stable is not so stable? :) Seems this ticket and pull request are unnecessary anymore, however I would put that commit to stable branch as well.

@hahmed
Copy link
Contributor

hahmed commented Feb 24, 2020

Glad we could get to the bottom of the issue!

however I would put that commit to stable branch as well.

No idea what the convention is on that, will leave to the rails team to comment on that.

kamipo added a commit that referenced this issue Feb 24, 2020
This fixes a regression #38532 caused by f9633cd.

Closes #38532.
@kamipo
Copy link
Member

kamipo commented Feb 24, 2020

Backported fa986ae to 6-0-stable 5813aac.

@kamipo kamipo closed this as completed Feb 24, 2020
kamipo referenced this issue Mar 24, 2020
I think allowing nested array parameters is almost useless.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants