gaku_archive 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +7 -0
  2. data/app/assets/javascripts/gaku/archive.js.coffee +4 -0
  3. data/app/assets/stylesheets/gaku/archive.css +5 -0
  4. data/app/controllers/concerns/trashable_controller.rb +32 -0
  5. data/app/controllers/gaku/admin/changes/student_address_changes_controller.rb +14 -0
  6. data/app/controllers/gaku/admin/changes/student_changes_controller.rb +13 -0
  7. data/app/controllers/gaku/admin/changes/student_contact_changes_controller.rb +13 -0
  8. data/app/controllers/gaku/admin/disposals_controller.rb +55 -0
  9. data/app/controllers/gaku/admin/students_controller.rb +22 -0
  10. data/app/controllers/gaku/class_groups_controller_injector.rb +5 -0
  11. data/app/controllers/gaku/contacts_controller_injector.rb +21 -0
  12. data/app/controllers/gaku/course_groups_controller_injector.rb +5 -0
  13. data/app/controllers/gaku/courses_controller_injector.rb +5 -0
  14. data/app/controllers/gaku/exams_controller_injector.rb +5 -0
  15. data/app/controllers/gaku/extracurricular_activities_controller_injector.rb +5 -0
  16. data/app/controllers/gaku/students_controller_injector.rb +5 -0
  17. data/app/controllers/gaku/syllabuses_controller_injector.rb +5 -0
  18. data/app/controllers/gaku/teachers_controller_injector.rb +5 -0
  19. data/app/models/concerns/trashable.rb +17 -0
  20. data/app/models/gaku/address_injector.rb +31 -0
  21. data/app/models/gaku/attachment_injector.rb +5 -0
  22. data/app/models/gaku/class_group_injector.rb +5 -0
  23. data/app/models/gaku/contact_injector.rb +34 -0
  24. data/app/models/gaku/course_group_injector.rb +5 -0
  25. data/app/models/gaku/course_injector.rb +5 -0
  26. data/app/models/gaku/exam_injector.rb +5 -0
  27. data/app/models/gaku/extracurricular_activity_injector.rb +5 -0
  28. data/app/models/gaku/guardian_injector.rb +5 -0
  29. data/app/models/gaku/student_injector.rb +16 -0
  30. data/app/models/gaku/syllabus_injector.rb +5 -0
  31. data/app/models/gaku/teacher_injector.rb +5 -0
  32. data/app/models/gaku/versioning/address_version.rb +9 -0
  33. data/app/models/gaku/versioning/contact_version.rb +7 -0
  34. data/app/models/gaku/versioning/student_version.rb +47 -0
  35. data/app/overrides/archive_menu.rb +6 -0
  36. data/app/views/gaku/addresses/_delete_link.html.slim +1 -0
  37. data/app/views/gaku/admin/changes/student_address_changes/_change.html.slim +10 -0
  38. data/app/views/gaku/admin/changes/student_address_changes/_changes.html.slim +19 -0
  39. data/app/views/gaku/admin/changes/student_address_changes/_deletion.html.slim +9 -0
  40. data/app/views/gaku/admin/changes/student_address_changes/index.html.slim +11 -0
  41. data/app/views/gaku/admin/changes/student_changes/_change.html.slim +10 -0
  42. data/app/views/gaku/admin/changes/student_changes/_changes.html.slim +18 -0
  43. data/app/views/gaku/admin/changes/student_changes/_deletion.html.slim +9 -0
  44. data/app/views/gaku/admin/changes/student_changes/index.html.slim +13 -0
  45. data/app/views/gaku/admin/changes/student_contact_changes/_change.html.slim +10 -0
  46. data/app/views/gaku/admin/changes/student_contact_changes/_changes.html.slim +19 -0
  47. data/app/views/gaku/admin/changes/student_contact_changes/_deletion.html.slim +9 -0
  48. data/app/views/gaku/admin/changes/student_contact_changes/index.html.slim +11 -0
  49. data/app/views/gaku/admin/disposals/_address.html.slim +12 -0
  50. data/app/views/gaku/admin/disposals/_addresses.html.slim +17 -0
  51. data/app/views/gaku/admin/disposals/_contact.html.slim +9 -0
  52. data/app/views/gaku/admin/disposals/_contacts.html.slim +14 -0
  53. data/app/views/gaku/admin/disposals/_course_group.html.slim +3 -0
  54. data/app/views/gaku/admin/disposals/_course_groups.html.slim +12 -0
  55. data/app/views/gaku/admin/disposals/_exam.html.slim +10 -0
  56. data/app/views/gaku/admin/disposals/_guardian.html.slim +10 -0
  57. data/app/views/gaku/admin/disposals/_student.html.slim +10 -0
  58. data/app/views/gaku/admin/disposals/_tabs.html.slim +17 -0
  59. data/app/views/gaku/admin/disposals/_teacher.html.slim +10 -0
  60. data/app/views/gaku/admin/disposals/addresses.html.slim +2 -0
  61. data/app/views/gaku/admin/disposals/attachments.html.slim +30 -0
  62. data/app/views/gaku/admin/disposals/contacts.html.slim +2 -0
  63. data/app/views/gaku/admin/disposals/course_groups.html.slim +12 -0
  64. data/app/views/gaku/admin/disposals/exams.html.slim +16 -0
  65. data/app/views/gaku/admin/disposals/guardians.html.slim +16 -0
  66. data/app/views/gaku/admin/disposals/index.html.slim +1 -0
  67. data/app/views/gaku/admin/disposals/students.html.slim +16 -0
  68. data/app/views/gaku/admin/disposals/tabs/_addresses_tabs.html.slim +19 -0
  69. data/app/views/gaku/admin/disposals/tabs/_contacts_tabs.html.slim +19 -0
  70. data/app/views/gaku/admin/disposals/teachers.html.slim +16 -0
  71. data/app/views/gaku/class_groups/recovery.js.erb +1 -0
  72. data/app/views/gaku/contacts/_delete_link.html.slim +1 -0
  73. data/app/views/gaku/course_groups/recovery.js.erb +1 -0
  74. data/app/views/gaku/courses/recovery.js.erb +1 -0
  75. data/app/views/gaku/exams/recovery.js.erb +1 -0
  76. data/app/views/gaku/extracurricular_activities/recovery.js.erb +1 -0
  77. data/app/views/gaku/shared/_delete_link.html.slim +1 -0
  78. data/app/views/gaku/shared/_delete_modal.html.slim +11 -0
  79. data/app/views/gaku/shared/menu/_archive.html.erb +1 -0
  80. data/app/views/gaku/students/recovery.js.erb +1 -0
  81. data/app/views/gaku/syllabuses/recovery.js.erb +1 -0
  82. data/app/views/gaku/teachers/recovery.js.erb +1 -0
  83. data/config/initializers/paper_trail.rb +3 -0
  84. data/config/routes.rb +67 -0
  85. data/db/migrate/20131203160531_create_versioning_tables.rb +47 -0
  86. data/db/migrate/20131203160607_add_deleted_fields.rb +53 -0
  87. data/lib/gaku/archive/engine.rb +22 -0
  88. data/lib/gaku/archive.rb +13 -0
  89. data/lib/gaku_archive.rb +1 -0
  90. metadata +191 -0
