markbates / markbates/cachetastic
If mongoid isn't installed, cachetastic dies even if mongoid adapter isn't in use
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 18
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Great work on cachetastic!
I just want to use a simple memory cache, but as of now, I have to install mongoid as well, because cachetastic dies with this stacktrace:
/Users/trhodes/.rvm/gems/ruby-1.9.3-p385@ha-glue/gems/cachetastic-3.7.0/lib/cachetastic/adapters/mongoid.rb:6:in `<class:Store>': uninitialized constant Mongoid (NameError)
from /Users/trhodes/.rvm/gems/ruby-1.9.3-p385@ha-glue/gems/cachetastic-3.7.0/lib/cachetastic/adapters/mongoid.rb:5:in `<class:Mongoid>'
from /Users/trhodes/.rvm/gems/ruby-1.9.3-p385@ha-glue/gems/cachetastic-3.7.0/lib/cachetastic/adapters/mongoid.rb:3:in `<module:Adapters>'
from /Users/trhodes/.rvm/gems/ruby-1.9.3-p385@ha-glue/gems/cachetastic-3.7.0/lib/cachetastic/adapters/mongoid.rb:2:in `<module:Cachetastic>'
from /Users/trhodes/.rvm/gems/ruby-1.9.3-p385@ha-glue/gems/cachetastic-3.7.0/lib/cachetastic/adapters/mongoid.rb:1:in `<top (required)>'
from /Users/trhodes/.rvm/gems/ruby-1.9.3-p385@ha-glue/gems/cachetastic-3.7.0/lib/cachetastic.rb:29:in `require'
from /Users/trhodes/.rvm/gems/ruby-1.9.3-p385@ha-glue/gems/cachetastic-3.7.0/lib/cachetastic.rb:29:in `block in <top (required)>'
from /Users/trhodes/.rvm/gems/ruby-1.9.3-p385@ha-glue/gems/cachetastic-3.7.0/lib/cachetastic.rb:28:in `each'
from /Users/trhodes/.rvm/gems/ruby-1.9.3-p385@ha-glue/gems/cachetastic-3.7.0/lib/cachetastic.rb:28:in `<top (required)>'
...
Mongoid 3 support is unavailable. To use Mongoid 3 do `gem install mongoid`
...
Looks like it could be fixed by adding an if defined?(::Mongoid) with an else body overriding method_missing to do nothing. Not a ruby pro, so don't know if that is the "Right Way (tm)".
I was going to write it up myself, but when I got to testing, a lot of other tests fail. Some from servers not being up, some for other reasons.
Thanks! Let me know if you need any more info!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/cachetastic.rb and the required adapter files, especially lib/cachetastic/adapters/mongoid.rb, then reproduce loading the memory cache without Mongoid installed. Review the existing test suite and its reported failures. Done means Cachetastic can use the memory adapter without requiring Mongoid, with relevant tests covering that case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100