Skip to content

Instantly share code, notes, and snippets.

@clowder
Created October 30, 2017 14:46
Show Gist options
  • Save clowder/15a655766409d2aa18f9fe69205e8277 to your computer and use it in GitHub Desktop.
Save clowder/15a655766409d2aa18f9fe69205e8277 to your computer and use it in GitHub Desktop.
diff --git a/db/seeds.rb b/db/seeds.rb
index 127561c..2ec12b2 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -653,6 +653,12 @@ if activities.options.blank?
])
end
+likert_0 = LikertOption.find_or_create_by(value: 0)
+likert_1 = LikertOption.find_or_create_by(value: 1)
+likert_2 = LikertOption.find_or_create_by(value: 2)
+likert_3 = LikertOption.find_or_create_by(value: 3)
+likert_4 = LikertOption.find_or_create_by(value: 4)
+
[allocentric_1, allocentric_2, allocentric_3, allocentric_4, extrovert_1,
extrovert_2, extrovert_3, extrovert_4].each do |question|
@@ -664,35 +670,35 @@ end
name: "Strongly Disagree",
trending: false,
position: 0,
- media: LikertOption.new(value: 0)
+ media: likert_0
},
{
step: question,
name: "Disagree",
trending: false,
position: 1,
- media: LikertOption.new(value: 1)
+ media: likert_1
},
{
step: question,
name: "Neutral",
trending: false,
position: 2,
- media: LikertOption.new(value: 2)
+ media: likert_2
},
{
step: question,
name: "Agree",
trending: false,
position: 3,
- media: LikertOption.new(value: 3)
+ media: likert_3
},
{
step: question,
name: "Strongly Agree",
trending: false,
position: 4,
- media: LikertOption.new(value: 4)
+ media: likert_4
},
])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment