Question: Any chance the 2nd and 3rd lines can be combined in an one-liner and hopefully save one valuable?

```
def self.date_format
  record = find_by_key('strftime')
  record ? record.value : "%Y-%b-%d'
end

```

the above function in a `Config` model try to fetch a database record by a key, return a default if not found in database. 

Even better if can be written in named scope. Thanks

Answer: 
As requested.

Nobody yet has mentioned [try](http://guides.rubyonrails.org/2_3_release_notes.html#objecttry), which is perfect for this situation:

`value = find_by_key('strftime').try(:value) || "%Y-%b-%d"`
Does

```
value = find_by_key('strftime') || "%Y-%b-%d"

```

work for you?