@@ -0,0 +1,11 @@
1
+ = content_for :title, t(:'changes.student_contact.list')
2
+
3
+ = content_for :index_header do
4
+ .pull-left
5
+ = count_div 'changes-count' do
6
+ = print_count @count, t(:'changes.student_contact.list')
7
+
8
+ = hr
9
+
10
+ #changes-index
11
+ = render 'changes'
@@ -0,0 +1,12 @@
1
+ tr
2
+ td = address.addressable
3
+ td = address.title
4
+ td = address.country
5
+ td = address.zipcode
6
+ td = address.state
7
+ td = address.city
8
+ td = address.address1
9
+ td = address.address2
10
+ td
11
+ = ajax_link_to_restore [:recovery, address.addressable, address]
12
+ = ajax_link_to_delete [address.addressable, address]
@@ -0,0 +1,17 @@
1
+ = well_div do
2
+ = table_for 'admin-student-addresses-disposals-index' do
3
+ thead
4
+ tr
5
+ = th 'Person'
6
+ = th t(:'address.title')
7
+ = th t(:'address.country')
8
+ = th t(:'address.zipcode')
9
+ = th t(:'address.state')
10
+ = th t(:'address.city')
11
+ = th t(:'address.address1')
12
+ = th t(:'address.address2')
13
+ = th_actions 2
14
+ tbody
15
+ =render partial: 'address', collection: disposals, as: :address
16
+
17
+ = paginate disposals
@@ -0,0 +1,9 @@
1
+ tr
2
+ td = contact.contactable
3
+ td = contact.name
4
+ td = contact.data
5
+ td = contact.details
6
+ td = t(:'contact.emergency') if contact.emergency?
7
+ td
8
+ = ajax_link_to_restore [:recovery, contact.contactable, contact]
9
+ = ajax_link_to_delete [contact.contactable, contact]
@@ -0,0 +1,14 @@
1
+ = well_div do
2
+ = table_for 'admin-student-contacts-disposals-index' do
3
+ thead
4
+ tr
5
+ = th 'Person'
6
+ = th t(:'contact.contact_type')
7
+ = th t(:'contact.data')
8
+ = th t(:'contact.details')
9
+ = th t(:'contact.emergency')
10
+ = th_actions 2
11
+ tbody
12
+ =render partial: 'contact', collection: disposals, as: :contact
13
+
14
+ = paginate disposals
@@ -0,0 +1,3 @@
1
+ tr
2
+ td = course_group.name
3
+ td
@@ -0,0 +1,12 @@
1
+ = table_for 'course-groups-index' do
2
+ thead
3
+ tr
4
+ = th(sortable 'name', t(:'course_group.name'))
5
+ = th_actions 3
6
+ tbody
7
+ - @course_groups.each do |course_group|
8
+ tr class="course-group-#{course_group.id}"
9
+ td.name = course_group.name
10
+ td
11
+ = ajax_link_to_delete course_group , id: 'delete-course-group-link'
12
+ = link_to ('<span class="glyphicon glyphicon-repeat"></span>').html_safe, [:recovery, course_group], class: 'mr-xs btn btn-mini btn-warning recovery-link', remote: true
@@ -0,0 +1,10 @@
1
+ - unless exam.nil? or exam.new_record? or !exam
2
+ tr
3
+ td = exam.name
4
+ td = exam.description
5
+ td = exam.adjustments
6
+ td = exam.weight
7
+ td = exam.use_weighting
8
+ td
9
+ = ajax_link_to_restore [:recovery, exam]
10
+ = ajax_link_to_delete exam
@@ -0,0 +1,10 @@
1
+ tr
2
+ td = guardian.surname
3
+ td = guardian.name
4
+ td = guardian.surname_reading
5
+ td = guardian.name_reading
6
+ td = guardian.birth_date
7
+ td
8
+ /= link_to_show [:show_deleted, guardian]
9
+ /= link_to content_tag(:li, nil, class: 'icon-white icon-repeat'), [:recovery, guardian], class: 'mr-xs btn btn-mini btn-warning recovery-link', remote: true
10
+ /= ajax_link_to_delete guardian , id: 'delete-disposal-guardian-link'
@@ -0,0 +1,10 @@
1
+ tr
2
+ td = student.surname
3
+ td = student.name
4
+ td = student.surname_reading
5
+ td = student.name_reading
6
+ td = student.birth_date
7
+ td
8
+ = link_to_show [:admin, student]
9
+ = ajax_link_to_restore [:recovery, student]
10
+ = ajax_link_to_delete student
@@ -0,0 +1,17 @@
1
+ ul.nav.nav-tabs
2
+ li.active
3
+ = link_to(t(:'student.plural'), students_admin_disposals_path, id: 'students-tab-link')
4
+ li
5
+ = link_to(t(:'teacher.plural'), teachers_admin_disposals_path, id: 'teachers-tab-link')
6
+ li
7
+ = link_to(t(:'guardian.plural'), guardians_admin_disposals_path, id: 'guardians-tab-link')
8
+ li
9
+ = link_to(t(:'address.plural'), addresses_admin_disposals_path, id: 'addresses-tab-link')
10
+ li
11
+ = link_to(t(:'contact.plural'), contacts_admin_disposals_path, id: 'contacts-tab-link')
12
+ li
13
+ = link_to(t(:'exam.plural'), exams_admin_disposals_path, id: 'exams-tab-link')
14
+ li
15
+ = link_to(t(:'course_group.plural'), course_groups_admin_disposals_path, id: 'course-groups-tab-link')
16
+ li
17
+ = link_to(t(:'attachment.plural'), attachments_admin_disposals_path, id: 'attachments-tab-link')
@@ -0,0 +1,10 @@
1
+ tr
2
+ td = teacher.surname
3
+ td = teacher.name
4
+ td = teacher.surname_reading
5
+ td = teacher.name_reading
6
+ td = teacher.birth_date
7
+ td
8
+ = link_to_show [:show_deleted, teacher]
9
+ = ajax_link_to_restore [:recovery, teacher]
10
+ = ajax_link_to_delete teacher
@@ -0,0 +1,2 @@
1
+ = render 'tabs'
2
+ = render partial: 'gaku/admin/disposals/tabs/addresses_tabs', locals: { student_addresses: @student_addresses, teacher_addresses: @teacher_addresses }
@@ -0,0 +1,30 @@
1
+ = render 'tabs'
2
+
3
+ = well_div do
4
+ = table_for 'disposal-attachments-index' do
5
+ thead
6
+ tr
7
+ = th t(:'attachment.name')
8
+ = th t(:'attachment.description')
9
+ = th t(:'attachment.asset_type')
10
+ = th t(:'resource')
11
+ = th t(:'attachment.file_name')
12
+ = th t(:'attachment.file_type')
13
+ = th t(:'attachment.file_size')
14
+ = th_actions 2
15
+ tbody
16
+ - @attachments.each do |attachment|
17
+ tr
18
+ td = attachment.name
19
+ td = attachment.description
20
+ td = attachment.attachable_type
21
+ td = attachment.attachable
22
+ td = attachment.asset_file_name
23
+ td = attachment.asset_content_type
24
+ td = number_to_human_size attachment.asset_file_size
25
+ td
26
+ = ajax_link_to_restore [:recovery, attachment]
27
+ = ajax_link_to_delete attachment
28
+
29
+
30
+ = paginate @attachments
@@ -0,0 +1,2 @@
1
+ = render 'tabs'
2
+ = render partial: 'gaku/admin/disposals/tabs/contacts_tabs', locals: { student_contacts: @student_contacts, teacher_contacts: @teacher_contacts }
@@ -0,0 +1,12 @@
1
+ = render 'tabs'
2
+
3
+ = well_div do
4
+ = table_for 'disposal-course-group-index' do
5
+ thead
6
+ tr
7
+ = th t(:'course_group.name')
8
+ = th_actions 3
9
+ tbody
10
+ = render partial: 'course_group', collection: @course_groups, as: :course_group
11
+
12
+ = paginate @course_groups
@@ -0,0 +1,16 @@
1
+ = render 'tabs'
2
+
3
+ = well_div do
4
+ = table_for 'exams-index' do
5
+ thead
6
+ tr
7
+ = th t(:'exam.name')
8
+ = th t(:'exam.description')
9
+ = th t(:'exam.adjustments')
10
+ = th t(:'exam.weight')
11
+ = th t(:'exam.use_weighting')
12
+ = th_actions 2
13
+ tbody
14
+ = render partial: 'gaku/admin/disposals/exam', collection: @exams, as: :exam
15
+
16
+ = paginate @exams
@@ -0,0 +1,16 @@
1
+ = render 'tabs'
2
+
3
+ = well_div do
4
+ = table_for 'disposal-guardian-index' do
5
+ thead
6
+ tr
7
+ = th t(:'surname')
8
+ = th t(:'name')
9
+ = th t(:'surname_reading')
10
+ = th t(:'name_reading')
11
+ = th t(:'birth_date')
12
+ = th_actions 3
13
+ tbody
14
+ = render partial: 'guardian', collection: @guardians, as: :guardian
15
+
16
+ = paginate @guardians
@@ -0,0 +1 @@
1
+ = render 'tabs'
@@ -0,0 +1,16 @@
1
+ = render 'tabs'
2
+
3
+ = well_div do
4
+ = table_for 'disposal-student-index' do
5
+ thead
6
+ tr
7
+ = th t(:'surname')
8
+ = th t(:'name')
9
+ = th t(:'surname_reading')
10
+ = th t(:'name_reading')
11
+ = th t(:'birth_date')
12
+ = th_actions 3
13
+ tbody
14
+ = render partial: 'student', collection: @students, as: :student
15
+
16
+ = paginate @students
@@ -0,0 +1,19 @@
1
+ .row-fluid.mt-l
2
+ .span12.well
3
+ .tabbable.tabs-right
4
+ ul.nav.nav-tabs
5
+ li.active
6
+ a#student-addresses-tab-link data-toggle="tab" href="#student_addresses"
7
+ = print_count @students_count, t(:'student.addresses')
8
+ li
9
+ a#teacher-addresses-tab-link data-toggle="tab" href="#teacher_addresses"
10
+ = print_count @teachers_count, t(:'teacher.addresses')
11
+
12
+ .tab-content
13
+ #student_addresses.tab-pane.active
14
+ .row-fluid
15
+ = render partial: 'gaku/admin/disposals/addresses', locals: { disposals: student_addresses }
16
+
17
+ #teacher_addresses.tab-pane
18
+ .row-fluid
19
+ = render partial: 'gaku/admin/disposals/addresses', locals: { disposals: teacher_addresses }
@@ -0,0 +1,19 @@
1
+ .row-fluid.mt-l
2
+ .span12.well
3
+ .tabbable.tabs-right
4
+ ul.nav.nav-tabs
5
+ li.active
6
+ a#student-contacts-tab-link data-toggle="tab" href="#student_contacts"
7
+ = print_count @students_count, t(:'student.contacts')
8
+ li
9
+ a#teacher-contacts-tab-link data-toggle="tab" href="#teacher_contacts"
10
+ = print_count @teachers_count, t(:'teacher.contacts')
11
+
12
+ .tab-content
13
+ #student_contacts.tab-pane.active
14
+ .row-fluid
15
+ = render partial: 'gaku/admin/disposals/contacts', locals: { disposals: student_contacts }
16
+
17
+ #teacher_contacts.tab-pane
18
+ .row-fluid
19
+ = render partial: 'gaku/admin/disposals/contacts', locals: { disposals: teacher_contacts }
@@ -0,0 +1,16 @@
1
+ = render 'tabs'
2
+
3
+ = well_div do
4
+ = table_for 'disposal-teacher-index' do
5
+ thead
6
+ tr
7
+ = th t(:'surname')
8
+ = th t(:'name')
9
+ = th t(:'surname_reading')
10
+ = th t(:'name_reading')
11
+ = th t(:'birth_date')
12
+ = th_actions 3
13
+ tbody
14
+ = render partial: 'teacher', collection: @teachers, as: :teacher
15
+
16
+ = paginate @teachers
@@ -0,0 +1 @@
1
+ showNotice("<%= render_flash %>");
@@ -0,0 +1 @@
1
+ = ajax_soft_delete [:soft_delete, target].flatten
@@ -0,0 +1 @@
1
+ showNotice("<%= render_flash %>");
@@ -0,0 +1 @@
1
+ showNotice("<%= render_flash %>");
@@ -0,0 +1 @@
1
+ showNotice("<%= render_flash %>");
@@ -0,0 +1 @@
1
+ showNotice("<%= render_flash %>");
@@ -0,0 +1 @@
1
+ = ajax_soft_delete [:soft_delete, target].flatten
@@ -0,0 +1,11 @@
1
+ #delete-modal.modal.d-none
2
+ .modal-dialog
3
+ .alert-dismissable
4
+ .panel.panel-danger
5
+ .panel-heading
6
+ .panel-title
7
+ = modal_close_button
8
+ = t(:confirm_delete)
9
+ .panel-body
10
+ .delete_button style='text-align:center'
11
+ = link_to_soft_delete_with_text [:soft_delete, target]
@@ -0,0 +1 @@
1
+ <li data-hook="disposals"><%= link_to t('menu.admin.disposals.disposals'), admin_disposals_path %></li>
@@ -0,0 +1 @@
1
+ showNotice("<%= render_flash %>");
@@ -0,0 +1 @@
1
+ showNotice("<%= render_flash %>");
@@ -0,0 +1 @@
1
+ showNotice("<%= render_flash %>");
@@ -0,0 +1,3 @@
1
+ PaperTrail::Version.module_eval do
2
+ self.abstract_class = true
3
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,67 @@
1
+ Gaku::Core::Engine.routes.draw do
2
+
3
+ concern(:pagination) { get 'page/:page', action: :index, on: :collection }
4
+ concern :soft_delete do
5
+ patch :recovery, on: :member
6
+ patch :soft_delete, on: :member
7
+ end
8
+
9
+ resources :attachments, concerns: :soft_delete
10
+ resources :teachers, concerns: :soft_delete
11
+ resources :students, concerns: :soft_delete do
12
+ get :search, on: :collection
13
+ get :clear_search, on: :collection
14
+ get :advanced_search, on: :collection
15
+ get :chosen, on: :collection
16
+ resources :guardians, controller: 'students/guardians', concerns: :soft_delete
17
+ end
18
+ resources :extracurricular_activities, concerns: :soft_delete
19
+ resources :class_groups, concerns: :soft_delete do
20
+ collection do
21
+ get :search
22
+ get :search_semester
23
+ get :advanced_search
24
+ get :semester_advanced_search
25
+ get :with_semester
26
+ get :without_semester
27
+ end
28
+ end
29
+ resources :courses, concerns: :soft_delete
30
+ resources :course_groups, concerns: :soft_delete
31
+ resources :exams, concerns: :soft_delete
32
+ resources :syllabuses, concerns: :soft_delete
33
+
34
+ namespace :admin do
35
+
36
+ resources :students, only: :show
37
+
38
+ namespace :changes do
39
+ resources :students, controller: 'student_changes', concerns: %i( pagination )
40
+ resources :student_contacts, controller: 'student_contact_changes'
41
+ resources :student_addresses, controller: 'student_address_changes'
42
+ end
43
+
44
+ resources :disposals do
45
+ collection do
46
+ get :students
47
+ get :teachers
48
+ get :guardians
49
+ get :exams
50
+ get :course_groups
51
+ get :attachments
52
+ get :addresses
53
+ get :contacts
54
+
55
+ get 'students/page/:page', action: :students
56
+ get 'teachers/page/:page', action: :teachers
57
+ get 'guardians/page/:page', action: :guardians
58
+ get 'exams/page/:page', action: :exams
59
+ get 'course_groups/page/:page', action: :course_groups
60
+ get 'attachments/page/:page', action: :attachments
61
+ get 'addresses/page/:page', action: :addresses
62
+ get 'contacts/page/:page', action: :contacts
63
+ end
64
+ end
65
+
66
+ end
67
+ end
@@ -0,0 +1,47 @@
1
+ class CreateVersioningTables < ActiveRecord::Migration
2
+ def change
3
+
4
+ create_table 'gaku_versioning_address_versions' do |t|
5
+ t.string 'item_type', null: false
6
+ t.integer 'item_id', null: false
7
+ t.string 'event', null: false
8
+ t.string 'whodunnit'
9
+ t.text 'object'
10
+ t.text 'object_changes'
11
+ t.string 'join_model'
12
+ t.integer 'joined_resource_id'
13
+ t.datetime 'created_at'
14
+ end
15
+
16
+ add_index 'gaku_versioning_address_versions', ['item_type', 'item_id'], name: 'index_gaku_versioning_address_versions_on_item_fields', using: :btree
17
+
18
+ create_table 'gaku_versioning_contact_versions' do |t|
19
+ t.string 'item_type', null: false
20
+ t.integer 'item_id', null: false
21
+ t.string 'event', null: false
22
+ t.string 'whodunnit'
23
+ t.text 'object'
24
+ t.text 'object_changes'
25
+ t.string 'join_model'
26
+ t.integer 'joined_resource_id'
27
+ t.datetime 'created_at'
28
+ end
29
+
30
+ add_index 'gaku_versioning_contact_versions', ['item_type', 'item_id'], name: 'index_gaku_versioning_contact_versions_on_item_fields', using: :btree
31
+
32
+ create_table 'gaku_versioning_student_versions' do |t|
33
+ t.string 'item_type', null: false
34
+ t.integer 'item_id', null: false
35
+ t.string 'event', null: false
36
+ t.string 'whodunnit'
37
+ t.text 'object'
38
+ t.text 'object_changes'
39
+ t.text 'human_changes'
40
+ t.datetime 'created_at'
41
+ end
42
+
43
+ add_index 'gaku_versioning_student_versions', ['item_type', 'item_id'], name: 'index_gaku_versioning_student_versions_on_item_fields', using: :btree
44
+
45
+
46
+ end
47
+ end
@@ -0,0 +1,53 @@
1
+ class AddDeletedFields < ActiveRecord::Migration
2
+ def change
3
+
4
+ change_table :gaku_addresses do |t|
5
+ t.boolean :deleted, default: false
6
+ end
7
+
8
+ change_table :gaku_attachments do |t|
9
+ t.boolean :deleted, default: false
10
+ end
11
+
12
+ change_table :gaku_class_groups do |t|
13
+ t.boolean :deleted, default: false
14
+ end
15
+
16
+ change_table :gaku_contacts do |t|
17
+ t.boolean :deleted, default: false
18
+ end
19
+
20
+ change_table :gaku_course_groups do |t|
21
+ t.boolean :deleted, default: false
22
+ end
23
+
24
+ change_table :gaku_courses do |t|
25
+ t.boolean :deleted, default: false
26
+ end
27
+
28
+ change_table :gaku_exams do |t|
29
+ t.boolean :deleted, default: false
30
+ end
31
+
32
+ change_table :gaku_extracurricular_activities do |t|
33
+ t.boolean :deleted, default: false
34
+ end
35
+
36
+ change_table :gaku_guardians do |t|
37
+ t.boolean :deleted, default: false
38
+ end
39
+
40
+ change_table :gaku_students do |t|
41
+ t.boolean :deleted, default: false
42
+ end
43
+
44
+ change_table :gaku_syllabuses do |t|
45
+ t.boolean :deleted, default: false
46
+ end
47
+
48
+ change_table :gaku_teachers do |t|
49
+ t.boolean :deleted, default: false
50
+ end
51
+
52
+ end
53
+ end
@@ -0,0 +1,22 @@
1
+ module Gaku
2
+ module Archive
3
+ class Engine < ::Rails::Engine
4
+ engine_name 'gaku_archive'
5
+
6
+ config.autoload_paths += %W(#{config.root}/lib)
7
+
8
+ def self.activate
9
+ Dir.glob(File.join(File.dirname(__FILE__), "../../../app/**/*_injector*.rb")) do |c|
10
+ Rails.configuration.cache_classes ? require(c) : load(c)
11
+ end
12
+ end
13
+
14
+ config.to_prepare &method(:activate).to_proc
15
+
16
+ config.after_initialize do
17
+ Rails.application.routes_reloader.reload!
18
+ end
19
+
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,13 @@
1
+ require 'gaku/core'
2
+ require 'gaku/admin'
3
+ require 'gaku/frontend'
4
+ require 'paper_trail'
5
+
6
+ module Gaku
7
+
8
+ module Archive
9
+ end
10
+
11
+ end
12
+
13
+ require 'gaku/archive/engine'
@@ -0,0 +1 @@
1
+ require 'gaku/archive'