aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/import/README.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/import/README.md b/doc/import/README.md
index 92108a3..50ef74b 100644
--- a/doc/import/README.md
+++ b/doc/import/README.md
@@ -66,3 +66,22 @@ end
```
It's taken into account in `rails db:seed`
+
+
+### Cleaning up records
+
+Some records need cleanup...
+
+#### Category names
+
+Remove prepended numbers from names:
+`Category.all.each { |c| c.update(name: c.name.sub(/^\d. /,'')) if c.name =~ /^\d/ }`
+
+#### Category colors
+
+Match category rank with style color:
+```ruby
+cat_colors = ['#BCBCBC', '#95a5a6', '#848482', '#948279', '#59706a', '#16a085', '#27ae60', '#2980b9', '#34495e', '#bd3525', '#d35400', '#eead0e']
+
+Category.all.each { |c| c.update!(color: cat_colors.shift) }
+```