-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: schemas,controllers for the practice section #4967
base: circuitverse-practice-section
Are you sure you want to change the base?
feat: schemas,controllers for the practice section #4967
Conversation
…stem from the moderators pov
Code Climate has analyzed commit 5a08114 and detected 0 issues on this pull request. View more on Code Climate. |
@@ -0,0 +1,4 @@ | |||
# frozen_string_literal: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Difficulty level has been moved to enum. So this will not required anymore.
@@ -0,0 +1,5 @@ | |||
# frozen_string_literal: true | |||
|
|||
class Category < ApplicationRecord |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wil be better to rename the model to QuestionCategory
@@ -0,0 +1,9 @@ | |||
# frozen_string_literal: true | |||
|
|||
class DifficultyLevel < ApplicationRecord |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be better to rename the model to QuestionDifficultyLevel
@@ -92,7 +92,7 @@ | |||
|
|||
create_table "assignments", force: :cascade do |t| | |||
t.string "name" | |||
t.datetime "deadline", null: false | |||
t.datetime "deadline", precision: nil, null: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rollback this change, if not required
@@ -451,6 +477,9 @@ | |||
t.string "educational_institute" | |||
t.boolean "subscribed", default: true | |||
t.string "locale" | |||
t.jsonb "submission_history", default: [], array: true | |||
t.boolean "public", default: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this added public
field required ?
|
||
FactoryBot.define do | ||
factory :category do | ||
name { "MyString" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name { "MyString" } | |
name { Faker::Lorem.word } |
Use faker instead of hard coded value
@@ -0,0 +1,8 @@ | |||
# frozen_string_literal: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the model has been removed and moved to enum, this file may be removed
factory :question do | ||
heading { "MyString" } | ||
statement { "MyText" } | ||
category { nil } | ||
difficulty_level { nil } | ||
test_data { "" } | ||
circuit_boilerplate { "" } | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Faker
. Ref- https://github.com/faker-ruby/faker?tab=readme-ov-file#usage
For test_data and circuit_boilerplate, we may put a blank JSON instead of blank string
@@ -0,0 +1 @@ | |||
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this file
Fixes #4966
Added scehams , routes and controller for question management system and tested