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

Expand Padrino::Cache to support all features of underlying cache #836

Merged
merged 6 commits into from Apr 30, 2012
Merged

Expand Padrino::Cache to support all features of underlying cache #836

merged 6 commits into from Apr 30, 2012

Conversation

icco
Copy link
Contributor

@icco icco commented Apr 25, 2012

This adds a catch all for the Redis caching class, so if you use a function in Redis (such as sets) that is not supported by Padrino, it is passed on to the base class.

I could modify this to be a little more generic, I'm just looking for a little direction.

I was thinking of adding essentially a catch all for the cache class, that could be turned on or off in the settings.

Yay? Nay?

@nesquena
Copy link
Member

I think this is a decent idea. Can you add a test just making sure this functionality works? Also can you change it to only pass through if the backend supports the method call (and add parenthesis to the method definition):

def method_missing(name, *args, &block)
  if @backend.respond_to?(name)
    @backend.send(*args)
  else
    super
  end
end

@icco
Copy link
Contributor Author

icco commented Apr 28, 2012

Cool. Test added and tweaked the function as suggested. Also synced with master.

@nesquena
Copy link
Member

Does this look good to you guys, affords a bit more flexibility @DAddYE

@DAddYE
Copy link
Member

DAddYE commented Apr 30, 2012

I like it!!!

DAddYE added a commit that referenced this pull request Apr 30, 2012
Expand Padrino::Cache to support all features of underlying cache
@DAddYE DAddYE merged commit 7832933 into padrino:master Apr 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants