gaku 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -3
  3. data/.travis.yml +11 -8
  4. data/README.md +2 -4
  5. data/VERSION +1 -1
  6. data/core/Guardfile +24 -14
  7. data/core/Rakefile +0 -3
  8. data/core/app/controllers/gaku/admin/disposals_controller.rb +18 -45
  9. data/core/app/controllers/gaku/exams_controller.rb +2 -2
  10. data/core/app/controllers/gaku/syllabuses/exams_controller.rb +2 -2
  11. data/core/app/models/gaku/address.rb +1 -1
  12. data/core/app/models/gaku/disposal.rb +45 -0
  13. data/core/app/models/gaku/exam_portion.rb +1 -1
  14. data/core/app/models/gaku/student.rb +2 -2
  15. data/core/app/models/gaku/user.rb +1 -1
  16. data/core/app/models/gaku/versioning/student_version.rb +7 -12
  17. data/core/app/views/gaku/shared/overrides/students/_import_link.html.slim +0 -0
  18. data/core/app/views/gaku/shared/overrides/syllabuses/_import_link.html.slim +0 -0
  19. data/core/app/views/gaku/students/index.html.slim +1 -1
  20. data/core/app/views/gaku/syllabuses/index.html.slim +1 -1
  21. data/core/config/initializers/active_record.rb +1 -1
  22. data/core/config/routes.rb +1 -9
  23. data/core/db/default/gaku/attendance_types.rb +18 -8
  24. data/core/db/default/gaku/commute_method_types.rb +12 -20
  25. data/core/db/default/gaku/enrollment_status.rb +34 -31
  26. data/core/db/default/gaku/scholarship_statuses.rb +11 -8
  27. data/core/db/migrate/20120202111850_translated_tables.rb +52 -0
  28. data/core/db/migrate/{20120202111850_gaku_core.rb → 20131014065028_gaku_core.rb} +0 -86
  29. data/core/gaku_core.gemspec +43 -40
  30. data/core/lib/gaku/core.rb +2 -3
  31. data/core/lib/gaku/core/version.rb +1 -1
  32. data/core/lib/generators/gaku/install/install_generator.rb +1 -10
  33. data/core/spec/models/address_spec.rb +1 -1
  34. data/core/spec/spec_helper.rb +3 -3
  35. data/gaku_dependencies.rb +2 -12
  36. data/sample/db/sample/gaku/changes/student_changes.rb +3 -3
  37. data/sample/gaku_sample.gemspec +0 -1
  38. data/sample/lib/shared_sample_data.rb +2 -2
  39. metadata +12 -35
  40. data/core/app/controllers/gaku/students/importer_controller.rb +0 -75
  41. data/core/app/controllers/gaku/syllabuses/importer_controller.rb +0 -19
  42. data/core/app/models/gaku/import_file.rb +0 -5
  43. data/core/app/views/gaku/students/importer/index.html.slim +0 -26
  44. data/core/app/views/gaku/students/importer/roster_import_preview.html.slim +0 -4
  45. data/core/app/views/gaku/syllabuses/importer/index.html.slim +0 -14
  46. data/core/app/workers/gaku/importers/students/roster_worker.rb +0 -18
  47. data/core/app/workers/gaku/importers/students/school_station_zaikousei_worker.rb +0 -15
  48. data/core/config/initializers/sidekiq.rb +0 -6
  49. data/core/lib/gaku/exporters/roster_exporter.rb +0 -36
  50. data/core/lib/gaku/importers/key_mapper.rb +0 -19
  51. data/core/lib/gaku/importers/logger.rb +0 -10
  52. data/core/lib/gaku/importers/students/guardians.rb +0 -89
  53. data/core/lib/gaku/importers/students/personal_information.rb +0 -65
  54. data/core/lib/gaku/importers/students/roster.rb +0 -50
  55. data/core/lib/gaku/importers/students/roster_to_student.rb +0 -67
  56. data/core/lib/gaku/importers/students/school_station_zaikousei.rb +0 -109
  57. data/core/lib/gaku/importers/students/student_identity.rb +0 -17
  58. data/core/lib/gaku/testing/factories/import_file_factory.rb +0 -8
  59. data/core/lib/generators/gaku/install/templates/Procfile +0 -2
  60. data/core/lib/generators/gaku/install/templates/config/sidekiq.yml +0 -8
  61. data/core/spec/integration/importers/roster_spec.rb +0 -41
  62. data/core/spec/models/import_file_spec.rb +0 -9
  63. data/core/spec/requests/students/import_export.rb +0 -37
  64. data/core/spec/support/sample_roster.xls +0 -0
  65. data/core/spec/workers/roster_spec.rb +0 -13
