copycat icon indicating copy to clipboard operation
copycat copied to clipboard

Add option to not cache empty values

Open steve9001 opened this issue 13 years ago • 2 comments

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.

steve9001 avatar Sep 17 '12 14:09 steve9001

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

asross avatar Sep 17 '12 18:09 asross

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.

steve9001 avatar Sep 17 '12 18:09 steve9001