Vermonster / copycat

Copycat is a Rails engine that allows editing live website copy using existing i18n view helpers
MIT License
44 stars 19 forks source link

Add option to not cache empty values #15

Open steve9001 opened 12 years ago

steve9001 commented 12 years ago

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 commented 12 years ago

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

steve9001 commented 12 years ago

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.