@@ -1,17 +0,0 @@
1
- module Gaku::Importers::Students::StudentIdentity
2
- def normalize_id_num(id_number)
3
- if id_number.to_i == 0 # ID is alphanumeric
4
- return id_number.to_s
5
- else # ID number is a number, defaulted to float from sheet data
6
- return id_number.to_i.to_s
7
- end
8
- end
9
-
10
- def find_student_by_student_ids(student_id_number, student_foreign_id_number = nil)
11
- student = Gaku::Student.where(
12
- student_id_number: normalize_id_num(student_id_number)).first
13
- return student unless student.nil?
14
- Gaku::Student.where(
15
- student_foreign_id_number: normalize_id_num(student_foreign_id_number)).first
16
- end
17
- end
@@ -1,8 +0,0 @@
1
- FactoryGirl.define do
2
-
3
- factory :import_file, class: Gaku::ImportFile do
4
- context 'students'
5
- #data_file File.open(Rails.root + "../support/sample_roster.xls")
6
- end
7
-
8
- end
@@ -1,2 +0,0 @@
1
- web: bundle exec rails s -p $PORT
2
- worker: bundle exec sidekiq -C config/sidekiq.yml
@@ -1,8 +0,0 @@
1
- # Sample configuration file for Sidekiq.
2
- # Options here can still be overridden by cmd line args.
3
- # sidekiq -C config.yml
4
- ---
5
- :verbose: false
6
- :pidfile: ./tmp/pids/sidekiq.pid
7
- :logfile: ./log/sidekiq.log
8
- :concurrency: 25
@@ -1,41 +0,0 @@
1
- require 'spec_helper'
2
- require 'roo'
3
-
4
- describe Gaku::Importers::Students::RosterWorker do
5
-
6
- let!(:file) { create :import_file }
7
- let(:importer) { Gaku::Importers::Students::Roster.new(file, nil) }
8
- let(:book) { Roo::Spreadsheet.open(File.open(file)) }
9
-
10
- let!(:email) { create(:contact_type, name: 'Email') }
11
- let!(:phone) { create(:contact_type, name: 'Phone') }
12
-
13
-
14
- describe 'initialize' do
15
- xit 'sets book' do
16
- importer
17
- expect(importer.book).to_not be nil
18
- end
19
- end
20
-
21
- describe '#process_book' do
22
- xit 'creates students' do
23
- expect do
24
- importer.send(:process_book)
25
- end.to change(Gaku::Student, :count).by(3)
26
- end
27
-
28
- xit 'creates contacts' do
29
- expect do
30
- importer.send(:process_book)
31
- end.to change(Gaku::Contact, :count).by(4)
32
- end
33
-
34
- xit 'creates addresses' do
35
- expect do
36
- importer.send(:process_book)
37
- end.to change(Gaku::Address, :count).by(1)
38
- end
39
- end
40
-
41
- end
@@ -1,9 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Gaku::ImportFile do
4
-
5
- describe 'validations' do
6
- it { should have_attached_file :data_file }
7
- end
8
-
9
- end
@@ -1,37 +0,0 @@
1
- require 'spec_helper'
2
- require 'sidekiq/testing'
3
-
4
- describe 'Student Sheet' do
5
-
6
- before { as :admin }
7
-
8
- let!(:student) { create(:student, name: 'John', surname: 'Doe') }
9
- let!(:student2) { create(:student, name: 'Susumu', surname: 'Yokota') }
10
-
11
- context 'download' do
12
- it 'downloads registration sheet' do
13
- visit gaku.students_path
14
- # click_link 'import-students-link'
15
- # click_link 'get_registration_csv'
16
-
17
- # page.response_headers['Content-Type'].should eq "text/csv"
18
- # page.should have_content 'surname,name,surname_reading,name_reading,gender,phone,email,birth_date,admitted'
19
- end
20
- end
21
-
22
- context 'upload' do
23
- it 'imports from sheet' do
24
- visit gaku.students_path
25
- expect do
26
- click_link 'import-students-link'
27
- select 'Roster', from: 'importer_importer_type'
28
- absolute_path = Rails.root + '../support/sample_roster.xls'
29
- attach_file 'importer_data_file', absolute_path
30
- click_button 'Submit'
31
- end.to change(Gaku::Student, :count).by 2
32
-
33
- #page.should have_content 'created students:2'
34
- end
35
- end
36
-
37
- end
@@ -1,13 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Gaku::Importers::Students::Roster do
4
-
5
- it 'add new job to worker' do
6
- file_f = create(:import_file)
7
- worker = Gaku::Importers::Students::RosterWorker
8
- worker.perform_async(file_f.id)
9
- expect(worker).to have(1).enqueued.jobs
10
- end
11
-
12
- end
13
-