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

Simpler subjects names for imports #1299

Merged
merged 3 commits into from
Oct 6, 2020
Merged

Conversation

n-b
Copy link
Contributor

@n-b n-b commented Oct 5, 2020

refs #1253

  • Make sure InstitutionSubjects can be identifier by subject+description

    • Make the Subject label unique
    • Make the InstitutionSubject [institution, subject, description] unique: it means that in an Institution, the same subject can only be selected several times if the description is different (and present.)
  • Simplify the subject column name used in CSV exports and imports

    • On export, use just the subject as much as possible, and add the description if needed.
    • On import, allow different possible combinations, as long as it’s unambiguous.

The rubocop issue seems to be rubocop/rubocop-rails#349. We probably just need to bump the gem.

[theme, subject, description.presence].compact.to_csv(col_sep: ':').strip
def unique_name
if similar_institutions_subjects.present?
"#{subject.label}:#{description}" # We know description isn‘t blank, see :validate_description_presence
Copy link
Collaborator

Choose a reason for hiding this comment

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

Je pinaille mais on peut mettre des espaces autour du :

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bof, le but est à la fois d’être lisible et de pouvoir matcher les possible_names, je préfère que ça soit plus simple.

@n-b n-b force-pushed the simpler-subjects-names-for-imports branch from 23c0847 to 6f3c871 Compare October 6, 2020 08:43
@n-b
Copy link
Contributor Author

n-b commented Oct 6, 2020

Merger #1300 d’abord pour corriger le bug de rubocop.

* Make the Subject label unique
* Make the InstitutionSubject [institution, subject, description] unique: it means that in an Institution, the same subject can only be selected several times if the description is different (and present.)

refs #1253
On export, use just the subject as much as possible, and add the description if needed.
On import, allow different possible combinations, as long as it’s unambiguous.

refs #1253
@n-b n-b force-pushed the simpler-subjects-names-for-imports branch from 6f3c871 to 56b7266 Compare October 6, 2020 08:50
@n-b n-b merged commit 6d4c97c into master Oct 6, 2020
@n-b n-b deleted the simpler-subjects-names-for-imports branch October 6, 2020 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants