Refactor how Template upgrade customization works (#1856)
* Refactor how Template upgrade customization works

- Added position_in_parent to child-records Phase, Section, and Questions
- Extracted upgrade_customization! into its own service object

wip: rebasing on development

wip: pushing to Ghub

wip: Template upgrade customisation service working

Add migration to update versionable_id for records

* Fix bug in org swaps test

Test was failing because JS wasn't executing fast enough in test browser

* Refactor how locales are set in specs

* Fix bug in plan exports caused by git merge

The routes weren't merged properly which seems to have caused a regression error

* Add documentation for SectionSorter

* Update rubyzip and re-instate Bundle Audit

This was disabled because it was failing the Travis CI script. Since there wasn't a
new version of the rubyzip gem to upgrade to, we couldn't turn the error off.

* Add length constraints to versionable_id

* Add length constraints to versionable_id

* Fix bug in ActsAsSortable module

... I have no idea why those issues haven't popped up before now!?

* Fix random bug in I18n

* Move versioning ID migration into own rake task
dev
1 parent 3057268 commit 2f8ed6cf79ef1f44c153c746516e70d49cdce247
@Gavin Morrice Gavin Morrice authored on 5 Sep 2018
GitHub committed on 5 Sep 2018
Showing 29 changed files
View
.travis.yml
View
Gemfile
View
Gemfile.lock
View
app/models/annotation.rb
View
app/models/concerns/acts_as_sortable.rb
View
app/models/concerns/versionable_model.rb 0 → 100644
View
app/models/phase.rb
View
app/models/question.rb
View
app/models/section.rb
View
app/models/section_sorter.rb 0 → 100644
View
app/models/template.rb
View
app/services/template/upgrade_customization_service.rb 0 → 100644
View
app/views/paginable/plans/_publicly_visible.html.erb
View
db/migrate/20180903104704_add_versionable_id_to_phases_sections_and_questions.rb 0 → 100644
View
db/schema.rb
View
lib/data_cleanup/rules/section/fix_duplicate_number.rb
View
lib/tasks/migrate.rake
View
spec/factories/annotations.rb
View
spec/factories/phases.rb
View
spec/factories/questions.rb
View
spec/factories/sections.rb
View
spec/models/annotation_spec.rb
View
spec/models/phase_spec.rb
View
spec/models/question_spec.rb
View
spec/models/section_sorter_spec.rb 0 → 100644
View
spec/models/section_spec.rb
View
spec/services/template/upgrade_customization_service_spec.rb 0 → 100644
View
spec/support/locales.rb
View
spec/support/mixins/versionable_model_spec.rb 0 → 100644