Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

created questions model and added attributes #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions herdapp/app/models/question.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
class Question < ApplicationRecord
<<<<<<< HEAD
=======
validates :title, :option1, :option2, presence: true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

niceeeeeeee

>>>>>>> d721cf4 (created questions model and added attributes)
end
10 changes: 10 additions & 0 deletions herdapp/db/migrate/20231021164625_create_questions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateQuestions < ActiveRecord::Migration[7.1]
def change
create_table :questions do |t|
t.string :title
t.string :option1
t.string :option2
t.timestamps
end
end
end
6 changes: 6 additions & 0 deletions herdapp/db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions herdapp/test/fixtures/questions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

one:
title: MyString
<<<<<<< HEAD
question: MyString
created_by: MyString

two:
title: MyString
question: MyString
created_by: MyString
=======

two:
title: MyString
>>>>>>> d721cf4 (created questions model and added attributes)