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

Add option to not cache empty values #15

Open
steve9001 opened this issue Sep 17, 2012 · 2 comments · May be fixed by #17
Open

Add option to not cache empty values #15

steve9001 opened this issue Sep 17, 2012 · 2 comments · May be fixed by #17

Comments

@steve9001
Copy link
Member

Currently, the first time a key is looked up by copycat, and it doesn't find the key in the DB, it cascades the lookup to Rails (en.yml), and then always creates a new entry in the DB for that key with whatever value was in the yml. If there was no value it still creates a key with a blank value. That means if somebody later adds a value to the yml it will not make it to the copycat table because subsequent lookups will find the key in the db and never cascade to the yml lookup.

Add a configuration option to not cache keys with no values. That way if a developer adds the key to the template and renders the page before writing the value in en.yml, it won't prevent them from seeding the values later when they add values to the yml.

@asross
Copy link
Collaborator

asross commented Sep 17, 2012

I like this idea. Should be quite easy to implement... just another check on line 9 of lib/copycat/implementation.rb, right?

@steve9001
Copy link
Member Author

Also need to add the configuration option in lib/copycat.rb.

On Sep 17, 2012, at 2:30 PM, andrew-ross wrote:

I like this idea. Should be quite easy to implement... just another check on line 9 of lib/copycat/implementation.rb, right?


Reply to this email directly or view it on GitHub.

@rousisk rousisk linked a pull request Feb 15, 2013 that will close this issue
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.

2 participants