-
Notifications
You must be signed in to change notification settings - Fork 3
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
Display different eva links depending on semester #633
base: master
Are you sure you want to change the base?
Conversation
db/data/subject_overrides.yml
Outdated
@@ -73,7 +73,7 @@ CP49: | |||
'1052': | |||
category: 'inactive' | |||
'1062': | |||
eva_id: '1131' | |||
eva_id: '1594/1131' |
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.
thoughts about adding a separate field/column for this?
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.
you mean adding an extra column for the eva_id
of the second semester?
I think it would look cleaner for sure, but in 99% of cases it would be null
, are we ok with that?
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.
you mean adding an extra column for the eva_id of the second semester?
yeah
IMO it's ok if it's almost always null, but open to discuss it if others prefer reusing the same field
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.
wdyt about it now?
I like it more than having it in the same field, but I'm still not convinced, the naming of the column seems kind of odd, but maybe that's me 🤣
e25ddc4
to
298a7c2
Compare
5d4b0d0
to
a9d5fee
Compare
def up | ||
add_column :subjects, :second_semester_eva_id, :string, if_not_exists: true | ||
end | ||
|
||
def down | ||
remove_column :subjects, :second_semester_eva_id, if_exists: true | ||
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.
def up | |
add_column :subjects, :second_semester_eva_id, :string, if_not_exists: true | |
end | |
def down | |
remove_column :subjects, :second_semester_eva_id, if_exists: true | |
end | |
def change | |
add_column :subjects, :second_semester_eva_id, :string | |
end |
<span class="mdc-deprecated-list-item__graphic material-icons">forum</span> | ||
<span class="mdc-deprecated-list-item__text">EVA</span> | ||
</a> | ||
<%= display_eva_links(@subject) %> |
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.
<%= display_eva_links(@subject) %> | |
<% second_semester_eva_id = @subject.second_semester_eva_id %> | |
<%= render 'shared/eva_links_component', eva_id: @subject.eva_id, text: second_semester_eva_id ? "EVA - Primer semestre" : "EVA" %> | |
<%= render 'shared/eva_links_component', eva_id: second_semester_eva_id, text: "EVA - Segundo semestre" if second_semester_eva_id %> |
if you like it better, i think you can do something like this to make it more direct and avoid the helper and method on the model.
I'm ok either way
What
Pending questions
eva_ids
de otra forma?