[Future iteration] => Allow seed-wide variables
Problem
There could reside a lot of duplication in seeding.
Given this seed file ...
---
group_labels:
- title: Label 1
color: "#FF0000"
- title: Label 2
color: "#FF0000"
- title: Label 3
color: "#FF0000"
- title: Label 4
color: "#FF0000"
- title: Label 5
color: "#FF0000"
- title: Label 7
color: "#FF0000"
- title: Label 7
color: "#FF0000"
- title: Label 8
color: "#FF0000"
- title: Label 9
color: "#FF0000"
- title: Label 10
color: "#FF0000"
Each label has duplicated content (namely, the color). If this color ever changes, each line will need to be changed.
Proposal
To encourage de-duplication, provide a way to specify variables that can be referenced anywhere in a seed file.
---
_label_color: "#FF0000"
group_labels:
- name: Label 1
color: <%= _label_color %>
- name: Label 2
color: <%= _label_color %>
- name: Label 3
color: <%= _label_color %>
- name: Label 4
color: <%= _label_color %>
- name: Label 5
color: <%= _label_color %>
- name: Label 6
color: <%= _label_color %>
- name: Label 7
color: <%= _label_color %>
- name: Label 8
color: <%= _label_color %>
- name: Label 9
color: <%= _label_color %>
- name: Label 10
color: <%= _label_color %>
Edited by Dan Davison