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

Permitir sobrescribir los nombres y créditos de las materias scrapeadas #596

Open
wants to merge 2 commits into
base: master
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
7 changes: 4 additions & 3 deletions app/services/yml_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ def load_subjects
subjects.each do |code, subject|
new_subject = Subject.find_or_initialize_by(code:)

new_subject.name = format_name(subject["name"])
new_subject.credits = subject["credits"]
subject_overrides = subjects_overrides[code] || {}

new_subject.name = subject_overrides["name"] || format_name(subject["name"])
new_subject.credits = subject_overrides["credits"] || subject["credits"]
new_subject.group = SubjectGroup.find_by(code: subject["subject_group"])

subject_overrides = subjects_overrides[code] || {}
new_subject.eva_id = subject_overrides['eva_id']
new_subject.openfing_id = subject_overrides['openfing_id']
new_subject.short_name = subject_overrides['short_name']
Expand Down
8 changes: 8 additions & 0 deletions db/data/subject_overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1218,3 +1218,11 @@ R100:
category: 'inactive'
'1940':
category: 'inactive'
'01':
name: FQ - Matemática 01 (Análisis I)
short_name: FQ - Mat. 01 (Análisis I)
credits: 14
'101':
name: FQ - Matemática 101 (Análisis I)
short_name: FQ - Mat. 101 (Análisis I)
credits: 17