lib/beerdb/models/beer.rb in beerdb-0.6.14 vs lib/beerdb/models/beer.rb in beerdb-0.6.15
- old
+ new
@@ -53,10 +53,14 @@
## fix: add/configure logger for ActiveRecord!!!
logger = LogKernel::Logger.root
value_tag_keys = []
-
+
+ ## check for grades (e.g. ***/**/*) in titles (will add new_attributes[:grade] to hash)
+ ## if grade missing; set default to 4; lets us update overwrite 1,2,3 values on update
+ new_attributes[ :grade ] ||= 4
+
### check for "default" tags - that is, if present new_attributes[:tags] remove from hash
if new_attributes[:tags].present?
more_tag_keys = new_attributes[:tags].split('|')
new_attributes.delete(:tags)