-
Notifications
You must be signed in to change notification settings - Fork 172
Adding date_format_pref field for new user #247
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
base: main
Are you sure you want to change the base?
Conversation
Generated by 🚫 Danger |
|
🚨 RSpec Tests Report |
| rescue_from ActiveRecord::RecordNotFound, with: :institution_not_found | ||
| def action_allowed? | ||
| has_role?('Instructor') | ||
| has_role?('Instructor') || has_role?('Administrator') |
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.
Instead of using the disjunction in a lot of action_allowed methods, I believe there is a has_instructor_privileges? method that implements the disjunction.
| # Role IDs | ||
| STUDENT_ID = 1 | ||
| TEACHING_ASSISTANT_ID = 2 | ||
| # Role IDs (must match db/seeds.rb) |
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.
Should there be a db table with these correspondences?
| super(options.merge({ only: %i[id name parent_id] })) | ||
| end | ||
| end | ||
| 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.
Please add an EOL
| STUDENT_ID = 1 | ||
| TEACHING_ASSISTANT_ID = 2 | ||
| # Role IDs (must match db/seeds.rb) | ||
| SUPER_ADMINISTRATOR_ID = 1 |
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.
Could this just be SUPER_ADMINISTRATOR, etc.? All files would need to be refactored to effect this change, but it would enhance readability. But, would it lead to namespace conflicts? If it doesn't cause name conflicts, it would be worth doing.
| delegate :administrator?, to: :role | ||
| delegate :super_administrator?, to: :role | ||
|
|
||
| def self.instantiate(record) |
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.
Please refactor, according to the recommendations in https://chatgpt.com/share/694abed0-f590-800d-ac2a-4d87911c5de3.
No description provided.