Skip to content

Commit

Permalink
[ifmeorg#1737] Updated schema and seed file
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Warmenhoven committed May 8, 2020
1 parent d6fda4d commit 22bc905
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 36 deletions.
2 changes: 1 addition & 1 deletion app/models/category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# updated_at :datetime
# user_id :integer
# slug :string
# visible :boolean
# visible :boolean default(TRUE)
#

class Category < ApplicationRecord
Expand Down
1 change: 0 additions & 1 deletion app/models/medication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# add_to_google_cal :boolean default(FALSE)
# weekly_dosage :integer
# default(["0", "1", "2", "3", "4", "5", "6"]), is an Array
#

class Medication < ApplicationRecord
# dosage: amount of medication taken at one time
Expand Down
30 changes: 15 additions & 15 deletions app/models/moment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
#
# Table name: moments
#
# id :bigint not null, primary key
# name :string
# why :text
# fix :text
# created_at :datetime
# updated_at :datetime
# user_id :integer
# viewers :text
# comment :boolean
# slug :string
# secret_share_identifier :uuid
# secret_share_expires_at :datetime
# published_at :datetime
# bookmarked :boolean
# resource_recommendations :boolean
# id :bigint not null, primary key
# name :string
# why :text
# fix :text
# created_at :datetime
# updated_at :datetime
# user_id :integer
# viewers :text
# comment :boolean
# slug :string
# secret_share_identifier :uuid
# secret_share_expires_at :datetime
# published_at :datetime
# bookmarked :boolean default(FALSE)
# resource_recommendations :boolean default(TRUE)
#

class Moment < ApplicationRecord
Expand Down
2 changes: 1 addition & 1 deletion app/models/mood.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# updated_at :datetime
# user_id :integer
# slug :string
# visible :boolean
# visible :boolean default(TRUE)
#

class Mood < ApplicationRecord
Expand Down
4 changes: 2 additions & 2 deletions app/models/strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# name :string
# slug :string
# published_at :datetime
# visible :boolean
# bookmarked :boolean
# visible :boolean default(TRUE)
# bookmarked :boolean default(FALSE)
#

class Strategy < ApplicationRecord
Expand Down
4 changes: 2 additions & 2 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
user1_category1 = Category.create(user_id: user1.id, name: 'Public Speaking', description: 'Speaking in front of an audience at school')
user1_mood1 = Mood.create(user_id: user1.id, name: 'Anxious', description: 'Sweaty palms, increased heart rate')
user1_mood2 = Mood.create(user_id: user1.id, name: 'Shy', description: 'I swallow my words and start speaking fast')
user1_moment1 = Moment.create(user_id: user1.id, category: Array.new(1, user1_category1.id), mood: [user1_mood1.id, user1_mood2.id], name: 'Presentation for ENGL 101', why: 'I am presenting in front of my classmates and I am worried I will make a fool out of myself', viewers: [user2.id, user3.id], comment: true)
user1_moment1 = Moment.create(user_id: user1.id, category: Array.new(1, user1_category1.id), mood: [user1_mood1.id, user1_mood2.id], name: 'Presentation for ENGL 101', why: 'I am presenting in front of my classmates and I am worried I will make a fool out of myself', viewers: [user2.id, user3.id], comment: true, resource_reccomedations: true)
user1_moment1_comment = Comment.create(commentable_type: 'moment', commentable_id: user1_moment1.id, comment_by: user2.id, comment: "Good luck on the presentation! Just pretend everyone is in underpants :)", visibility: 'private')
user1_group1 = Group.create(name: 'Students with Anxiety', description: 'A support group for students to discuss anxiety weekly')
user1_group1_member1 = GroupMember.create(group_id: user1_group1.id, user_id: user1.id, leader: true)
Expand All @@ -38,6 +38,6 @@
user2_category1 = Category.create(user_id: user2.id, name: 'Brother', description: 'We have a strained relationship')
user2_mood1 = Mood.create(user_id: user2.id, name: 'Angry', description: 'I become violent and act irrationally')
user2_mood2 = Mood.create(user_id: user2.id, name: 'Exhausted', description: 'No motivation to do anything')
user2_moment1 = Moment.create(user_id: user2.id, category: Array.new(1, user2_category1.id), mood: Array.new(1, user2_mood1.id), name: 'Thanksgiving Dinner', why: 'He kept asserting to everyone that I was immature and he always did everything for me.', viewers: Array.new(1, user1.id), comment: false)
user2_moment1 = Moment.create(user_id: user2.id, category: Array.new(1, user2_category1.id), mood: Array.new(1, user2_mood1.id), name: 'Thanksgiving Dinner', why: 'He kept asserting to everyone that I was immature and he always did everything for me.', viewers: Array.new(1, user1.id), comment: false, resource_reccomedations: true)
user2_moment1_comment = Comment.create(commentable_type: 'moment', commentable_id: user2_moment1.id, comment_by: user1.id, comment: "You should talk to him one-on-one and tell him how you feel!", visibility: 'all')
user1_group1_member2 = GroupMember.create(group_id: user1_group1.id, user_id: user2.id, leader: true)
1 change: 1 addition & 0 deletions spec/models/category_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# updated_at :datetime
# user_id :integer
# slug :string
# visible :boolean default(TRUE)
#

describe Category do
Expand Down
28 changes: 15 additions & 13 deletions spec/models/moment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
#
# Table name: moments
#
# id :bigint not null, primary key
# name :string
# why :text
# fix :text
# created_at :datetime
# updated_at :datetime
# user_id :integer
# viewers :text
# comment :boolean
# slug :string
# secret_share_identifier :uuid
# secret_share_expires_at :datetime
# published_at :datetime
# id :bigint not null, primary key
# name :string
# why :text
# fix :text
# created_at :datetime
# updated_at :datetime
# user_id :integer
# viewers :text
# comment :boolean
# slug :string
# secret_share_identifier :uuid
# secret_share_expires_at :datetime
# published_at :datetime
# bookmarked :boolean default(FALSE)
# resource_recommendations :boolean default(TRUE)
#

describe Moment do
Expand Down
1 change: 1 addition & 0 deletions spec/models/mood_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# updated_at :datetime
# user_id :integer
# slug :string
# visible :boolean default(TRUE)
#

describe Mood do
Expand Down
3 changes: 2 additions & 1 deletion spec/models/strategy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#
# id :bigint not null, primary key
# user_id :integer
# category :text
# description :text
# viewers :text
# comment :boolean
Expand All @@ -14,6 +13,8 @@
# name :string
# slug :string
# published_at :datetime
# visible :boolean default(TRUE)
# bookmarked :boolean default(FALSE)
#

describe Strategy do
Expand Down

0 comments on commit 22bc905

Please sign in to comment.