From aad2838ab5363986af0d12c98a137364207dfd4b Mon Sep 17 00:00:00 2001 From: Onur Baran Date: Sat, 18 Jan 2020 16:37:32 +0300 Subject: [PATCH 001/970] learning targets and learning outcomes management --- app/models/icc.rb | 2 ++ app/models/sncc.rb | 10 ++++++++++ app/models/standard.rb | 2 ++ app/models/target.rb | 2 ++ config/routes.rb | 3 ++- config/routes/standard.rb | 10 ++++++++++ db/migrate/20200112122101_create_standards.rb | 13 +++++++++++++ db/migrate/20200112133316_create_snccs.rb | 15 +++++++++++++++ db/migrate/20200112140816_create_iccs.rb | 18 ++++++++++++++++++ db/migrate/20200112141809_create_targets.rb | 12 ++++++++++++ test/fixtures/iccs.yml | 15 +++++++++++++++ test/fixtures/snccs.yml | 15 +++++++++++++++ test/fixtures/standards.yml | 13 +++++++++++++ test/fixtures/targets.yml | 9 +++++++++ test/models/icc_test.rb | 7 +++++++ test/models/sncc_test.rb | 7 +++++++ test/models/standard_test.rb | 7 +++++++ test/models/target_test.rb | 7 +++++++ 18 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 app/models/icc.rb create mode 100644 app/models/sncc.rb create mode 100644 app/models/standard.rb create mode 100644 app/models/target.rb create mode 100644 config/routes/standard.rb create mode 100644 db/migrate/20200112122101_create_standards.rb create mode 100644 db/migrate/20200112133316_create_snccs.rb create mode 100644 db/migrate/20200112140816_create_iccs.rb create mode 100644 db/migrate/20200112141809_create_targets.rb create mode 100644 test/fixtures/iccs.yml create mode 100644 test/fixtures/snccs.yml create mode 100644 test/fixtures/standards.yml create mode 100644 test/fixtures/targets.yml create mode 100644 test/models/icc_test.rb create mode 100644 test/models/sncc_test.rb create mode 100644 test/models/standard_test.rb create mode 100644 test/models/target_test.rb diff --git a/app/models/icc.rb b/app/models/icc.rb new file mode 100644 index 000000000..e4ff036e0 --- /dev/null +++ b/app/models/icc.rb @@ -0,0 +1,2 @@ +class Icc < ApplicationRecord +end diff --git a/app/models/sncc.rb b/app/models/sncc.rb new file mode 100644 index 000000000..749bede46 --- /dev/null +++ b/app/models/sncc.rb @@ -0,0 +1,10 @@ +class Sncc < ApplicationRecord + belongs_to :institution + + has_many :icc, dependent: :destroy + + validates :institution_id, presence: true + validates :code, presence: true, length: { maximum: 10 } + validates :name_tr, presence: true, length: { maximum: 255 } + validates :name_en, presence: true, length: { maximum: 255 } +end diff --git a/app/models/standard.rb b/app/models/standard.rb new file mode 100644 index 000000000..889866e4b --- /dev/null +++ b/app/models/standard.rb @@ -0,0 +1,2 @@ +class Standard < ApplicationRecord +end diff --git a/app/models/target.rb b/app/models/target.rb new file mode 100644 index 000000000..c36f2a615 --- /dev/null +++ b/app/models/target.rb @@ -0,0 +1,2 @@ +class Target < ApplicationRecord +end diff --git a/config/routes.rb b/config/routes.rb index 7b0e1381f..c5b1253ae 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,7 +9,7 @@ end get '/service-worker.js', to: 'service_workers/workers#index' - get '/manifest.json', to: 'service_workers/manifests#index' + get '/manifest.json', to: 'service_workers/manifests#index' root to: 'home#index' draw :account @@ -22,6 +22,7 @@ draw :studentship draw :yoksis draw :meksis + draw :standard resources :units do member do diff --git a/config/routes/standard.rb b/config/routes/standard.rb new file mode 100644 index 000000000..06c1dee3a --- /dev/null +++ b/config/routes/standard.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +namespace :standard do + get '/', to: 'dashboard#index' + + resources :sncc do + resources :iccs + end + +end diff --git a/db/migrate/20200112122101_create_standards.rb b/db/migrate/20200112122101_create_standards.rb new file mode 100644 index 000000000..f44149a8f --- /dev/null +++ b/db/migrate/20200112122101_create_standards.rb @@ -0,0 +1,13 @@ +class CreateStandards < ActiveRecord::Migration[6.0] + def change + create_table :standards do |t| + t.string :version, null: false + t.string :name_tr, null: false, limit: 255 + t.string :name_en, null: false, limit: 255 + + t.timestamps null: false + end + end + + add_index :standards, :version, :unique :true +end diff --git a/db/migrate/20200112133316_create_snccs.rb b/db/migrate/20200112133316_create_snccs.rb new file mode 100644 index 000000000..5d970ff08 --- /dev/null +++ b/db/migrate/20200112133316_create_snccs.rb @@ -0,0 +1,15 @@ +class CreateSnccs < ActiveRecord::Migration[6.0] + def change + create_table :snccs do |t| + t.integer :institution_id, null:false + t.integer :standard_id, null:false + t.string :code, null:false, limit: 10 + t.string :name_tr, null:false, limit: 255 + t.string :name_en, null:false, limit: 255 + + t.timestamps null: false + end + end + + add_index :snccs, [:institution_id, :code], unique: true +end diff --git a/db/migrate/20200112140816_create_iccs.rb b/db/migrate/20200112140816_create_iccs.rb new file mode 100644 index 000000000..3b85052be --- /dev/null +++ b/db/migrate/20200112140816_create_iccs.rb @@ -0,0 +1,18 @@ +class CreateIccs < ActiveRecord::Migration[6.0] + def change + create_table :iccs do |t| + t.integer :institution_id, null:false + t.integer :sncc_id, null:false + t.string :code, null:false, limit: 255 + t.string :name_tr, null:false, limit: 255 + t.string :name_en, null:false, limit: 255 + + t.timestamps + end + end + + add_index :iccs, [:institution_id, :sncc_id, :code], unique: true + add_index :iccs, :institution_id + add_index :iccs, :sncc_id + add_index :iccs, :code +end diff --git a/db/migrate/20200112141809_create_targets.rb b/db/migrate/20200112141809_create_targets.rb new file mode 100644 index 000000000..04d62bbae --- /dev/null +++ b/db/migrate/20200112141809_create_targets.rb @@ -0,0 +1,12 @@ +class CreateTargets < ActiveRecord::Migration[6.0] + def change + create_table :targets do |t| + t.integer :course_id, :null :false + t.integer :icc_id, :null :false + + t.timestamps + end + end + + add_index :targets, [:course_id, :icc_id], :unique :true +end diff --git a/test/fixtures/iccs.yml b/test/fixtures/iccs.yml new file mode 100644 index 000000000..43d347e1a --- /dev/null +++ b/test/fixtures/iccs.yml @@ -0,0 +1,15 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + institution_id: 1 + sncc_id: 1 + code: MyString + name_tr: MyString + name_en: MyString + +two: + institution_id: 1 + sncc_id: 1 + code: MyString + name_tr: MyString + name_en: MyString diff --git a/test/fixtures/snccs.yml b/test/fixtures/snccs.yml new file mode 100644 index 000000000..05c9c7622 --- /dev/null +++ b/test/fixtures/snccs.yml @@ -0,0 +1,15 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + institution_id: 1 + standard_id: 1 + code: MyString + name_tr: MyString + name_en: MyString + +two: + institution_id: 1 + standard_id: 1 + code: MyString + name_tr: MyString + name_en: MyString diff --git a/test/fixtures/standards.yml b/test/fixtures/standards.yml new file mode 100644 index 000000000..54fdbbc47 --- /dev/null +++ b/test/fixtures/standards.yml @@ -0,0 +1,13 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + code: MyString + version: MyString + name_tr: MyString + name_en: MyString + +two: + code: MyString + version: MyString + name_tr: MyString + name_en: MyString diff --git a/test/fixtures/targets.yml b/test/fixtures/targets.yml new file mode 100644 index 000000000..14492c37c --- /dev/null +++ b/test/fixtures/targets.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + course_id: 1 + icc_id: 1 + +two: + course_id: 1 + icc_id: 1 diff --git a/test/models/icc_test.rb b/test/models/icc_test.rb new file mode 100644 index 000000000..9d6f3348d --- /dev/null +++ b/test/models/icc_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class IccTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/sncc_test.rb b/test/models/sncc_test.rb new file mode 100644 index 000000000..f84be4d60 --- /dev/null +++ b/test/models/sncc_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SnccTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/standard_test.rb b/test/models/standard_test.rb new file mode 100644 index 000000000..d40467bab --- /dev/null +++ b/test/models/standard_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class StandardTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/target_test.rb b/test/models/target_test.rb new file mode 100644 index 000000000..fb4f2c3be --- /dev/null +++ b/test/models/target_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TargetTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From 2ced0964c54c923e158c4db549055c5aaa8e237b Mon Sep 17 00:00:00 2001 From: Onur Baran Date: Tue, 21 Jan 2020 14:34:04 +0300 Subject: [PATCH 002/970] learning targets and learning outcomes management --- app/models/sncc.rb | 2 + db/migrate/20200112122101_create_standards.rb | 25 +++++++++--- db/migrate/20200112133316_create_snccs.rb | 26 ++++++++---- db/migrate/20200112140816_create_iccs.rb | 40 ++++++++++++++----- db/migrate/20200112141809_create_targets.rb | 13 ++++-- 5 files changed, 80 insertions(+), 26 deletions(-) diff --git a/app/models/sncc.rb b/app/models/sncc.rb index 749bede46..d2dce6dd9 100644 --- a/app/models/sncc.rb +++ b/app/models/sncc.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Sncc < ApplicationRecord belongs_to :institution diff --git a/db/migrate/20200112122101_create_standards.rb b/db/migrate/20200112122101_create_standards.rb index f44149a8f..125e47183 100644 --- a/db/migrate/20200112122101_create_standards.rb +++ b/db/migrate/20200112122101_create_standards.rb @@ -1,13 +1,28 @@ +# frozen_string_literal: true + class CreateStandards < ActiveRecord::Migration[6.0] def change create_table :standards do |t| - t.string :version, null: false - t.string :name_tr, null: false, limit: 255 - t.string :name_en, null: false, limit: 255 + t.string :version + t.string :name_tr + t.string :name_en t.timestamps null: false end - end - add_index :standards, :version, :unique :true + add_index :standards, :version + add_index :standards, :name_tr + add_index :standards, :name_en + + add_length_constraint :standards, :version, less_than_or_equal_to: 50 + add_length_constraint :standards, :name_tr, less_than_or_equal_to: 255 + add_length_constraint :standards, :name_en, less_than_or_equal_to: 255 + + add_presence_constraint :standards, :version + add_presence_constraint :standards, :name_tr + add_presence_constraint :standards, :name_en + + add_unique_constraint :standards, [:version, :name_tr] + add_unique_constraint :standards, [:version, :name_en] + end end diff --git a/db/migrate/20200112133316_create_snccs.rb b/db/migrate/20200112133316_create_snccs.rb index 5d970ff08..268dfce99 100644 --- a/db/migrate/20200112133316_create_snccs.rb +++ b/db/migrate/20200112133316_create_snccs.rb @@ -1,15 +1,27 @@ +# frozen_string_literal: true + class CreateSnccs < ActiveRecord::Migration[6.0] def change create_table :snccs do |t| - t.integer :institution_id, null:false - t.integer :standard_id, null:false - t.string :code, null:false, limit: 10 - t.string :name_tr, null:false, limit: 255 - t.string :name_en, null:false, limit: 255 + t.integer :institution_id + t.integer :standard_id + t.string :code + t.string :name_tr + t.string :name_en t.timestamps null: false end - end - add_index :snccs, [:institution_id, :code], unique: true + add_length_constraint :snccs, :institution_id, greater_than_or_equal_to: 0 + add_length_constraint :snccs, :standard_id, greater_than_or_equal_to: 0 + add_length_constraint :snccs, :code, less_than_or_equal_to: 10 + add_length_constraint :snccs, :name_tr, less_than_or_equal_to: 255 + add_length_constraint :snccs, :name_en, less_than_or_equal_to: 255 + + add_presence_constraint :snccs, :code + add_presence_constraint :snccs, :name_tr + add_presence_constraint :snccs, :name_en + + add_unique_constraint :snccs, [:institution_id, :code] + end end diff --git a/db/migrate/20200112140816_create_iccs.rb b/db/migrate/20200112140816_create_iccs.rb index 3b85052be..83884be35 100644 --- a/db/migrate/20200112140816_create_iccs.rb +++ b/db/migrate/20200112140816_create_iccs.rb @@ -1,18 +1,38 @@ +# frozen_string_literal: true + class CreateIccs < ActiveRecord::Migration[6.0] def change create_table :iccs do |t| - t.integer :institution_id, null:false - t.integer :sncc_id, null:false - t.string :code, null:false, limit: 255 - t.string :name_tr, null:false, limit: 255 - t.string :name_en, null:false, limit: 255 + t.integer :institution_id + t.integer :sncc_id + t.string :code + t.string :name_tr + t.string :name_en t.timestamps end - end - add_index :iccs, [:institution_id, :sncc_id, :code], unique: true - add_index :iccs, :institution_id - add_index :iccs, :sncc_id - add_index :iccs, :code + add_index :iccs, :institution_id + add_index :iccs, :sncc_id + add_index :iccs, :code + + add_length_constraint :iccs, :institution_id, greater_than_or_equal_to: 0 + add_length_constraint :iccs, :sncc_id, greater_than_or_equal_to: 0 + add_length_constraint :iccs, :code, less_than_or_equal_to: 255 + add_length_constraint :iccs, :name_tr, less_than_or_equal_to: 255 + add_length_constraint :iccs, :name_en, less_than_or_equal_to: 255 + + add_numericality_constraint :iccs, :institution_id, + greater_than_or_equal_to: 0 + add_numericality_constraint :iccs, :sncc_id, + greater_than_or_equal_to: 0 + + add_presence_constraint :iccs, :institution_id + add_presence_constraint :iccs, :sncc_id + add_presence_constraint :iccs, :code + add_presence_constraint :iccs, :name_tr + add_presence_constraint :iccs, :name_en + + add_unique_constraint :iccs, [:institution_id, :sncc_id, :code] + end end diff --git a/db/migrate/20200112141809_create_targets.rb b/db/migrate/20200112141809_create_targets.rb index 04d62bbae..ee01cdeaa 100644 --- a/db/migrate/20200112141809_create_targets.rb +++ b/db/migrate/20200112141809_create_targets.rb @@ -1,12 +1,17 @@ +# frozen_string_literal: true + class CreateTargets < ActiveRecord::Migration[6.0] def change create_table :targets do |t| - t.integer :course_id, :null :false - t.integer :icc_id, :null :false + t.integer :course_id + t.integer :icc_id t.timestamps end - end - add_index :targets, [:course_id, :icc_id], :unique :true + add_length_constraint :targets, :course_id, greater_than_or_equal_to: 0 + add_length_constraint :targets, :icc_id, greater_than_or_equal_to: 0 + + add_unique_constraint :targets, [:course_id, :icc_id] + end end From 171dcc86dd3cb4aa90e7a422a7a97ee7bf6b1bdf Mon Sep 17 00:00:00 2001 From: Onur Baran Date: Wed, 22 Jan 2020 23:19:36 +0300 Subject: [PATCH 003/970] institution_id -> unit_id --- db/migrate/20200112133316_create_snccs.rb | 6 +++--- db/migrate/20200112140816_create_iccs.rb | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/db/migrate/20200112133316_create_snccs.rb b/db/migrate/20200112133316_create_snccs.rb index 268dfce99..699ca2911 100644 --- a/db/migrate/20200112133316_create_snccs.rb +++ b/db/migrate/20200112133316_create_snccs.rb @@ -3,7 +3,7 @@ class CreateSnccs < ActiveRecord::Migration[6.0] def change create_table :snccs do |t| - t.integer :institution_id + t.integer :unit_id t.integer :standard_id t.string :code t.string :name_tr @@ -12,7 +12,7 @@ def change t.timestamps null: false end - add_length_constraint :snccs, :institution_id, greater_than_or_equal_to: 0 + add_length_constraint :snccs, :unit_id, greater_than_or_equal_to: 0 add_length_constraint :snccs, :standard_id, greater_than_or_equal_to: 0 add_length_constraint :snccs, :code, less_than_or_equal_to: 10 add_length_constraint :snccs, :name_tr, less_than_or_equal_to: 255 @@ -22,6 +22,6 @@ def change add_presence_constraint :snccs, :name_tr add_presence_constraint :snccs, :name_en - add_unique_constraint :snccs, [:institution_id, :code] + add_unique_constraint :snccs, [:unit_id, :code] end end diff --git a/db/migrate/20200112140816_create_iccs.rb b/db/migrate/20200112140816_create_iccs.rb index 83884be35..b1ee48f5c 100644 --- a/db/migrate/20200112140816_create_iccs.rb +++ b/db/migrate/20200112140816_create_iccs.rb @@ -3,7 +3,7 @@ class CreateIccs < ActiveRecord::Migration[6.0] def change create_table :iccs do |t| - t.integer :institution_id + t.integer :unit_id t.integer :sncc_id t.string :code t.string :name_tr @@ -12,27 +12,27 @@ def change t.timestamps end - add_index :iccs, :institution_id + add_index :iccs, :unit_id add_index :iccs, :sncc_id add_index :iccs, :code - add_length_constraint :iccs, :institution_id, greater_than_or_equal_to: 0 + add_length_constraint :iccs, :unit_id, greater_than_or_equal_to: 0 add_length_constraint :iccs, :sncc_id, greater_than_or_equal_to: 0 add_length_constraint :iccs, :code, less_than_or_equal_to: 255 add_length_constraint :iccs, :name_tr, less_than_or_equal_to: 255 add_length_constraint :iccs, :name_en, less_than_or_equal_to: 255 - add_numericality_constraint :iccs, :institution_id, + add_numericality_constraint :iccs, :unit_id, greater_than_or_equal_to: 0 add_numericality_constraint :iccs, :sncc_id, greater_than_or_equal_to: 0 - add_presence_constraint :iccs, :institution_id + add_presence_constraint :iccs, :unit_id add_presence_constraint :iccs, :sncc_id add_presence_constraint :iccs, :code add_presence_constraint :iccs, :name_tr add_presence_constraint :iccs, :name_en - add_unique_constraint :iccs, [:institution_id, :sncc_id, :code] + add_unique_constraint :iccs, [:unit_id, :sncc_id, :code] end end From fd339ebff59673e358deb3034f5cb52eef87ffd3 Mon Sep 17 00:00:00 2001 From: Onur Baran Date: Wed, 22 Jan 2020 23:53:02 +0300 Subject: [PATCH 004/970] model relations --- app/models/course.rb | 1 + app/models/icc.rb | 11 +++++++++++ app/models/sncc.rb | 7 ++++--- app/models/standard.rb | 7 +++++++ app/models/target.rb | 2 ++ app/models/unit.rb | 1 + test/fixtures/snccs.yml | 4 ++-- 7 files changed, 28 insertions(+), 5 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index 3d260eee6..ddf6ab227 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -28,6 +28,7 @@ class Course < ApplicationRecord belongs_to :unit has_many :curriculum_courses, dependent: :destroy has_many :available_courses, through: :curriculum_courses + has_many :targets, dependent: :delete_all # validations validates :code, presence: true, uniqueness: true, length: { maximum: 255 } diff --git a/app/models/icc.rb b/app/models/icc.rb index e4ff036e0..e44bd4969 100644 --- a/app/models/icc.rb +++ b/app/models/icc.rb @@ -1,2 +1,13 @@ +# frozen_string_literal: true + class Icc < ApplicationRecord + belongs_to :sncc + + has_many :targets, dependent: :delete_all + + validates :unit_id, presence: true + validates :sncc_id, presence: true + validates :code, presence: true, length: { maximum: 10 } + validates :name_tr, presence: true, length: { maximum: 255 } + validates :name_en, presence: true, length: { maximum: 255 } end diff --git a/app/models/sncc.rb b/app/models/sncc.rb index d2dce6dd9..b513950e9 100644 --- a/app/models/sncc.rb +++ b/app/models/sncc.rb @@ -1,11 +1,12 @@ # frozen_string_literal: true class Sncc < ApplicationRecord - belongs_to :institution + belongs_to :unit + belongs_to :standard - has_many :icc, dependent: :destroy + has_many :iccs, dependent: :destroy - validates :institution_id, presence: true + validates :unit_id, presence: true validates :code, presence: true, length: { maximum: 10 } validates :name_tr, presence: true, length: { maximum: 255 } validates :name_en, presence: true, length: { maximum: 255 } diff --git a/app/models/standard.rb b/app/models/standard.rb index 889866e4b..cf48140a9 100644 --- a/app/models/standard.rb +++ b/app/models/standard.rb @@ -1,2 +1,9 @@ +# frozen_string_literal: true + class Standard < ApplicationRecord + has_many :snccs + + validates :version, presence: true, length: { maximum: 50 } + validates :name_tr, presence: true, length: { maximum: 255 } + validates :name_en, presence: true, length: { maximum: 255 } end diff --git a/app/models/target.rb b/app/models/target.rb index c36f2a615..09691ef64 100644 --- a/app/models/target.rb +++ b/app/models/target.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + class Target < ApplicationRecord end diff --git a/app/models/unit.rb b/app/models/unit.rb index 03af71455..42b226263 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -47,6 +47,7 @@ class Unit < ApplicationRecord has_many :available_courses, dependent: :destroy has_many :unit_calendars, dependent: :destroy has_many :calendars, through: :unit_calendars + has_many :snccs, dependent: :destroy # validations validates :name, presence: true, diff --git a/test/fixtures/snccs.yml b/test/fixtures/snccs.yml index 05c9c7622..2015dcc70 100644 --- a/test/fixtures/snccs.yml +++ b/test/fixtures/snccs.yml @@ -1,14 +1,14 @@ # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html one: - institution_id: 1 + unit_id: 1 standard_id: 1 code: MyString name_tr: MyString name_en: MyString two: - institution_id: 1 + unit_id: 1 standard_id: 1 code: MyString name_tr: MyString From 2c3a08ec4e3ba5761c7ad87f2a1e420c473ac34a Mon Sep 17 00:00:00 2001 From: Onur Baran Date: Wed, 22 Jan 2020 23:54:39 +0300 Subject: [PATCH 005/970] model relations --- app/models/target.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/target.rb b/app/models/target.rb index 09691ef64..8d6478faf 100644 --- a/app/models/target.rb +++ b/app/models/target.rb @@ -1,4 +1,9 @@ # frozen_string_literal: true class Target < ApplicationRecord + belongs_to :course + belongs_to :icc + + validates :course_id, presence: true + validates :icc_id, presence: true, uniqueness: { scope: :course_id } end From 1302afda01215ac4184f4ec1e6d0e22749965a1c Mon Sep 17 00:00:00 2001 From: Onur Baran Date: Fri, 24 Jan 2020 16:17:08 +0300 Subject: [PATCH 006/970] question bank (quba) --- app/controllers/quba/questions_controller.rb | 10 +++ app/models/question.rb | 63 +++++++++++++++++++ app/models/question_choice.rb | 11 ++++ app/models/source_book.rb | 36 +++++++++++ db/migrate/20200124111848_create_questions.rb | 53 ++++++++++++++++ .../20200124125908_create_source_books.rb | 40 ++++++++++++ .../20200124131038_create_question_choices.rb | 19 ++++++ test/fixtures/question_choices.yml | 9 +++ test/fixtures/questions.yml | 37 +++++++++++ test/fixtures/source_books.yml | 23 +++++++ test/models/question_choice_test.rb | 7 +++ test/models/question_test.rb | 7 +++ test/models/source_book_test.rb | 7 +++ 13 files changed, 322 insertions(+) create mode 100644 app/controllers/quba/questions_controller.rb create mode 100644 app/models/question.rb create mode 100644 app/models/question_choice.rb create mode 100644 app/models/source_book.rb create mode 100644 db/migrate/20200124111848_create_questions.rb create mode 100644 db/migrate/20200124125908_create_source_books.rb create mode 100644 db/migrate/20200124131038_create_question_choices.rb create mode 100644 test/fixtures/question_choices.yml create mode 100644 test/fixtures/questions.yml create mode 100644 test/fixtures/source_books.yml create mode 100644 test/models/question_choice_test.rb create mode 100644 test/models/question_test.rb create mode 100644 test/models/source_book_test.rb diff --git a/app/controllers/quba/questions_controller.rb b/app/controllers/quba/questions_controller.rb new file mode 100644 index 000000000..4beb71c16 --- /dev/null +++ b/app/controllers/quba/questions_controller.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Quba + class QuestionsController < ApplicationController + include SearchableModule + + def index + end + end +end diff --git a/app/models/question.rb b/app/models/question.rb new file mode 100644 index 000000000..222961b7c --- /dev/null +++ b/app/models/question.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +class Question < ApplicationRecord + enum status: [:draft, :editor, :master, :approve] + + belongs_to :icc + belongs_to :answer, foreign_key: :answer_id, class_name: 'QuestionChoice' + belongs_to :author, foreign_key: :author_id, class_name: 'User' + belongs_to :editor, foreign_key: :editor_id, class_name: 'User' + belongs_to :master, foreign_key: :master_id, class_name: 'User' + belongs_to :parent, foreign_key: :parent_id, class_name: 'Question' + belongs_to :unit + belongs_to :source_book + + has_many :question_choices, dependent: :delete_all + + validates :unit_id, presence: true + validates :icc_id, presence: true + validates :author_id, presence: true + validates :editor_id, numericality: { allow_nil: true } + validates :master_id, numericality: { allow_nil: true } + validates :parent_id, numericality: { allow_nil: true } + validates :source_book_id, presence: true + validates :use_count, numericality: { only_integer: true, greater_than_or_equal_to: 0 } + validates :bloom, inclusion: { in: (1..6) } + validates :degree, inclusion: { in: (1..5) } + validates :lang, inclusion: { in: [0, 1] } + validates :image, length: { maximum: 1.megabytes, message: 'Maximum 1MB', if: :image? } + validates :title, presence: true + validates :explanation, length: { maximum: 400 } + + accepts_nested_attributes_for :question_choices, + allow_destroy: true, + reject_if: proc { |a| a[:content].blank? } + + before_save lambda { + if title.presence + title_ = title.gsub(' ', '') + title_ = ActionController::Base.helpers.sanitize(title_, tags: %w[p u ul li]) + self.title = title_.squish + end + + self.explanation = explanation.squish if explanation.presence + } + + mount_uploader :image, QuestionImageUploader + + def build_choices(choice_count = 5) + choice_count.times { question_choices.build } + end + + def set_answer + update(answer_id: question_choices.first.id) + end + + def self.degrees + (1..5) + end + + def self.blooms + (1..6) + end +end diff --git a/app/models/question_choice.rb b/app/models/question_choice.rb new file mode 100644 index 000000000..2a34a5384 --- /dev/null +++ b/app/models/question_choice.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class QuestionChoice < ApplicationRecord + belongs_to :question + + validates :content, length: { maximum: 500 } + + before_save lambda { + self.content = content.squish if content.presence + } +end diff --git a/app/models/source_book.rb b/app/models/source_book.rb new file mode 100644 index 000000000..32a682cee --- /dev/null +++ b/app/models/source_book.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +class SourceBook < ApplicationRecord + enum status: [:inactive, :active] + + belongs_to :unit + + has_many :questions + + validates :unit_id, presence: true + + validates :edition, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 1 } + validates :publish_year, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 } + validates :name, presence: true, length: { maximum: 100 } + validates :isbn, presence: true, length: { maximum: 50 } + validates :author, presence: true, length: { maximum: 150 } + validates :image, length: { maximum: 1.megabytes, message: 'Maximum 1MB', if: :image? } + validates :explanation, length: { maximum: 400 } + + mount_uploader :image, SourceBookImageUploader + + before_save lambda { + self.name = name.squish if name.presence + self.isbn = isbn.delete(' ') if isbn.presence + self.author = author.squish if author.presence + self.explanation = explanation.squish if explanation.presence + } + + def self.editions + (1..40) + end + + def self.years + (1900..Time.current.year).to_a.reverse + end +end diff --git a/db/migrate/20200124111848_create_questions.rb b/db/migrate/20200124111848_create_questions.rb new file mode 100644 index 000000000..71d0e039e --- /dev/null +++ b/db/migrate/20200124111848_create_questions.rb @@ -0,0 +1,53 @@ +class CreateQuestions < ActiveRecord::Migration[6.0] + def change + create_table :questions do |t| + t.integer :unit_id + t.integer :icc_id + t.integer :answer_id, default: 0 + t.integer :author_id + t.integer :editor_id + t.integer :master_id + t.integer :parent_id + t.integer :source_book_id + t.integer :use_count, default: 0 + t.integer :bloom, default: 1 + t.integer :degree, default: 1 + t.integer :lang, default: 0 + t.string :image + t.text :title + t.string :explanation + t.integer :status, default: 0 + + t.timestamps + end + + add_index :questions, :unit_id + add_index :questions, :author_id + add_index :questions, :editor_id + add_index :questions, :master_id + + add_length_constraint :questions, :title, less_than_or_equal_to: 255 + add_length_constraint :questions, :explanation, less_than_or_equal_to: 400 + + add_numericality_constraint :questions, :unit_id, greater_than_or_equal_to: 0 + add_numericality_constraint :questions, :icc_id, greater_than_or_equal_to: 0 + add_numericality_constraint :questions, :answer_id, greater_than_or_equal_to: 0 + add_numericality_constraint :questions, :author_id, greater_than_or_equal_to: 0 + add_numericality_constraint :questions, :editor_id, greater_than_or_equal_to: 0 + add_numericality_constraint :questions, :master_id, greater_than_or_equal_to: 0 + add_numericality_constraint :questions, :parent_id, greater_than_or_equal_to: 0 + add_numericality_constraint :questions, :source_book_id, greater_than_or_equal_to: 0 + + add_presence_constraint :questions, :unit_id + add_presence_constraint :questions, :icc_id + add_presence_constraint :questions, :answer_id + add_presence_constraint :questions, :author_id + add_presence_constraint :questions, :source_book_id + add_presence_constraint :questions, :use_count + add_presence_constraint :questions, :bloom + add_presence_constraint :questions, :degree + add_presence_constraint :questions, :lang + add_presence_constraint :questions, :title + add_presence_constraint :questions, :status + end +end diff --git a/db/migrate/20200124125908_create_source_books.rb b/db/migrate/20200124125908_create_source_books.rb new file mode 100644 index 000000000..57b3bb270 --- /dev/null +++ b/db/migrate/20200124125908_create_source_books.rb @@ -0,0 +1,40 @@ +class CreateSourceBooks < ActiveRecord::Migration[6.0] + def change + create_table :source_books do |t| + t.integer :unit_id + t.integer :status, default: 0 + t.integer :editon + t.integer :publish_year + t.string :name + t.string :isbn + t.string :author + t.string :image + t.string :explanation + + t.timestamps + end + + add_index :source_books, :unit_id + add_index :source_books, :name + add_index :source_books, :isbn + add_index :source_books, :author + + add_length_constraint :source_books, :name, less_than_or_equal_to: 100 + add_length_constraint :source_books, :isbn, less_than_or_equal_to: 50 + add_length_constraint :source_books, :author, less_than_or_equal_to: 150 + add_length_constraint :source_books, :image, less_than_or_equal_to: 100 + add_length_constraint :source_books, :explanation, less_than_or_equal_to: 400 + + add_numericality_constraint :source_books, :unit_id, greater_than_or_equal_to: 0 + + add_presence_constraint :source_books, :unit_id + add_presence_constraint :source_books, :status + add_presence_constraint :source_books, :editon + add_presence_constraint :source_books, :publish_year + add_presence_constraint :source_books, :name + add_presence_constraint :source_books, :isbn + add_presence_constraint :source_books, :author + add_presence_constraint :source_books, :image + add_presence_constraint :source_books, :explanation + end +end diff --git a/db/migrate/20200124131038_create_question_choices.rb b/db/migrate/20200124131038_create_question_choices.rb new file mode 100644 index 000000000..1d930401c --- /dev/null +++ b/db/migrate/20200124131038_create_question_choices.rb @@ -0,0 +1,19 @@ +class CreateQuestionChoices < ActiveRecord::Migration[6.0] + def change + create_table :question_choices do |t| + t.integer :question_id + t.string :content + + t.timestamps + end + + add_index :question_choices, :question_id + + add_length_constraint :question_choices, :content, less_than_or_equal_to: 500 + + add_numericality_constraint :question_choices, :question_id, greater_than_or_equal_to: 0 + + add_presence_constraint :question_choices, :question_id + add_presence_constraint :question_choices, :content + end +end diff --git a/test/fixtures/question_choices.yml b/test/fixtures/question_choices.yml new file mode 100644 index 000000000..37373cff0 --- /dev/null +++ b/test/fixtures/question_choices.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + question_id: 1 + content: MyString + +two: + question_id: 1 + content: MyString diff --git a/test/fixtures/questions.yml b/test/fixtures/questions.yml new file mode 100644 index 000000000..cc2cd45c7 --- /dev/null +++ b/test/fixtures/questions.yml @@ -0,0 +1,37 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + unit_id: 1 + icc_id: 1 + answer_id: 1 + author_id: 1 + editor_id: 1 + master_id: 1 + parent_id: 1 + source_book_id: 1 + use_count: 1 + bloom: 1 + degree: 1 + lang: 1 + image: MyString + title: MyText + explanation: MyString + status: 1 + +two: + unit_id: 1 + icc_id: 1 + answer_id: 1 + author_id: 1 + editor_id: 1 + master_id: 1 + parent_id: 1 + source_book_id: 1 + use_count: 1 + bloom: 1 + degree: 1 + lang: 1 + image: MyString + title: MyText + explanation: MyString + status: 1 diff --git a/test/fixtures/source_books.yml b/test/fixtures/source_books.yml new file mode 100644 index 000000000..256f3659e --- /dev/null +++ b/test/fixtures/source_books.yml @@ -0,0 +1,23 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + unit_id: 1 + status: 1 + editon: 1 + publish_year: 1 + name: MyString + isbn: MyString + author: MyString + image: MyString + explanation: MyString + +two: + unit_id: 1 + status: 1 + editon: 1 + publish_year: 1 + name: MyString + isbn: MyString + author: MyString + image: MyString + explanation: MyString diff --git a/test/models/question_choice_test.rb b/test/models/question_choice_test.rb new file mode 100644 index 000000000..29456ee56 --- /dev/null +++ b/test/models/question_choice_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class QuestionChoiceTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/question_test.rb b/test/models/question_test.rb new file mode 100644 index 000000000..88f6ea7fa --- /dev/null +++ b/test/models/question_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class QuestionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/source_book_test.rb b/test/models/source_book_test.rb new file mode 100644 index 000000000..2c2f9a635 --- /dev/null +++ b/test/models/source_book_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SourceBookTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From b516bf03f315fb44fb2ca35081d405e5384358b4 Mon Sep 17 00:00:00 2001 From: Onur Baran Date: Sat, 25 Jan 2020 15:28:34 +0300 Subject: [PATCH 007/970] open-ended questions were added. --- app/models/open_ended_question.rb | 55 +++++++++++++++++++ app/models/unit.rb | 4 ++ app/models/user.rb | 8 +++ ...00125120734_create_open_ended_questions.rb | 54 ++++++++++++++++++ test/fixtures/open_ended_questions.yml | 37 +++++++++++++ test/models/open_ended_question_test.rb | 7 +++ 6 files changed, 165 insertions(+) create mode 100644 app/models/open_ended_question.rb create mode 100644 db/migrate/20200125120734_create_open_ended_questions.rb create mode 100644 test/fixtures/open_ended_questions.yml create mode 100644 test/models/open_ended_question_test.rb diff --git a/app/models/open_ended_question.rb b/app/models/open_ended_question.rb new file mode 100644 index 000000000..d5f5bb401 --- /dev/null +++ b/app/models/open_ended_question.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +class OpenEndedQuestion < ApplicationRecord + enum status: [:draft, :editor, :master, :approve] + + belongs_to :icc + belongs_to :author, foreign_key: :author_id, class_name: 'User' + belongs_to :editor, foreign_key: :editor_id, class_name: 'User' + belongs_to :master, foreign_key: :master_id, class_name: 'User' + belongs_to :parent, foreign_key: :parent_id, class_name: 'OpenEndedQuestion' + belongs_to :unit + belongs_to :source_book + + validates :unit_id, presence: true + validates :icc_id, presence: true + validates :author_id, presence: true + validates :editor_id, numericality: { allow_nil: true } + validates :master_id, numericality: { allow_nil: true } + validates :parent_id, numericality: { allow_nil: true } + validates :source_book_id, presence: true + validates :use_count, numericality: { only_integer: true, greater_than_or_equal_to: 0 } + validates :bloom, inclusion: { in: (1..6) } + validates :degree, inclusion: { in: (1..5) } + validates :lang, inclusion: { in: [0, 1] } + validates :image, length: { maximum: 1.megabytes, message: 'Maximum 1MB', if: :image? } + validates :title, presence: true + validates :answer, presence: true + validates :explanation, length: { maximum: 400 } + + before_save lambda { + if title.presence + title_ = title.gsub(' ', '') + title_ = ActionController::Base.helpers.sanitize(title_, tags: %w[p u ul li]) + self.title = title_.squish + end + + if answer.presence + answer_ = answer.gsub(' ', '') + answer_ = ActionController::Base.helpers.sanitize(answer_, tags: %w[p u ul li]) + self.answer = answer_.squish + end + + self.explanation = explanation.squish if explanation.presence + } + + mount_uploader :image, QuestionImageUploader + + def self.degrees + (1..5) + end + + def self.blooms + (1..6) + end +end diff --git a/app/models/unit.rb b/app/models/unit.rb index 42b226263..0d2fb3842 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -27,6 +27,7 @@ class Unit < ApplicationRecord belongs_to :unit_instruction_type, optional: true belongs_to :unit_instruction_language, optional: true belongs_to :university_type, optional: true + has_many :duties, dependent: :destroy has_many :employees, through: :duties has_many :students, dependent: :nullify @@ -48,6 +49,9 @@ class Unit < ApplicationRecord has_many :unit_calendars, dependent: :destroy has_many :calendars, through: :unit_calendars has_many :snccs, dependent: :destroy + has_many :source_books, dependent: :destroy + has_many :questions, dependent: :destroy + has_many :open_ended_questions, dependent: :destroy # validations validates :name, presence: true, diff --git a/app/models/user.rb b/app/models/user.rb index 3c2cc4559..85085f013 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -34,6 +34,7 @@ class User < ApplicationRecord # relations has_one_attached :avatar + has_many :academic_credentials, dependent: :destroy has_many :addresses, dependent: :destroy has_many :articles, dependent: :destroy @@ -58,6 +59,13 @@ class User < ApplicationRecord foreign_key: :id_number, dependent: :nullify, inverse_of: :user + has_many :author_questions, dependent: :destroy, foreign_key: :author_id, class_name: 'Question' + has_many :editor_questions, dependent: :destroy, foreign_key: :editor_id, class_name: 'Question' + has_many :master_questions, dependent: :destroy, foreign_key: :master_id, class_name: 'Question' + has_many :author_open_ended_questions, dependent: :destroy, foreign_key: :author_id, class_name: 'OpenEndedQuestion' + has_many :editor_open_ended_questions, dependent: :destroy, foreign_key: :editor_id, class_name: 'OpenEndedQuestion' + has_many :master_open_ended_questions, dependent: :destroy, foreign_key: :master_id, class_name: 'OpenEndedQuestion' + # validations validates :email, presence: true, uniqueness: true, length: { maximum: 255 }, 'valid_email_2/email': { mx: true, diff --git a/db/migrate/20200125120734_create_open_ended_questions.rb b/db/migrate/20200125120734_create_open_ended_questions.rb new file mode 100644 index 000000000..2d662abea --- /dev/null +++ b/db/migrate/20200125120734_create_open_ended_questions.rb @@ -0,0 +1,54 @@ +class CreateOpenEndedQuestions < ActiveRecord::Migration[6.0] + def change + create_table :open_ended_questions do |t| + t.integer :unit_id + t.integer :icc_id + t.integer :author_id + t.integer :editor_id + t.integer :master_id + t.integer :parent_id + t.integer :source_book_id + t.integer :use_count, default: 0 + t.integer :bloom, default: 1 + t.integer :degree, default: 1 + t.integer :lang, default: 0 + t.string :image + t.text :title + t.text :answer + t.string :explanation + t.integer :status, default: 0 + + t.timestamps + end + + add_index :open_ended_questions, :unit_id + add_index :open_ended_questions, :author_id + add_index :open_ended_questions, :editor_id + add_index :open_ended_questions, :master_id + + add_length_constraint :open_ended_questions, :title, greater_than: 0 + add_length_constraint :open_ended_questions, :answer, greater_than: 0 + add_length_constraint :open_ended_questions, :explanation, less_than_or_equal_to: 400 + + add_numericality_constraint :open_ended_questions, :unit_id, greater_than_or_equal_to: 0 + add_numericality_constraint :open_ended_questions, :icc_id, greater_than_or_equal_to: 0 + add_numericality_constraint :open_ended_questions, :answer_id, greater_than_or_equal_to: 0 + add_numericality_constraint :open_ended_questions, :author_id, greater_than_or_equal_to: 0 + add_numericality_constraint :open_ended_questions, :editor_id, greater_than_or_equal_to: 0 + add_numericality_constraint :open_ended_questions, :master_id, greater_than_or_equal_to: 0 + add_numericality_constraint :open_ended_questions, :parent_id, greater_than_or_equal_to: 0 + add_numericality_constraint :open_ended_questions, :source_book_id, greater_than_or_equal_to: 0 + + add_presence_constraint :open_ended_questions, :unit_id + add_presence_constraint :open_ended_questions, :icc_id + add_presence_constraint :open_ended_questions, :answer_id + add_presence_constraint :open_ended_questions, :author_id + add_presence_constraint :open_ended_questions, :source_book_id + add_presence_constraint :open_ended_questions, :use_count + add_presence_constraint :open_ended_questions, :bloom + add_presence_constraint :open_ended_questions, :degree + add_presence_constraint :open_ended_questions, :lang + add_presence_constraint :open_ended_questions, :title + add_presence_constraint :open_ended_questions, :status + end +end diff --git a/test/fixtures/open_ended_questions.yml b/test/fixtures/open_ended_questions.yml new file mode 100644 index 000000000..2d2fb91c4 --- /dev/null +++ b/test/fixtures/open_ended_questions.yml @@ -0,0 +1,37 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + unit_id: 1 + icc_id: 1 + author_id: 1 + editor_id: 1 + master_id: 1 + parent_id: 1 + source_book_id: 1 + use_count: 1 + bloom: 1 + degree: 1 + lang: 1 + image: MyString + title: MyText + answer: MyText + explanation: MyString + status: 1 + +two: + unit_id: 1 + icc_id: 1 + author_id: 1 + editor_id: 1 + master_id: 1 + parent_id: 1 + source_book_id: 1 + use_count: 1 + bloom: 1 + degree: 1 + lang: 1 + image: MyString + title: MyText + answer: MyText + explanation: MyString + status: 1 diff --git a/test/models/open_ended_question_test.rb b/test/models/open_ended_question_test.rb new file mode 100644 index 000000000..d56167bf4 --- /dev/null +++ b/test/models/open_ended_question_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class OpenEndedQuestionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From 5b4c3aad50a01fa0d3e0657dac3d1f622260a752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20Can=20Y=C4=B1lmaz?= Date: Thu, 30 Jan 2020 14:31:26 +0300 Subject: [PATCH 008/970] Sidekiq-cron gem'ini ekle --- Gemfile | 3 +++ Gemfile.lock | 10 ++++++++++ app/jobs/sidekiq_rake_job.rb | 15 +++++++++++++++ config/initializers/sidekiq.rb | 3 +++ config/schedule.yml | 10 ++++++++++ 5 files changed, 41 insertions(+) create mode 100644 app/jobs/sidekiq_rake_job.rb create mode 100644 config/schedule.yml diff --git a/Gemfile b/Gemfile index f52da73fa..b9e1565ae 100644 --- a/Gemfile +++ b/Gemfile @@ -81,6 +81,9 @@ gem 'twilio-ruby' # log gem 'lograge' +# cron +gem 'sidekiq-cron' + group :development, :test do gem 'brakeman', require: false gem 'bullet' diff --git a/Gemfile.lock b/Gemfile.lock index d5d64c6d9..f8c18f071 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -169,6 +169,8 @@ GEM rubocop (~> 0.79.0) smart_properties erubi (1.9.0) + et-orbi (1.2.2) + tzinfo execjs (2.7.0) faraday (1.0.0) multipart-post (>= 1.2, < 3) @@ -179,6 +181,9 @@ GEM railties (>= 3.2, < 6.1) friendly_id (5.3.0) activerecord (>= 4.0.0) + fugit (1.3.3) + et-orbi (~> 1.1, >= 1.1.8) + raabro (~> 1.1) globalid (0.4.2) activesupport (>= 4.2.0) groupdate (4.3.0) @@ -281,6 +286,7 @@ GEM pundit (2.1.0) activesupport (>= 3.0.0) pwned (2.0.1) + raabro (1.1.6) rack (2.1.1) rack-attack (6.2.2) rack (>= 1.0, < 3) @@ -375,6 +381,9 @@ GEM rack (>= 2.0.0) rack-protection (>= 2.0.0) redis (>= 4.1.0) + sidekiq-cron (1.1.0) + fugit (~> 1.1) + sidekiq (>= 4.2.1) simple_form (5.0.1) actionpack (>= 5.0) activemodel (>= 5.0) @@ -518,6 +527,7 @@ DEPENDENCIES sassc (~> 2.2.1) sassc-rails sidekiq + sidekiq-cron simple_form simplecov slack-notifier diff --git a/app/jobs/sidekiq_rake_job.rb b/app/jobs/sidekiq_rake_job.rb new file mode 100644 index 000000000..f91b6e3bf --- /dev/null +++ b/app/jobs/sidekiq_rake_job.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class SidekiqRakeJob < ApplicationJob + queue_as :high + + Nokul::Application.load_tasks if Rake::Task.tasks.empty? + + def perform(args = {}) + name = args.fetch('name') + + Rake::Task[name].invoke(*args['params']) + Rake::Task[name].reenable + Rake::Task[name].prerequisite_tasks.each(&:reenable) + end +end diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index f6e662db4..73503cd19 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -3,6 +3,9 @@ if Rails.env.production? Sidekiq.configure_server do |config| config.redis = { url: ENV['REDIS_URL'] } + + schedule_file = 'config/schedule.yml' + Sidekiq::Cron::Job.load_from_hash! YAML.load_file(schedule_file) if File.exist?(schedule_file) && Sidekiq.server? end Sidekiq.configure_client do |config| diff --git a/config/schedule.yml b/config/schedule.yml new file mode 100644 index 000000000..1e6d417ac --- /dev/null +++ b/config/schedule.yml @@ -0,0 +1,10 @@ +# https://github.com/ondrejbartas/sidekiq-cron#adding-cron-job +# first_job: +# cron: "* * * * *" # execute at every minute +# class: SidekiqRakeJob +# queue: high +# args: +# name: fetch:reference +# params: +# - administrative_functions +# - AdministrativeFunction From eedad9b035ddbea0c76409858a679eb59e573539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20Can=20Y=C4=B1lmaz?= Date: Thu, 30 Jan 2020 15:28:21 +0300 Subject: [PATCH 009/970] =?UTF-8?q?Cron=20dok=C3=BCman=C4=B1=20ekle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/app/cron.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 doc/app/cron.md diff --git a/doc/app/cron.md b/doc/app/cron.md new file mode 100644 index 000000000..d95bc2ccd --- /dev/null +++ b/doc/app/cron.md @@ -0,0 +1,55 @@ +--- +author(s): + - Emre Can Yılmaz (@ecylmz) +--- + +Cron +============== + +Uygulamada cron görevleri [sidekiq-cron][sidekiq-cron] gem'i ile gerçekleştiriliyor. + +Yeni bir cron görevi eklenmek istendiğinde ilgili cron'un bir Rake görevi olmalıdır. +Bu rake görevi `lib/tasks` dizini altında uygun bir yerde konumlandırılmalıdır. +Cron görevi olarak eklemek için `config/schedule.yml` dosyasına aşağıdaki örnekteki gibi ekleme yapılır. + +```yml +first_job: + cron: "* * * * *" # execute at every minute + class: SidekiqRakeJob + queue: high + args: + name: fetch:reference + params: + - administrative_functions + - AdministrativeFunction +``` + +Geliştirme Ortamı +----------------- + +Geliştirme ortamında cron'ları denemek için `schedule.yml` dosyasına yukarıdaki gibi ekleme yapabilir ya da konsoldan +aşağıdaki gibi cron eklemesi yapabilirsiniz. + +```ruby +k = "AdministrativeFunction" +args = { name: 'fetch:reference', params: [k.tableize, k] } +job = Sidekiq::Cron::Job.new(name: 'Fetch Reference - every min', cron: '* * * * *', class: 'SidekiqRakeJob', args: args, + queue: 'high') +job.save +``` + +Cron görevleri hakkında bilgi almak için: + +```ruby +Sidekiq::Cron::Job.all +``` + +Tüm cron'ları silmek için: + +```ruby +Sidekiq::Cron::Job.destroy_all! +``` + +Daha detaylı bilgi için [sidekiq-cron][sidekiq-cron] sayfasına bakılabilir. + +[sidekiq-cron]: https://github.com/ondrejbartas/sidekiq-cron From 1af8d35c78e2a3396d470d246bc100bcba3df5a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 30 Jan 2020 20:42:49 +0300 Subject: [PATCH 010/970] Change the order of building stats --- app/views/meksis/buildings/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/meksis/buildings/index.html.erb b/app/views/meksis/buildings/index.html.erb index aadca3453..e8efbe287 100644 --- a/app/views/meksis/buildings/index.html.erb +++ b/app/views/meksis/buildings/index.html.erb @@ -26,9 +26,9 @@ <%= building.name %> <%= building.code %> <%= building.place_type.name %> - <%= building.indoor_area %> <%= building.classrooms.sum(:student_capacity) %> <%= building.classrooms.sum(:exam_capacity) %> + <%= building.indoor_area %> <%= icon_for_check building.active %> <%= link_to_actions([:meksis, building], except: %i[new destroy]) %> From 4dede836ebfeabc7d3ac62891fba5f6657b0587e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Fri, 31 Jan 2020 10:26:44 +0300 Subject: [PATCH 011/970] =?UTF-8?q?Kuyruk=20=C3=B6nceli=C4=9Fi=20yap=C4=B1?= =?UTF-8?q?land=C4=B1rmada=20belirtilmeli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/sidekiq_rake_job.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/jobs/sidekiq_rake_job.rb b/app/jobs/sidekiq_rake_job.rb index f91b6e3bf..217e469f1 100644 --- a/app/jobs/sidekiq_rake_job.rb +++ b/app/jobs/sidekiq_rake_job.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true class SidekiqRakeJob < ApplicationJob - queue_as :high - Nokul::Application.load_tasks if Rake::Task.tasks.empty? def perform(args = {}) From dc084ef98d7ceb6a1765677add03af91c9f6997d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Fri, 31 Jan 2020 10:29:12 +0300 Subject: [PATCH 012/970] =?UTF-8?q?SidekiqRakeJob=20yerine=20basit=C3=A7e?= =?UTF-8?q?=20RakeJob=20ismini=20kullan?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sidekiq ön eki "redundant", aslında ActiveJob arayüzünü kullanıyoruz. Job son eki herşeyi anlatıyor. --- app/jobs/{sidekiq_rake_job.rb => rake_job.rb} | 2 +- config/schedule.yml | 2 +- doc/app/cron.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename app/jobs/{sidekiq_rake_job.rb => rake_job.rb} (88%) diff --git a/app/jobs/sidekiq_rake_job.rb b/app/jobs/rake_job.rb similarity index 88% rename from app/jobs/sidekiq_rake_job.rb rename to app/jobs/rake_job.rb index 217e469f1..47b2c0c0b 100644 --- a/app/jobs/sidekiq_rake_job.rb +++ b/app/jobs/rake_job.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class SidekiqRakeJob < ApplicationJob +class RakeJob < ApplicationJob Nokul::Application.load_tasks if Rake::Task.tasks.empty? def perform(args = {}) diff --git a/config/schedule.yml b/config/schedule.yml index 1e6d417ac..dc817ca30 100644 --- a/config/schedule.yml +++ b/config/schedule.yml @@ -1,7 +1,7 @@ # https://github.com/ondrejbartas/sidekiq-cron#adding-cron-job # first_job: # cron: "* * * * *" # execute at every minute -# class: SidekiqRakeJob +# class: RakeJob # queue: high # args: # name: fetch:reference diff --git a/doc/app/cron.md b/doc/app/cron.md index d95bc2ccd..f53f80060 100644 --- a/doc/app/cron.md +++ b/doc/app/cron.md @@ -15,7 +15,7 @@ Cron görevi olarak eklemek için `config/schedule.yml` dosyasına aşağıdaki ```yml first_job: cron: "* * * * *" # execute at every minute - class: SidekiqRakeJob + class: RakeJob queue: high args: name: fetch:reference @@ -33,7 +33,7 @@ aşağıdaki gibi cron eklemesi yapabilirsiniz. ```ruby k = "AdministrativeFunction" args = { name: 'fetch:reference', params: [k.tableize, k] } -job = Sidekiq::Cron::Job.new(name: 'Fetch Reference - every min', cron: '* * * * *', class: 'SidekiqRakeJob', args: args, +job = Sidekiq::Cron::Job.new(name: 'Fetch Reference - every min', cron: '* * * * *', class: 'RakeJob', args: args, queue: 'high') job.save ``` From 25b87209f5d595fe2b2109a0c1fa9aee78c3db1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20Can=20Y=C4=B1lmaz?= Date: Fri, 31 Jan 2020 14:12:27 +0300 Subject: [PATCH 013/970] Remove schedule.yml --- config/schedule.yml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 config/schedule.yml diff --git a/config/schedule.yml b/config/schedule.yml deleted file mode 100644 index dc817ca30..000000000 --- a/config/schedule.yml +++ /dev/null @@ -1,10 +0,0 @@ -# https://github.com/ondrejbartas/sidekiq-cron#adding-cron-job -# first_job: -# cron: "* * * * *" # execute at every minute -# class: RakeJob -# queue: high -# args: -# name: fetch:reference -# params: -# - administrative_functions -# - AdministrativeFunction From 863ccd9ddb23d3c9b7030e35a2308f68a4c95097 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2020 00:44:46 +0000 Subject: [PATCH 014/970] chore(deps): bump rubyzip from 2.1.0 to 2.2.0 Bumps [rubyzip](https://github.com/rubyzip/rubyzip) from 2.1.0 to 2.2.0. - [Release notes](https://github.com/rubyzip/rubyzip/releases) - [Changelog](https://github.com/rubyzip/rubyzip/blob/master/Changelog.md) - [Commits](https://github.com/rubyzip/rubyzip/compare/v2.1.0...v2.2.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f8c18f071..b24a4f411 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -363,7 +363,7 @@ GEM ruby-progressbar (1.10.1) ruby-vips (2.0.17) ffi (~> 1.9) - rubyzip (2.1.0) + rubyzip (2.2.0) safe_yaml (1.0.5) sassc (2.2.1) ffi (~> 1.9) From 46b4fbdd18a4828f3f4a84afe48eccff90ca8e5e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2020 00:45:33 +0000 Subject: [PATCH 015/970] chore(deps): bump mimemagic from 0.3.3 to 0.3.4 Bumps [mimemagic](https://github.com/minad/mimemagic) from 0.3.3 to 0.3.4. - [Release notes](https://github.com/minad/mimemagic/releases) - [Changelog](https://github.com/minad/mimemagic/blob/master/CHANGELOG.md) - [Commits](https://github.com/minad/mimemagic/compare/v0.3.3...v0.3.4) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f8c18f071..00d907fa4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -231,7 +231,7 @@ GEM marcel (0.3.3) mimemagic (~> 0.3.2) method_source (0.9.2) - mimemagic (0.3.3) + mimemagic (0.3.4) mini_magick (4.10.1) mini_mime (1.0.2) mini_portile2 (2.4.0) From 2d9e8493ff526bcffd7ba1f7a9b23d7ca8a06d2a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2020 00:46:18 +0000 Subject: [PATCH 016/970] chore(deps-dev): bump rack-mini-profiler from 1.1.4 to 1.1.6 Bumps [rack-mini-profiler](https://github.com/MiniProfiler/rack-mini-profiler) from 1.1.4 to 1.1.6. - [Release notes](https://github.com/MiniProfiler/rack-mini-profiler/releases) - [Changelog](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/CHANGELOG.md) - [Commits](https://github.com/MiniProfiler/rack-mini-profiler/compare/v1.1.4...v1.1.6) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f8c18f071..5ad48092a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -287,10 +287,10 @@ GEM activesupport (>= 3.0.0) pwned (2.0.1) raabro (1.1.6) - rack (2.1.1) + rack (2.1.2) rack-attack (6.2.2) rack (>= 1.0, < 3) - rack-mini-profiler (1.1.4) + rack-mini-profiler (1.1.6) rack (>= 1.2.0) rack-oauth2 (1.10.1) activesupport From 8650640efa07742d718fb8854ed7d0186e5ce943 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2020 00:46:57 +0000 Subject: [PATCH 017/970] chore(deps): bump rollbar from 2.23.1 to 2.23.2 Bumps [rollbar](https://github.com/rollbar/rollbar-gem) from 2.23.1 to 2.23.2. - [Release notes](https://github.com/rollbar/rollbar-gem/releases) - [Changelog](https://github.com/rollbar/rollbar-gem/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollbar/rollbar-gem/compare/v2.23.1...v2.23.2) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f8c18f071..ff565d670 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -345,7 +345,7 @@ GEM responders (3.0.0) actionpack (>= 5.0) railties (>= 5.0) - rollbar (2.23.1) + rollbar (2.23.2) rubocop (0.79.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) From 057b00611ca2aa7327a15b1cc425b76af5ab09ff Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2020 00:47:29 +0000 Subject: [PATCH 018/970] chore(deps-dev): bump capybara from 3.30.0 to 3.31.0 Bumps [capybara](https://github.com/teamcapybara/capybara) from 3.30.0 to 3.31.0. - [Release notes](https://github.com/teamcapybara/capybara/releases) - [Changelog](https://github.com/teamcapybara/capybara/blob/master/History.md) - [Commits](https://github.com/teamcapybara/capybara/compare/3.30.0...3.31.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f8c18f071..426d7b2ef 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -131,7 +131,7 @@ GEM bundler (>= 1.2.0, < 3) thor (~> 0.18) byebug (11.1.1) - capybara (3.30.0) + capybara (3.31.0) addressable mini_mime (>= 0.1.3) nokogiri (~> 1.8) @@ -287,7 +287,7 @@ GEM activesupport (>= 3.0.0) pwned (2.0.1) raabro (1.1.6) - rack (2.1.1) + rack (2.1.2) rack-attack (6.2.2) rack (>= 1.0, < 3) rack-mini-profiler (1.1.4) From 80e20c2d2214e10fea6e9c7381dfb8722510555f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2020 00:48:06 +0000 Subject: [PATCH 019/970] chore(deps): bump ffi from 1.12.1 to 1.12.2 Bumps [ffi](https://github.com/ffi/ffi) from 1.12.1 to 1.12.2. - [Release notes](https://github.com/ffi/ffi/releases) - [Changelog](https://github.com/ffi/ffi/blob/master/CHANGELOG.md) - [Commits](https://github.com/ffi/ffi/compare/1.12.1...1.12.2) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f8c18f071..63fb2d355 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -174,7 +174,7 @@ GEM execjs (2.7.0) faraday (1.0.0) multipart-post (>= 1.2, < 3) - ffi (1.12.1) + ffi (1.12.2) fit-commit (3.8.1) swearjar (~> 1.3) font-awesome-rails (4.7.0.5) From 3ccc891f21729a062df2f93b999aeef9270994a0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2020 00:48:42 +0000 Subject: [PATCH 020/970] chore(deps-dev): bump simplecov from 0.17.1 to 0.18.1 Bumps [simplecov](https://github.com/colszowka/simplecov) from 0.17.1 to 0.18.1. - [Release notes](https://github.com/colszowka/simplecov/releases) - [Changelog](https://github.com/colszowka/simplecov/blob/master/CHANGELOG.md) - [Commits](https://github.com/colszowka/simplecov/compare/v0.17.1...v0.18.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f8c18f071..cafa6e14b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -201,7 +201,6 @@ GEM jbuilder (2.9.1) activesupport (>= 4.2.0) jmespath (1.4.0) - json (2.3.0) json-jwt (1.11.0) activesupport (>= 4.2) aes_key_wrap @@ -387,11 +386,10 @@ GEM simple_form (5.0.1) actionpack (>= 5.0) activemodel (>= 5.0) - simplecov (0.17.1) + simplecov (0.18.1) docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) + simplecov-html (~> 0.11.0) + simplecov-html (0.11.0) slack-notifier (2.3.2) smart_properties (1.15.0) smstools (0.2.0) From 21f7b9f4c5d65e1f0408959031fb6daa4f570105 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2020 00:49:14 +0000 Subject: [PATCH 021/970] chore(deps): bump rack from 2.1.1 to 2.1.2 Bumps [rack](https://github.com/rack/rack) from 2.1.1 to 2.1.2. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/master/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/2.1.1...2.1.2) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f8c18f071..acf307f69 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -287,7 +287,7 @@ GEM activesupport (>= 3.0.0) pwned (2.0.1) raabro (1.1.6) - rack (2.1.1) + rack (2.1.2) rack-attack (6.2.2) rack (>= 1.0, < 3) rack-mini-profiler (1.1.4) From 5260ffaf73d1ec5f6a3a9efda628eb53ce98f6a6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2020 01:04:39 +0000 Subject: [PATCH 022/970] chore(deps): bump css-loader from 3.4.1 to 3.4.2 Bumps [css-loader](https://github.com/webpack-contrib/css-loader) from 3.4.1 to 3.4.2. - [Release notes](https://github.com/webpack-contrib/css-loader/releases) - [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/css-loader/compare/v3.4.1...v3.4.2) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 899fa8b15..85d0377c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2378,9 +2378,9 @@ css-has-pseudo@^0.10.0: postcss-selector-parser "^5.0.0-rc.4" css-loader@^3.2.0: - version "3.4.1" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-3.4.1.tgz#dfb7968aa9bffb26bd20375afdffe77d5a234b77" - integrity sha512-+ybmv7sVxxNEenQhkifQDvny/1iNQM7YooJbSfVUdQQvisyg1aKIqgGjCjoFSyVLJMp17z9rfZFQaR5HGHcMbw== + version "3.4.2" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-3.4.2.tgz#d3fdb3358b43f233b78501c5ed7b1c6da6133202" + integrity sha512-jYq4zdZT0oS0Iykt+fqnzVLRIeiPWhka+7BqPn+oSIpWJAHak5tmB/WZrJ2a21JhCeFyNnnlroSl8c+MtVndzA== dependencies: camelcase "^5.3.1" cssesc "^3.0.0" @@ -7252,9 +7252,9 @@ schema-utils@^1.0.0: ajv-keywords "^3.1.0" schema-utils@^2.0.1, schema-utils@^2.5.0, schema-utils@^2.6.0, schema-utils@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.1.tgz#eb78f0b945c7bcfa2082b3565e8db3548011dc4f" - integrity sha512-0WXHDs1VDJyo+Zqs9TKLKyD/h7yDpHUhEFsM2CzkICFdoX1av+GBq/J2xRTFfsQO5kBfhZzANf2VcIm84jqDbg== + version "2.6.4" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.4.tgz#a27efbf6e4e78689d91872ee3ccfa57d7bdd0f53" + integrity sha512-VNjcaUxVnEeun6B2fiiUDjXXBtD4ZSH7pdbfIu1pOFwgptDPLMo/z9jr4sUfsjFVPqDCEin/F7IYlq7/E6yDbQ== dependencies: ajv "^6.10.2" ajv-keywords "^3.4.1" From 2e0e200aa0150903e15f31a41fe7e44bdeafb818 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2020 01:05:55 +0000 Subject: [PATCH 023/970] chore(deps): bump util.promisify from 1.0.0 to 1.0.1 Bumps [util.promisify](https://github.com/ljharb/util.promisify) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/ljharb/util.promisify/releases) - [Changelog](https://github.com/ljharb/util.promisify/blob/master/CHANGELOG.md) - [Commits](https://github.com/ljharb/util.promisify/compare/v1.0.0...v1.0.1) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/yarn.lock b/yarn.lock index 899fa8b15..6ed5e27d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2917,10 +2917,10 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.17.0, es-abstract@^1.17.0-next.1: - version "1.17.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.0.tgz#f42a517d0036a5591dbb2c463591dc8bb50309b1" - integrity sha512-yYkE07YF+6SIBmg1MsJ9dlub5L48Ek7X0qz+c/CPCHS9EBXfESorzng4cJQjJW5/pB6vDF41u7F8vUhLVDqIug== +es-abstract@^1.17.0, es-abstract@^1.17.0-next.1, es-abstract@^1.17.2: + version "1.17.4" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.4.tgz#e3aedf19706b20e7c2594c35fc0d57605a79e184" + integrity sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ== dependencies: es-to-primitive "^1.2.1" function-bind "^1.1.1" @@ -5527,7 +5527,7 @@ object.assign@^4.1.0: has-symbols "^1.0.0" object-keys "^1.0.11" -object.getownpropertydescriptors@^2.0.3: +object.getownpropertydescriptors@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" integrity sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg== @@ -8264,12 +8264,14 @@ util-deprecate@^1.0.1, util-deprecate@~1.0.1: integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= util.promisify@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" - integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== + version "1.0.1" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.1.tgz#6baf7774b80eeb0f7520d8b81d07982a59abbaee" + integrity sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA== dependencies: - define-properties "^1.1.2" - object.getownpropertydescriptors "^2.0.3" + define-properties "^1.1.3" + es-abstract "^1.17.2" + has-symbols "^1.0.1" + object.getownpropertydescriptors "^2.1.0" util@0.10.3: version "0.10.3" From a420fe4daab07b990e6221924f3fd228f909f2d2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2020 01:06:56 +0000 Subject: [PATCH 024/970] chore(deps): bump style-loader from 1.1.2 to 1.1.3 Bumps [style-loader](https://github.com/webpack-contrib/style-loader) from 1.1.2 to 1.1.3. - [Release notes](https://github.com/webpack-contrib/style-loader/releases) - [Changelog](https://github.com/webpack-contrib/style-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/style-loader/compare/v1.1.2...v1.1.3) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 899fa8b15..a772713aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7251,10 +7251,10 @@ schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" -schema-utils@^2.0.1, schema-utils@^2.5.0, schema-utils@^2.6.0, schema-utils@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.1.tgz#eb78f0b945c7bcfa2082b3565e8db3548011dc4f" - integrity sha512-0WXHDs1VDJyo+Zqs9TKLKyD/h7yDpHUhEFsM2CzkICFdoX1av+GBq/J2xRTFfsQO5kBfhZzANf2VcIm84jqDbg== +schema-utils@^2.5.0, schema-utils@^2.6.0, schema-utils@^2.6.1, schema-utils@^2.6.4: + version "2.6.4" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.4.tgz#a27efbf6e4e78689d91872ee3ccfa57d7bdd0f53" + integrity sha512-VNjcaUxVnEeun6B2fiiUDjXXBtD4ZSH7pdbfIu1pOFwgptDPLMo/z9jr4sUfsjFVPqDCEin/F7IYlq7/E6yDbQ== dependencies: ajv "^6.10.2" ajv-keywords "^3.4.1" @@ -7846,12 +7846,12 @@ strip-json-comments@^3.0.1: integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== style-loader@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.1.2.tgz#1b519c19faf548df6182b93e72ea1a4156022c2f" - integrity sha512-0Mpq1ZHFDCNq1F+6avNBgv+7q8V+mWRuzehxyJT+aKgzyN/yfKTwjYqaYwBgx+11UpQxL21zNQfzzlz+JcGURw== + version "1.1.3" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.1.3.tgz#9e826e69c683c4d9bf9db924f85e9abb30d5e200" + integrity sha512-rlkH7X/22yuwFYK357fMN/BxYOorfnfq0eD7+vqlemSK4wEcejFF1dg4zxP0euBW8NrYx2WZzZ8PPFevr7D+Kw== dependencies: loader-utils "^1.2.3" - schema-utils "^2.0.1" + schema-utils "^2.6.4" stylehacks@^4.0.0: version "4.0.3" From 07d36487bbf0cfc475ba6bdbf9438ce18233115a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2020 01:09:33 +0000 Subject: [PATCH 025/970] chore(deps): bump case-sensitive-paths-webpack-plugin Bumps [case-sensitive-paths-webpack-plugin](https://github.com/Urthen/case-sensitive-paths-webpack-plugin) from 2.2.0 to 2.3.0. - [Release notes](https://github.com/Urthen/case-sensitive-paths-webpack-plugin/releases) - [Changelog](https://github.com/Urthen/case-sensitive-paths-webpack-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/Urthen/case-sensitive-paths-webpack-plugin/commits) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 899fa8b15..bee503609 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1837,9 +1837,9 @@ caniuse-lite@^1.0.30001022: integrity sha512-C5TDMiYG11EOhVOA62W1p3UsJ2z4DsHtMBQtjzp3ZsUglcQn62WOUgW0y795c7A5uZ+GCEIvzkMatLIlAsbNTA== case-sensitive-paths-webpack-plugin@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.2.0.tgz#3371ef6365ef9c25fa4b81c16ace0e9c7dc58c3e" - integrity sha512-u5ElzokS8A1pm9vM3/iDgTcI3xqHxuCao94Oz8etI3cf0Tio0p8izkDYbTIn09uP3yUUr6+veaE6IkjnTYS46g== + version "2.3.0" + resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.3.0.tgz#23ac613cc9a856e4f88ff8bb73bbb5e989825cf7" + integrity sha512-/4YgnZS8y1UXXmC02xD5rRrBEu6T5ub+mQHLNRj0fzTRbgdBYhsNo2V5EqwgqrExjxsjtF/OpAKAMkKsxbD5XQ== caseless@~0.12.0: version "0.12.0" From 2a931d1f9c7cf4df14810e7b731b1df327f7f1e8 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2020 01:10:38 +0000 Subject: [PATCH 026/970] chore(deps): bump pako from 1.0.10 to 1.0.11 Bumps [pako](https://github.com/nodeca/pako) from 1.0.10 to 1.0.11. - [Release notes](https://github.com/nodeca/pako/releases) - [Changelog](https://github.com/nodeca/pako/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodeca/pako/compare/1.0.10...1.0.11) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 899fa8b15..5cb21199c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5753,9 +5753,9 @@ pace-progress@1.0.2: integrity sha1-/cVlxX3ZFyWjFns2C/JXjTw7VI0= pako@~1.0.5: - version "1.0.10" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.10.tgz#4328badb5086a426aa90f541977d4955da5c9732" - integrity sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw== + version "1.0.11" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" + integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== parallel-transform@^1.1.0: version "1.2.0" From 9906cf7c930235d950c7cbbca2f4c7601f36148f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20Can=20Y=C4=B1lmaz?= Date: Mon, 3 Feb 2020 14:43:34 +0300 Subject: [PATCH 027/970] Fix linter issues --- app/views/layouts/shared/_sidebar.html.erb | 2 +- .../course_enrollments/_available_courses.html.erb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/layouts/shared/_sidebar.html.erb b/app/views/layouts/shared/_sidebar.html.erb index 6c8a97c8a..0acdddd6e 100644 --- a/app/views/layouts/shared/_sidebar.html.erb +++ b/app/views/layouts/shared/_sidebar.html.erb @@ -156,7 +156,7 @@
@@ -25,6 +29,7 @@
<%= render 'employees' %>
+
<%= render 'disability' %>
diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index c56a94d9b..353c785df 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -25,6 +25,8 @@ en: articles_count: Articles Count country: Country current_password: Current Password + disability_rate: Disability Rate + disability_type: Disability Type email: E-mail id_number: ID Number mobile_phone: Mobile Phone @@ -56,6 +58,10 @@ en: destroy: success: User successfully deleted! warning: User can not be deleted. + disability: + disability_status: Disability Status + rate: Disability Rate + type: Disability Type edit: form_title: Edit Account employees: @@ -90,5 +96,6 @@ en: addresses: Addresses employees: Employees identities: Identities + other_informations: Other Informations update: success: User successfully updated. diff --git a/config/locales/models/user/tr.yml b/config/locales/models/user/tr.yml index 97dc54963..ceee5a3df 100644 --- a/config/locales/models/user/tr.yml +++ b/config/locales/models/user/tr.yml @@ -25,6 +25,8 @@ tr: articles_count: Makale Sayısı country: Ülke current_password: Mevcut Parola + disability_rate: Engel Oranı + disability_type: Engel Türü email: E-posta Adresi id_number: Kimlik Numarası mobile_phone: Cep Telefonu @@ -62,6 +64,10 @@ tr: destroy: success: Kullanıcı başarıyla silindi! warning: Kullanıcı silinemedi! + disability: + disability_status: Engel Durumu + rate: Engel Oranı + type: Engel Türü edit: form_title: Hesabı Düzenle employees: @@ -103,5 +109,6 @@ tr: addresses: Adres Bilgileri employees: Personel İşlemleri identities: Kimlik Bilgileri + other_informations: Diğer Bilgiler update: success: Kullanıcı başarıyla güncellendi. From 4f6aeeff1712342bbfbbd74d6a461b60f4fc185e Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 4 Feb 2020 15:59:12 +0300 Subject: [PATCH 036/970] Create disability validator --- app/models/user.rb | 1 + app/validators/disability_validator.rb | 19 +++++++++++++++++++ config/locales/validators/en.yml | 2 ++ config/locales/validators/tr.yml | 2 ++ 4 files changed, 24 insertions(+) create mode 100644 app/validators/disability_validator.rb diff --git a/app/models/user.rb b/app/models/user.rb index aa2929b83..96370a4b7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -89,6 +89,7 @@ class User < ApplicationRecord validates :twitter, allow_blank: true, length: { maximum: 50 } validates :website, allow_blank: true, length: { maximum: 50 } validates_with ImageValidator, field: :avatar, if: proc { |a| a.avatar.attached? } + validates_with DisabilityValidator # callbacks after_create_commit :build_address_information, if: proc { addresses.formal.empty? } diff --git a/app/validators/disability_validator.rb b/app/validators/disability_validator.rb new file mode 100644 index 000000000..1449d9663 --- /dev/null +++ b/app/validators/disability_validator.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class DisabilityValidator < ActiveModel::Validator + def validate(record) + @user = record + + @user.errors[:base] << I18n.t('.validators.disability.disability_error') unless both_empty? || both_full? + end + + private + + def both_empty? + !@user.disability_type_id? && @user.disability_rate.zero? + end + + def both_full? + @user.disability_type_id? && !@user.disability_rate.zero? + end +end diff --git a/config/locales/validators/en.yml b/config/locales/validators/en.yml index b498b3870..75fa8d4e0 100644 --- a/config/locales/validators/en.yml +++ b/config/locales/validators/en.yml @@ -18,6 +18,8 @@ en: before: must be before than %{restriction} comparison_value: Comparison value eql: must be eql %{restriction} + disability: + disability_error: Both the type of disabilty and the rate of disabilty must be filled. duty: active_and_tenure: This user already has an active and tenure duty. Edit the existing duty or make it passive in order to create a new one. invalid_end_date: Start date is selected as a date after the end date diff --git a/config/locales/validators/tr.yml b/config/locales/validators/tr.yml index 49d5a2cdf..4721cf463 100644 --- a/config/locales/validators/tr.yml +++ b/config/locales/validators/tr.yml @@ -18,6 +18,8 @@ tr: before: "%{restriction} tarihinden önce olmalı" comparison_value: Karşılaştırma değeri eql: "%{restriction} tarihine eşit olmalı" + disability: + disability_error: Engel türü ve engel oranının ikisi de doldurulmalı. duty: active_and_tenure: Bu personelin zaten aktif ve kadrolu bir görevi var! Yeni kayıt girmek yerine aktif kaydı düzenleyin veya öncelikle aktif kaydı pasifleştirin. invalid_end_date: Görev başlangıç tarihi bitiş tarihinden sonraki bir tarih olarak seçilmiş. From 85ab5805ddf207d52906d9baf059054147d8ff5d Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 4 Feb 2020 16:13:19 +0300 Subject: [PATCH 037/970] Fix typo --- config/locales/controllers/account/disability.en.yml | 4 ++-- config/locales/validators/en.yml | 2 +- test/models/user_test.rb | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/locales/controllers/account/disability.en.yml b/config/locales/controllers/account/disability.en.yml index 25ac39efa..3b6f21ff2 100644 --- a/config/locales/controllers/account/disability.en.yml +++ b/config/locales/controllers/account/disability.en.yml @@ -2,6 +2,6 @@ en: account: disability: edit: - form_title: Update the Disability Type + form_title: Update the Disability Status update: - success: Disability type successfully updated. \ No newline at end of file + success: Disability status successfully updated. \ No newline at end of file diff --git a/config/locales/validators/en.yml b/config/locales/validators/en.yml index 75fa8d4e0..fab97d3f9 100644 --- a/config/locales/validators/en.yml +++ b/config/locales/validators/en.yml @@ -19,7 +19,7 @@ en: comparison_value: Comparison value eql: must be eql %{restriction} disability: - disability_error: Both the type of disabilty and the rate of disabilty must be filled. + disability_error: Both the type of disability and the rate of disability must be filled. duty: active_and_tenure: This user already has an active and tenure duty. Edit the existing duty or make it passive in order to create a new one. invalid_end_date: Start date is selected as a date after the end date diff --git a/test/models/user_test.rb b/test/models/user_test.rb index 26dd1fb3d..5a4023454 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -53,6 +53,7 @@ class UserTest < ActiveSupport::TestCase validates_length_of :website, maximum: 50 # validations: numericality + validates_numericality_of :id_number validates_numericality_of :disability_rate validates_numericality_of :extension_number validates_numerical_range :disability_rate, greater_than_or_equal_to: 0, less_than_or_equal_to: 100 From 6046daf9cd25bf0ae321956d2ded45a8dc188ce2 Mon Sep 17 00:00:00 2001 From: isubas Date: Tue, 4 Feb 2020 16:34:15 +0300 Subject: [PATCH 038/970] =?UTF-8?q?Test=20edilecek=20nesnenin=20de=C4=9Fi?= =?UTF-8?q?=C5=9Ftirilebilmesini=20sa=C4=9Fla?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nokul/support/minitest/validation_helper.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/support/lib/nokul/support/minitest/validation_helper.rb b/plugins/support/lib/nokul/support/minitest/validation_helper.rb index 67bbaed4c..bfc128c44 100644 --- a/plugins/support/lib/nokul/support/minitest/validation_helper.rb +++ b/plugins/support/lib/nokul/support/minitest/validation_helper.rb @@ -9,7 +9,6 @@ module ValidationHelper def validates_presence_of(*attributes) attributes.each do |attribute| test "#{attribute} must be present (presence: true)" do - object = class_name.delete_suffix(SUFFIX).constantize.take object.send("#{attribute}=", nil) assert_not object.valid? assert_not_empty object.errors[attribute] @@ -20,7 +19,6 @@ def validates_presence_of(*attributes) def validates_presence_of_nested_model(attribute, ids: nil) test "nested model (#{attribute}) must be present" do ids ||= "#{attribute.to_s.singularize}_ids" - object = class_name.delete_suffix(SUFFIX).constantize.take object.send("#{ids}=", nil) assert_not object.valid? assert_not_empty object.errors[attribute] @@ -30,7 +28,7 @@ def validates_presence_of_nested_model(attribute, ids: nil) def validates_uniqueness_of(*attributes) attributes.each do |attribute| test "#{attribute} must be unique (uniqueness: true)" do - duplicate_object = class_name.delete_suffix(SUFFIX).constantize.take.dup + duplicate_object = object.dup assert_not duplicate_object.valid? assert_not_empty duplicate_object.errors[attribute] end @@ -51,7 +49,6 @@ def validates_length_of(attribute, **option) error_key = controls.dig(key, :error_key) test "#{attribute} length must be #{option}" do - object = class_name.delete_suffix(SUFFIX).constantize.take object.send("#{attribute}=", (0..value).map { ('a'..'z').to_a[rand(26)] }.join) assert_not object.valid? assert object.errors.details[attribute].map { |err| err[:error] }.include?(error_key) @@ -60,7 +57,6 @@ def validates_length_of(attribute, **option) def validates_numericality_of(attribute) test "#{attribute} must be a number" do - object = class_name.delete_suffix(SUFFIX).constantize.take object.send("#{attribute}=", 'some string') assert_not object.valid? assert object.errors.details[attribute].map { |err| err[:error] }.include?(:not_a_number) @@ -79,12 +75,19 @@ def validates_numerical_range(attribute, **option) value = option[key].to_i + controls[key].to_i test "#{attribute} must be #{key} #{value}" do - object = class_name.delete_suffix(SUFFIX).constantize.take object.send("#{attribute}=", value) assert_not object.valid? assert object.errors.details[attribute].map { |err| err[:error] }.include?(key) end end + + def self.extended(base) + base.class_eval do + def object + @object ||= class_name.delete_suffix(SUFFIX).constantize.take + end + end + end end end end From b5cda862984feeed0e17155824ab5ad078903e0d Mon Sep 17 00:00:00 2001 From: isubas Date: Tue, 4 Feb 2020 16:34:51 +0300 Subject: [PATCH 039/970] Fix tests --- app/models/curriculum.rb | 23 +++++++----- ...urriculum_course_groups_controller_test.rb | 2 +- .../curriculum_semester_decorator_test.rb | 2 +- test/fixtures/curriculum_course_groups.yml | 4 +-- test/fixtures/curriculum_courses.yml | 10 +++--- test/fixtures/curriculum_semesters.yml | 35 +++++++++++++++++-- test/fixtures/curriculums.yml | 5 +++ test/models/curriculum_test.rb | 22 ++++++------ .../student_course_enrollment_service_test.rb | 2 +- 9 files changed, 72 insertions(+), 33 deletions(-) diff --git a/app/models/curriculum.rb b/app/models/curriculum.rb index 06214e449..723803fae 100644 --- a/app/models/curriculum.rb +++ b/app/models/curriculum.rb @@ -40,33 +40,40 @@ class Curriculum < ApplicationRecord # validations validates :name, presence: true, uniqueness: { scope: :unit_id }, length: { maximum: 255 } validates :programs, presence: true - validates :semesters_count, numericality: { - equal_to: ->(record) { record.number_of_semesters }, - message: :number_of_semesters_must_be_equal - } validates :status, inclusion: { in: statuses.keys } + validate :check_semester # custom methods def build_semesters - return false unless valid? + return false if semesters_count >= number_of_semesters (1..number_of_semesters).each do |sequence| semesters.build(sequence: sequence, - year: (sequence.to_f / divisor).round, + year: (sequence.to_f / number_of_semesters_for_one_year).round, term: %i[spring fall][sequence % 2]) end end def number_of_semesters - @number_of_semesters ||= duration * (semester_type.to_sym == :periodic ? 2 : 1).to_i + @number_of_semesters ||= duration.to_i * number_of_semesters_for_one_year end private # delegates - delegate :semester_type, :duration, to: :program + delegate :semester_type, :duration, to: :program, allow_nil: true def program @program ||= programs.last end + + def number_of_semesters_for_one_year + (semester_type.to_s.to_sym == :periodic ? 2 : 1).to_i + end + + def check_semester + return if semesters.size == number_of_semesters + + errors.add(:semesters_count, :number_of_semesters_must_be_equal, count: number_of_semesters) + end end diff --git a/test/controllers/course_management/curriculum_course_groups_controller_test.rb b/test/controllers/course_management/curriculum_course_groups_controller_test.rb index a2906872f..be2d49b46 100644 --- a/test/controllers/course_management/curriculum_course_groups_controller_test.rb +++ b/test/controllers/course_management/curriculum_course_groups_controller_test.rb @@ -7,7 +7,7 @@ class CurriculumCourseGroupsControllerTest < ActionDispatch::IntegrationTest setup do sign_in users(:serhat) @curriculum_semester = CurriculumSemesterDecorator.new( - curriculum_semesters(:bilgisayar_muh_mufredati_birinci_donem) + curriculum_semesters(:bm_first) ) @curriculum_course_group = @curriculum_semester.curriculum_course_groups.first end diff --git a/test/decorators/curriculum_semester_decorator_test.rb b/test/decorators/curriculum_semester_decorator_test.rb index 5099a78a8..42e0cd92d 100644 --- a/test/decorators/curriculum_semester_decorator_test.rb +++ b/test/decorators/curriculum_semester_decorator_test.rb @@ -5,7 +5,7 @@ class CurriculumSemesterDecoratorTest < ActiveSupport::TestCase setup do @curriculum_semester = CurriculumSemesterDecorator.new( - curriculum_semesters(:bilgisayar_muh_mufredati_ucuncu_donem) + curriculum_semesters(:bm_third) ) end diff --git a/test/fixtures/curriculum_course_groups.yml b/test/fixtures/curriculum_course_groups.yml index 015d78340..6ce2432ae 100644 --- a/test/fixtures/curriculum_course_groups.yml +++ b/test/fixtures/curriculum_course_groups.yml @@ -1,8 +1,8 @@ one: - curriculum_semester: bilgisayar_muh_mufredati_birinci_donem + curriculum_semester: bm_first course_group: bilgisayar_muhendligi_teknik_secmeli_1 ects: 6 ucuncu_donem_secmeli_grubu: - curriculum_semester: bilgisayar_muh_mufredati_ucuncu_donem + curriculum_semester: bm_third course_group: bilgisayar_muhendligi_teknik_secmeli_1 ects: 2 diff --git a/test/fixtures/curriculum_courses.yml b/test/fixtures/curriculum_courses.yml index 4742423c5..6e5a16534 100644 --- a/test/fixtures/curriculum_courses.yml +++ b/test/fixtures/curriculum_courses.yml @@ -18,32 +18,32 @@ ydi: elective_course: course: mobil_programlama - curriculum_semester: bilgisayar_muh_mufredati_ucuncu_donem + curriculum_semester: bm_third curriculum_course_group: ucuncu_donem_secmeli_grubu ects: 2 type: elective elective_course_2: course: java - curriculum_semester: bilgisayar_muh_mufredati_ucuncu_donem + curriculum_semester: bm_third curriculum_course_group: ucuncu_donem_secmeli_grubu ects: 2 type: elective compulsory_course: course: ydi - curriculum_semester: bilgisayar_muh_mufredati_ucuncu_donem + curriculum_semester: bm_third ects: 2 type: compulsory compulsory_course_2: course: fi_tarihi - curriculum_semester: bilgisayar_muh_mufredati_ucuncu_donem + curriculum_semester: bm_third ects: 2 type: compulsory old_course: course: test - curriculum_semester: bilgisayar_muh_mufredati_birinci_donem + curriculum_semester: bm_first ects: 2 type: compulsory diff --git a/test/fixtures/curriculum_semesters.yml b/test/fixtures/curriculum_semesters.yml index 286f26c97..926cd027d 100644 --- a/test/fixtures/curriculum_semesters.yml +++ b/test/fixtures/curriculum_semesters.yml @@ -16,14 +16,43 @@ three: term: fall curriculum: two -bilgisayar_muh_mufredati_birinci_donem: +bm_first: sequence: 1 year: 1 term: fall curriculum: bilgisayar_muhendisligi_mufredati - -bilgisayar_muh_mufredati_ucuncu_donem: +bm_second: + sequence: 2 + year: 1 + term: spring + curriculum: bilgisayar_muhendisligi_mufredati +bm_third: sequence: 3 year: 2 term: fall curriculum: bilgisayar_muhendisligi_mufredati +bm_fourth: + sequence: 4 + year: 2 + term: spring + curriculum: bilgisayar_muhendisligi_mufredati +bm_fifth: + sequence: 5 + year: 3 + term: fall + curriculum: bilgisayar_muhendisligi_mufredati +bm_sixth: + sequence: 6 + year: 3 + term: spring + curriculum: bilgisayar_muhendisligi_mufredati +bm_seventh: + sequence: 7 + year: 4 + term: fall + curriculum: bilgisayar_muhendisligi_mufredati +bm_eighth: + sequence: 8 + year: 4 + term: spring + curriculum: bilgisayar_muhendisligi_mufredati diff --git a/test/fixtures/curriculums.yml b/test/fixtures/curriculums.yml index 25634e1d9..741f5940f 100644 --- a/test/fixtures/curriculums.yml +++ b/test/fixtures/curriculums.yml @@ -2,23 +2,28 @@ one: name: Test Müfredatı 1 unit: omu status: active + semesters_count: 8 two: name: Test Müfredatı 2 unit: omu status: active + semesters_count: 8 three: name: Test Müfredatı 3 unit: omu status: active + semesters_count: 8 bilgisayar_muhendisligi_mufredati: name: Bilgisayar Mühendiliği Müfredatı unit: bilgisayar_muhendisligi status: active + semesters_count: 8 curriculum_to_delete: name: Test Müfredat unit: cbu status: passive + semesters_count: 8 diff --git a/test/models/curriculum_test.rb b/test/models/curriculum_test.rb index b21049cc2..fa9d82318 100644 --- a/test/models/curriculum_test.rb +++ b/test/models/curriculum_test.rb @@ -7,6 +7,10 @@ class CurriculumTest < ActiveSupport::TestCase extend Support::Minitest::EnumerationHelper extend Support::Minitest::ValidationHelper + setup do + @object = curriculums(:bilgisayar_muhendisligi_mufredati) + end + # constants { MAX_NUMBER_OF_SEMESTERS: 12, @@ -33,7 +37,6 @@ class CurriculumTest < ActiveSupport::TestCase # validations: presence validates_presence_of :name - validates_presence_of :semesters_count validates_presence_of :status validates_presence_of :unit @@ -46,21 +49,16 @@ class CurriculumTest < ActiveSupport::TestCase # validations: uniqueness validates_uniqueness_of :name - # validations: numericality - validates_numericality_of :semesters_count - validates_numerical_range :semesters_count, greater_than_or_equal_to: 0 - # enums enum status: { passive: 0, active: 1 } # custom methods test 'build_semester method' do - curriculum = curriculums(:one) - Curriculum.reset_counters(curriculum.id, :semesters_count) - curriculum.semesters.destroy_all - curriculum.semesters_count = 0 - curriculum.build_semesters - assert_equal 8, curriculum.semesters.size - assert_equal [1, 2, 3, 4], curriculum.semesters.pluck(:year).uniq + Curriculum.reset_counters(@object.id, :semesters_count) + @object.semesters.destroy_all + @object.semesters_count = 0 + @object.build_semesters + assert_equal @object.number_of_semesters, @object.semesters.size + assert_equal [1, 2, 3, 4], @object.semesters.pluck(:year).uniq end end diff --git a/test/services/student_course_enrollment_service_test.rb b/test/services/student_course_enrollment_service_test.rb index 6212f8fe9..d59932c25 100644 --- a/test/services/student_course_enrollment_service_test.rb +++ b/test/services/student_course_enrollment_service_test.rb @@ -50,7 +50,7 @@ class StudentCourseEnrollmentServiceTest < ActiveSupport::TestCase test 'catalog method' do @service.build_catalog - semester_courses = @service.catalog[curriculum_semesters(:bilgisayar_muh_mufredati_ucuncu_donem)] + semester_courses = @service.catalog[curriculum_semesters(:bm_third)] CompulsoryCourseGroup = OpenStruct.new(name: 'compulsories', completed: false) elective_course_group = curriculum_course_groups(:ucuncu_donem_secmeli_grubu) From d46dbbec290a7d33073a88372e647b00b0410e38 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 5 Feb 2020 09:00:01 +0300 Subject: [PATCH 040/970] Escape undefined method for NilClass --- app/validators/disability_validator.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/validators/disability_validator.rb b/app/validators/disability_validator.rb index 1449d9663..1fada3059 100644 --- a/app/validators/disability_validator.rb +++ b/app/validators/disability_validator.rb @@ -10,10 +10,10 @@ def validate(record) private def both_empty? - !@user.disability_type_id? && @user.disability_rate.zero? + !@user.disability_type_id? && @user.disability_rate&.zero? end def both_full? - @user.disability_type_id? && !@user.disability_rate.zero? + @user.disability_type_id? && !@user.disability_rate&.zero? end end From 4b843b80436536a09967ead45a89f0611b703d9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Suba=C5=9F?= Date: Wed, 5 Feb 2020 09:11:04 +0300 Subject: [PATCH 041/970] Update app/models/curriculum.rb Co-Authored-By: M. Serhat Dundar --- app/models/curriculum.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/curriculum.rb b/app/models/curriculum.rb index 723803fae..a4fe375f3 100644 --- a/app/models/curriculum.rb +++ b/app/models/curriculum.rb @@ -45,7 +45,7 @@ class Curriculum < ApplicationRecord # custom methods def build_semesters - return false if semesters_count >= number_of_semesters + return if semesters_count >= number_of_semesters (1..number_of_semesters).each do |sequence| semesters.build(sequence: sequence, From 8e5f4c5397229c328c6e1e18c3f6d23268eb7441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Suba=C5=9F?= Date: Wed, 5 Feb 2020 09:11:33 +0300 Subject: [PATCH 042/970] Update app/models/curriculum.rb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Recai Oktaş --- app/models/curriculum.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/curriculum.rb b/app/models/curriculum.rb index a4fe375f3..408d37344 100644 --- a/app/models/curriculum.rb +++ b/app/models/curriculum.rb @@ -68,7 +68,7 @@ def program end def number_of_semesters_for_one_year - (semester_type.to_s.to_sym == :periodic ? 2 : 1).to_i + semester_type&.to_sym == :periodic ? 2 : 1 end def check_semester From d57ccd1cc7860ec1bc62e3fbf71859f246faa223 Mon Sep 17 00:00:00 2001 From: isubas Date: Wed, 5 Feb 2020 10:48:31 +0300 Subject: [PATCH 043/970] =?UTF-8?q?Metod=20tan=C4=B1mlamas=C4=B1n=C4=B1=20?= =?UTF-8?q?define=5Fmethod=20ile=20yap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../support/lib/nokul/support/minitest/validation_helper.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/support/lib/nokul/support/minitest/validation_helper.rb b/plugins/support/lib/nokul/support/minitest/validation_helper.rb index bfc128c44..5600b9961 100644 --- a/plugins/support/lib/nokul/support/minitest/validation_helper.rb +++ b/plugins/support/lib/nokul/support/minitest/validation_helper.rb @@ -82,10 +82,8 @@ def validates_numerical_range(attribute, **option) end def self.extended(base) - base.class_eval do - def object - @object ||= class_name.delete_suffix(SUFFIX).constantize.take - end + base.define_method :object do + @object ||= class_name.delete_suffix(SUFFIX).constantize.take end end end From c4e31075db6dc393a822e79b2b67550c746a1d55 Mon Sep 17 00:00:00 2001 From: isubas Date: Wed, 5 Feb 2020 10:54:22 +0300 Subject: [PATCH 044/970] =?UTF-8?q?D=C3=B6nem=20olu=C5=9Fturma=20sonras?= =?UTF-8?q?=C4=B1nda=20d=C3=B6n=C3=BC=C5=9F=20de=C4=9Feri=20olarak=20d?= =?UTF-8?q?=C3=B6nemleri=20d=C3=B6n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/curriculum.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/curriculum.rb b/app/models/curriculum.rb index 408d37344..2d1ac559d 100644 --- a/app/models/curriculum.rb +++ b/app/models/curriculum.rb @@ -41,7 +41,7 @@ class Curriculum < ApplicationRecord validates :name, presence: true, uniqueness: { scope: :unit_id }, length: { maximum: 255 } validates :programs, presence: true validates :status, inclusion: { in: statuses.keys } - validate :check_semester + validate :check_semesters_count # custom methods def build_semesters @@ -52,6 +52,7 @@ def build_semesters year: (sequence.to_f / number_of_semesters_for_one_year).round, term: %i[spring fall][sequence % 2]) end + semesters end def number_of_semesters @@ -71,7 +72,7 @@ def number_of_semesters_for_one_year semester_type&.to_sym == :periodic ? 2 : 1 end - def check_semester + def check_semesters_count return if semesters.size == number_of_semesters errors.add(:semesters_count, :number_of_semesters_must_be_equal, count: number_of_semesters) From 78388b54be85d963e9787b4ebe1fe56154cee7cc Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 5 Feb 2020 11:23:18 +0300 Subject: [PATCH 045/970] Remove disability type relation from user --- .../account/disability_controller.rb | 2 +- app/models/student_disability_type.rb | 1 - app/models/user.rb | 5 ----- app/validators/disability_validator.rb | 19 ------------------- app/views/account/disability/edit.html.erb | 5 +---- app/views/users/_disability.html.erb | 2 -- config/locales/models/user/en.yml | 1 - config/locales/models/user/tr.yml | 1 - config/locales/validators/en.yml | 2 -- config/locales/validators/tr.yml | 2 -- .../20200129072653_add_disability_to_user.rb | 1 - db/structure.sql | 16 ---------------- test/models/student_disability_type_test.rb | 1 - test/models/user_test.rb | 4 ---- 14 files changed, 2 insertions(+), 60 deletions(-) delete mode 100644 app/validators/disability_validator.rb diff --git a/app/controllers/account/disability_controller.rb b/app/controllers/account/disability_controller.rb index bdfe50043..22b0f10dd 100644 --- a/app/controllers/account/disability_controller.rb +++ b/app/controllers/account/disability_controller.rb @@ -20,7 +20,7 @@ def set_user end def user_params - params.require(:user).permit(:disability_type_id, :disability_rate) + params.require(:user).permit(:disability_rate) end end end diff --git a/app/models/student_disability_type.rb b/app/models/student_disability_type.rb index 5c884ec24..e80cbe22c 100644 --- a/app/models/student_disability_type.rb +++ b/app/models/student_disability_type.rb @@ -7,5 +7,4 @@ class StudentDisabilityType < ApplicationRecord # relations has_many :prospective_students, dependent: :nullify - has_many :users, foreign_key: :disability_type_id, inverse_of: :disability_type, dependent: :nullify end diff --git a/app/models/user.rb b/app/models/user.rb index 96370a4b7..e9d50b241 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -57,10 +57,6 @@ class User < ApplicationRecord foreign_key: :id_number, dependent: :nullify, inverse_of: :user - belongs_to :disability_type, class_name: 'StudentDisabilityType', - foreign_key: 'disability_type_id', - inverse_of: :users, - optional: true # validations validates :disability_rate, numericality: { only_integer: true, @@ -89,7 +85,6 @@ class User < ApplicationRecord validates :twitter, allow_blank: true, length: { maximum: 50 } validates :website, allow_blank: true, length: { maximum: 50 } validates_with ImageValidator, field: :avatar, if: proc { |a| a.avatar.attached? } - validates_with DisabilityValidator # callbacks after_create_commit :build_address_information, if: proc { addresses.formal.empty? } diff --git a/app/validators/disability_validator.rb b/app/validators/disability_validator.rb deleted file mode 100644 index 1fada3059..000000000 --- a/app/validators/disability_validator.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class DisabilityValidator < ActiveModel::Validator - def validate(record) - @user = record - - @user.errors[:base] << I18n.t('.validators.disability.disability_error') unless both_empty? || both_full? - end - - private - - def both_empty? - !@user.disability_type_id? && @user.disability_rate&.zero? - end - - def both_full? - @user.disability_type_id? && !@user.disability_rate&.zero? - end -end diff --git a/app/views/account/disability/edit.html.erb b/app/views/account/disability/edit.html.erb index 3fcbee180..27a031b0f 100644 --- a/app/views/account/disability/edit.html.erb +++ b/app/views/account/disability/edit.html.erb @@ -12,10 +12,7 @@ <%= f.error_notification %> <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> -
- <%= f.association :disability_type %> -
-
+
<%= f.input :disability_rate %>
diff --git a/app/views/users/_disability.html.erb b/app/views/users/_disability.html.erb index bdc1484ef..65f97cea3 100644 --- a/app/views/users/_disability.html.erb +++ b/app/views/users/_disability.html.erb @@ -10,13 +10,11 @@ - - diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index 353c785df..9086d335a 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -61,7 +61,6 @@ en: disability: disability_status: Disability Status rate: Disability Rate - type: Disability Type edit: form_title: Edit Account employees: diff --git a/config/locales/models/user/tr.yml b/config/locales/models/user/tr.yml index ceee5a3df..7e179cb7e 100644 --- a/config/locales/models/user/tr.yml +++ b/config/locales/models/user/tr.yml @@ -67,7 +67,6 @@ tr: disability: disability_status: Engel Durumu rate: Engel Oranı - type: Engel Türü edit: form_title: Hesabı Düzenle employees: diff --git a/config/locales/validators/en.yml b/config/locales/validators/en.yml index fab97d3f9..b498b3870 100644 --- a/config/locales/validators/en.yml +++ b/config/locales/validators/en.yml @@ -18,8 +18,6 @@ en: before: must be before than %{restriction} comparison_value: Comparison value eql: must be eql %{restriction} - disability: - disability_error: Both the type of disability and the rate of disability must be filled. duty: active_and_tenure: This user already has an active and tenure duty. Edit the existing duty or make it passive in order to create a new one. invalid_end_date: Start date is selected as a date after the end date diff --git a/config/locales/validators/tr.yml b/config/locales/validators/tr.yml index 4721cf463..49d5a2cdf 100644 --- a/config/locales/validators/tr.yml +++ b/config/locales/validators/tr.yml @@ -18,8 +18,6 @@ tr: before: "%{restriction} tarihinden önce olmalı" comparison_value: Karşılaştırma değeri eql: "%{restriction} tarihine eşit olmalı" - disability: - disability_error: Engel türü ve engel oranının ikisi de doldurulmalı. duty: active_and_tenure: Bu personelin zaten aktif ve kadrolu bir görevi var! Yeni kayıt girmek yerine aktif kaydı düzenleyin veya öncelikle aktif kaydı pasifleştirin. invalid_end_date: Görev başlangıç tarihi bitiş tarihinden sonraki bir tarih olarak seçilmiş. diff --git a/db/migrate/20200129072653_add_disability_to_user.rb b/db/migrate/20200129072653_add_disability_to_user.rb index 6f9b5ec7d..88fbc8427 100644 --- a/db/migrate/20200129072653_add_disability_to_user.rb +++ b/db/migrate/20200129072653_add_disability_to_user.rb @@ -2,7 +2,6 @@ class AddDisabilityToUser < ActiveRecord::Migration[6.0] def change - add_reference :users, :disability_type, foreign_key: { to_table: 'student_disability_types' } add_column :users, :disability_rate, :integer, default: 0 add_numericality_constraint :users, :disability_rate, greater_than_or_equal_to: 0, less_than_or_equal_to: 100 diff --git a/db/structure.sql b/db/structure.sql index af79e3f2f..2235faa3f 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -3625,7 +3625,6 @@ CREATE TABLE public.users ( mobile_phone character varying, books_count integer DEFAULT 0, papers_count integer DEFAULT 0, - disability_type_id bigint, disability_rate integer DEFAULT 0, CONSTRAINT users_activated_null CHECK ((activated IS NOT NULL)), CONSTRAINT users_articles_count_null CHECK ((articles_count IS NOT NULL)), @@ -6135,13 +6134,6 @@ CREATE INDEX index_units_on_university_type_id ON public.units USING btree (univ CREATE UNIQUE INDEX index_user_id_and_role_id ON public.role_assignments USING btree (user_id, role_id); --- --- Name: index_users_on_disability_type_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_users_on_disability_type_id ON public.users USING btree (disability_type_id); - - -- -- Name: index_users_on_email; Type: INDEX; Schema: public; Owner: - -- @@ -6931,14 +6923,6 @@ ALTER TABLE ONLY public.course_assessment_methods ADD CONSTRAINT fk_rails_f2b5f80e2c FOREIGN KEY (assessment_method_id) REFERENCES public.assessment_methods(id); --- --- Name: users fk_rails_f5440d526e; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.users - ADD CONSTRAINT fk_rails_f5440d526e FOREIGN KEY (disability_type_id) REFERENCES public.student_disability_types(id); - - -- -- Name: available_courses fk_rails_f75b60bc6a; Type: FK CONSTRAINT; Schema: public; Owner: - -- diff --git a/test/models/student_disability_type_test.rb b/test/models/student_disability_type_test.rb index ef944ca00..28aee9ac1 100644 --- a/test/models/student_disability_type_test.rb +++ b/test/models/student_disability_type_test.rb @@ -8,5 +8,4 @@ class StudentDisabilityTypeTest < ActiveSupport::TestCase # relations has_many :prospective_students, dependent: :nullify - has_many :users, foreign_key: :disability_type_id, inverse_of: :disability_type, dependent: :nullify end diff --git a/test/models/user_test.rb b/test/models/user_test.rb index 5a4023454..e37407d33 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -28,10 +28,6 @@ class UserTest < ActiveSupport::TestCase has_many :role_assignments, class_name: 'Patron::RoleAssignment', dependent: :destroy has_many :roles, class_name: 'Patron::Role', through: :role_assignments has_many :permissions, class_name: 'Patron::Permission', through: :roles - belongs_to :disability_type, class_name: 'StudentDisabilityType', - foreign_key: 'disability_type_id', - inverse_of: :users, - optional: true # validations: presence validates_presence_of :email From fbce03dddefc332f7eaf67bc9993928d1377784a Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 5 Feb 2020 11:30:21 +0300 Subject: [PATCH 046/970] Remove redundant translations --- config/locales/models/user/en.yml | 1 - config/locales/models/user/tr.yml | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index 9086d335a..3f95bf879 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -26,7 +26,6 @@ en: country: Country current_password: Current Password disability_rate: Disability Rate - disability_type: Disability Type email: E-mail id_number: ID Number mobile_phone: Mobile Phone diff --git a/config/locales/models/user/tr.yml b/config/locales/models/user/tr.yml index 7e179cb7e..7f7f0246c 100644 --- a/config/locales/models/user/tr.yml +++ b/config/locales/models/user/tr.yml @@ -26,7 +26,6 @@ tr: country: Ülke current_password: Mevcut Parola disability_rate: Engel Oranı - disability_type: Engel Türü email: E-posta Adresi id_number: Kimlik Numarası mobile_phone: Cep Telefonu @@ -65,8 +64,8 @@ tr: success: Kullanıcı başarıyla silindi! warning: Kullanıcı silinemedi! disability: - disability_status: Engel Durumu - rate: Engel Oranı + disability_status: Engel Durumu + rate: Engel Oranı edit: form_title: Hesabı Düzenle employees: From 74f08dd519321130eef9d947c20392948146c8be Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 5 Feb 2020 19:16:17 +0300 Subject: [PATCH 047/970] Fix typo --- app/views/users/_disability.html.erb | 2 +- app/views/users/show.html.erb | 2 +- config/locales/controllers/account/disability.en.yml | 2 +- config/locales/models/user/en.yml | 2 +- config/locales/models/user/tr.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/users/_disability.html.erb b/app/views/users/_disability.html.erb index 65f97cea3..61a27e67f 100644 --- a/app/views/users/_disability.html.erb +++ b/app/views/users/_disability.html.erb @@ -20,4 +20,4 @@
<%= t('.type') %> <%= t('.rate') %>
<%= @user.disability_type&.name %> <%= number_to_percentage(@user.disability_rate, precision: 0) %>
-
\ No newline at end of file + diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 41aa3bcc3..40dae5b66 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -19,7 +19,7 @@
diff --git a/config/locales/controllers/account/disability.en.yml b/config/locales/controllers/account/disability.en.yml index 3b6f21ff2..a2c383d18 100644 --- a/config/locales/controllers/account/disability.en.yml +++ b/config/locales/controllers/account/disability.en.yml @@ -4,4 +4,4 @@ en: edit: form_title: Update the Disability Status update: - success: Disability status successfully updated. \ No newline at end of file + success: Disability status successfully updated. diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index 3f95bf879..e898cef71 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -94,6 +94,6 @@ en: addresses: Addresses employees: Employees identities: Identities - other_informations: Other Informations + other_information: Other Information update: success: User successfully updated. diff --git a/config/locales/models/user/tr.yml b/config/locales/models/user/tr.yml index 7f7f0246c..879b19a59 100644 --- a/config/locales/models/user/tr.yml +++ b/config/locales/models/user/tr.yml @@ -107,6 +107,6 @@ tr: addresses: Adres Bilgileri employees: Personel İşlemleri identities: Kimlik Bilgileri - other_informations: Diğer Bilgiler + other_information: Diğer Bilgiler update: success: Kullanıcı başarıyla güncellendi. From deaa5956f822d30cc61c164ad0d0943f6393d5f6 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 6 Feb 2020 10:45:27 +0300 Subject: [PATCH 048/970] Remove redundant method from disability controller --- app/controllers/account/disability_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/account/disability_controller.rb b/app/controllers/account/disability_controller.rb index 22b0f10dd..d700d55c1 100644 --- a/app/controllers/account/disability_controller.rb +++ b/app/controllers/account/disability_controller.rb @@ -16,7 +16,6 @@ def update def set_user @user = User.friendly.find(params[:user_id]) - not_found unless @user end def user_params From 7a51e059153c2541ab031b3d6ded145e220d18ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Thu, 6 Feb 2020 12:23:56 +0300 Subject: [PATCH 049/970] Include upper bound when counting attempts Otherwise, testing assumptions relied upon the exact upper bound of loop guard fails. --- plugins/support/lib/nokul/support/codification/coder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/support/lib/nokul/support/codification/coder.rb b/plugins/support/lib/nokul/support/codification/coder.rb index 7de32e8b2..5d645cd97 100644 --- a/plugins/support/lib/nokul/support/codification/coder.rb +++ b/plugins/support/lib/nokul/support/codification/coder.rb @@ -21,7 +21,7 @@ def initialize(code, **options) def run_verbose n = 0 - while (n += 1) < LOOP_GUARD + while (n += 1) <= LOOP_GUARD over_loop!(n) attempt = try From 8c144b83734ed1170a4c8f59958e0f3741f6bc08 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 7 Feb 2020 11:23:15 +0300 Subject: [PATCH 050/970] Create scholarship_types table --- .../20200206083358_create_scholarship_type.rb | 12 +++++ db/structure.sql | 51 ++++++++++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20200206083358_create_scholarship_type.rb diff --git a/db/migrate/20200206083358_create_scholarship_type.rb b/db/migrate/20200206083358_create_scholarship_type.rb new file mode 100644 index 000000000..ac462f5e2 --- /dev/null +++ b/db/migrate/20200206083358_create_scholarship_type.rb @@ -0,0 +1,12 @@ +class CreateScholarshipType < ActiveRecord::Migration[6.0] + def change + create_table :scholarship_types do |t| + t.string :name + t.boolean :active, default: true + end + + add_null_constraint :scholarship_types, :active + add_presence_constraint :scholarship_types, :name + add_length_constraint :scholarship_types, :name, less_than_or_equal_to: 255 + end +end diff --git a/db/structure.sql b/db/structure.sql index 2235faa3f..174d163e8 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -2824,6 +2824,39 @@ CREATE TABLE public.schema_migrations ( ); +-- +-- Name: scholarship_types; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.scholarship_types ( + id bigint NOT NULL, + name character varying, + active boolean DEFAULT true, + CONSTRAINT scholarship_types_active_null CHECK ((active IS NOT NULL)), + CONSTRAINT scholarship_types_name_length CHECK ((length((name)::text) <= 255)), + CONSTRAINT scholarship_types_name_presence CHECK (((name IS NOT NULL) AND ((name)::text !~ '^\s*$'::text))) +); + + +-- +-- Name: scholarship_types_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.scholarship_types_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: scholarship_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.scholarship_types_id_seq OWNED BY public.scholarship_types.id; + + -- -- Name: scope_assignments; Type: TABLE; Schema: public; Owner: - -- @@ -4119,6 +4152,13 @@ ALTER TABLE ONLY public.role_permissions ALTER COLUMN id SET DEFAULT nextval('pu ALTER TABLE ONLY public.roles ALTER COLUMN id SET DEFAULT nextval('public.roles_id_seq'::regclass); +-- +-- Name: scholarship_types id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.scholarship_types ALTER COLUMN id SET DEFAULT nextval('public.scholarship_types_id_seq'::regclass); + + -- -- Name: scope_assignments id; Type: DEFAULT; Schema: public; Owner: - -- @@ -4929,6 +4969,14 @@ ALTER TABLE ONLY public.schema_migrations ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); +-- +-- Name: scholarship_types scholarship_types_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.scholarship_types + ADD CONSTRAINT scholarship_types_pkey PRIMARY KEY (id); + + -- -- Name: scope_assignments scope_assignments_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -7065,6 +7113,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200102083736'), ('20200122124332'), ('20200123164837'), -('20200129072653'); +('20200129072653'), +('20200206083358'); From 636c929337a2a6dbd3f0c394debf53a6cd7399cf Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 7 Feb 2020 11:36:05 +0300 Subject: [PATCH 051/970] Create scholarship type model --- app/models/scholarship_type.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 app/models/scholarship_type.rb diff --git a/app/models/scholarship_type.rb b/app/models/scholarship_type.rb new file mode 100644 index 000000000..a25155aaa --- /dev/null +++ b/app/models/scholarship_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class ScholarshipType < ApplicationRecord + # search + include ReferenceSearch + + # validations + validates :name, presence: true, uniqueness: true, length: { maximum: 255 } + validates :active, inclusion: { in: [true, false] } +end From 6bc7e7eccba8a5b86935399e8dde4a702faa8a68 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 00:34:35 +0000 Subject: [PATCH 052/970] chore(deps): bump highcharts from 7.2.1 to 8.0.0 Bumps [highcharts](https://github.com/highcharts/highcharts-dist) from 7.2.1 to 8.0.0. - [Release notes](https://github.com/highcharts/highcharts-dist/releases) - [Commits](https://github.com/highcharts/highcharts-dist/compare/v7.2.1...v8.0.0) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 54df6b22f..f908d3111 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "chalk": "^3.0.0", "echarts": "^4.5.0", "flatpickr": "^4.6.3", - "highcharts": "^7.2.1", + "highcharts": "^8.0.0", "intl-tel-input": "^16.0.8", "jquery.maskedinput": "^1.4.1", "select2": "^4.0.12", diff --git a/yarn.lock b/yarn.lock index 7ccd64aeb..f8c9a89f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3871,10 +3871,10 @@ hex-color-regex@^1.1.0: resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== -highcharts@^7.2.1: - version "7.2.1" - resolved "https://registry.yarnpkg.com/highcharts/-/highcharts-7.2.1.tgz#313c434bbfd4525a72b76c6bfbd9c39dfe2d1993" - integrity sha512-/fSUZiONmM+x49IQJNf8XwZGiNGOPRmxEOcd0xdJP9Xc3OlG46ZiUWgSLfhYQ9Oyhmzc3V3SKYCLud8+rKLi+w== +highcharts@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/highcharts/-/highcharts-8.0.0.tgz#fcf77a511d6ea477b9d8447afd9dedbfc85e2727" + integrity sha512-jRKLiP0i29zKSEgMDASyrfpivrM3e8V8yTv8YUZtRzB2mXR+hsBNHWZw2hNRZVxqq1QCVmW/9Z/BLFvYlJELqA== hmac-drbg@^1.0.0: version "1.0.1" From b7e968e74579cf630bd2826abb6d9bc3baa86569 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 00:35:46 +0000 Subject: [PATCH 053/970] chore(deps-dev): bump eslint-plugin-import from 2.19.1 to 2.20.1 Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.19.1 to 2.20.1. - [Release notes](https://github.com/benmosher/eslint-plugin-import/releases) - [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md) - [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.19.1...v2.20.1) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 54df6b22f..b6cae9cb6 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "babel-eslint": "^10.0.3", "eslint": "^6.7.2", "eslint-config-standard": "^14.1.0", - "eslint-plugin-import": "^2.16.0", + "eslint-plugin-import": "^2.20.1", "eslint-plugin-node": "^10.0.0", "eslint-plugin-promise": "^4.0.1", "eslint-plugin-standard": "^4.0.0", diff --git a/yarn.lock b/yarn.lock index 7ccd64aeb..1ae2ce4b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2982,10 +2982,10 @@ eslint-plugin-es@^2.0.0: eslint-utils "^1.4.2" regexpp "^3.0.0" -eslint-plugin-import@^2.16.0: - version "2.19.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.19.1.tgz#5654e10b7839d064dd0d46cd1b88ec2133a11448" - integrity sha512-x68131aKoCZlCae7rDXKSAQmbT5DQuManyXo2sK6fJJ0aK5CWAkv6A6HJZGgqC8IhjQxYPgo6/IY4Oz8AFsbBw== +eslint-plugin-import@^2.20.1: + version "2.20.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.1.tgz#802423196dcb11d9ce8435a5fc02a6d3b46939b3" + integrity sha512-qQHgFOTjguR+LnYRoToeZWT62XM55MBVXObHM6SKFd1VzDcX/vqT1kAz8ssqigh5eMj8qXcRoXXGZpPP6RfdCw== dependencies: array-includes "^3.0.3" array.prototype.flat "^1.2.1" From 709eff81d0f3040540b282713e62a478b5c38cec Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 00:36:40 +0000 Subject: [PATCH 054/970] chore(deps): bump pnp-webpack-plugin from 1.5.0 to 1.6.0 Bumps [pnp-webpack-plugin](https://github.com/arcanis/pnp-webpack-plugin) from 1.5.0 to 1.6.0. - [Release notes](https://github.com/arcanis/pnp-webpack-plugin/releases) - [Commits](https://github.com/arcanis/pnp-webpack-plugin/compare/v1.5.0...v1.6.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7ccd64aeb..0a18ee87b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5983,9 +5983,9 @@ pkg-dir@^4.1.0: find-up "^4.0.0" pnp-webpack-plugin@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/pnp-webpack-plugin/-/pnp-webpack-plugin-1.5.0.tgz#62a1cd3068f46d564bb33c56eb250e4d586676eb" - integrity sha512-jd9olUr9D7do+RN8Wspzhpxhgp1n6Vd0NtQ4SFkmIACZoEL1nkyAdW9Ygrinjec0vgDcWjscFQQ1gDW8rsfKTg== + version "1.6.0" + resolved "https://registry.yarnpkg.com/pnp-webpack-plugin/-/pnp-webpack-plugin-1.6.0.tgz#d5c068013a2fdc82224ca50ed179c8fba9036a8e" + integrity sha512-ZcMGn/xF/fCOq+9kWMP9vVVxjIkMCja72oy3lziR7UHy0hHFZ57iVpQ71OtveVbmzeCmphBg8pxNdk/hlK99aQ== dependencies: ts-pnp "^1.1.2" From 14712324633fd513a3966fbe21d9f0628352024f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 00:37:51 +0000 Subject: [PATCH 055/970] chore(deps): bump popper.js from 1.16.0 to 1.16.1 Bumps [popper.js](https://github.com/FezVrasta/popper.js) from 1.16.0 to 1.16.1. - [Release notes](https://github.com/FezVrasta/popper.js/releases) - [Commits](https://github.com/FezVrasta/popper.js/commits) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7ccd64aeb..90340659e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5990,9 +5990,9 @@ pnp-webpack-plugin@^1.5.0: ts-pnp "^1.1.2" popper.js@^1.15.0: - version "1.16.0" - resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.0.tgz#2e1816bcbbaa518ea6c2e15a466f4cb9c6e2fbb3" - integrity sha512-+G+EkOPoE5S/zChTpmBSSDYmhXJ5PsW8eMhH8cP/CQHMFPBG/kC9Y5IIw6qNYgdJ+/COf0ddY2li28iHaZRSjw== + version "1.16.1" + resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b" + integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ== portfinder@^1.0.25: version "1.0.25" From 8aa25525b5f38dca9943b5979d9e1d693e5f85e4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 00:38:53 +0000 Subject: [PATCH 056/970] chore(deps): bump uuid from 3.3.3 to 3.4.0 Bumps [uuid](https://github.com/uuidjs/uuid) from 3.3.3 to 3.4.0. - [Release notes](https://github.com/uuidjs/uuid/releases) - [Changelog](https://github.com/uuidjs/uuid/blob/master/CHANGELOG.md) - [Commits](https://github.com/uuidjs/uuid/compare/v3.3.3...v3.4.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7ccd64aeb..cb04d584a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8292,12 +8292,7 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= -uuid@^3.0.1: - version "3.3.3" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" - integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== - -uuid@^3.3.2: +uuid@^3.0.1, uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== From 989898511b67f852da2f12f73e44598c3f779694 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 00:41:46 +0000 Subject: [PATCH 057/970] chore(deps-dev): bump webmock from 3.8.0 to 3.8.1 Bumps [webmock](https://github.com/bblimke/webmock) from 3.8.0 to 3.8.1. - [Release notes](https://github.com/bblimke/webmock/releases) - [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md) - [Commits](https://github.com/bblimke/webmock/compare/v3.8.0...v3.8.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff144afc4..db0ef57d4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -446,7 +446,7 @@ GEM webfinger (1.1.0) activesupport httpclient (>= 2.4) - webmock (3.8.0) + webmock (3.8.1) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) From 0caa9fb4212ee5e3d1f751476eaf282eb3bb0c3a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 00:42:17 +0000 Subject: [PATCH 058/970] chore(deps): bump rack from 2.1.2 to 2.2.1 Bumps [rack](https://github.com/rack/rack) from 2.1.2 to 2.2.1. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/master/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/2.1.2...v2.2.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff144afc4..27fdc7cc7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -286,7 +286,7 @@ GEM activesupport (>= 3.0.0) pwned (2.0.1) raabro (1.1.6) - rack (2.1.2) + rack (2.2.1) rack-attack (6.2.2) rack (>= 1.0, < 3) rack-mini-profiler (1.1.6) From 9e29870fb39cd8c280e9ea11b46531ea056a6ebe Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 00:42:53 +0000 Subject: [PATCH 059/970] chore(deps): bump aws-partitions from 1.269.0 to 1.271.0 Bumps [aws-partitions](https://github.com/aws/aws-sdk-ruby) from 1.269.0 to 1.271.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-partitions/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff144afc4..687304c80 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,7 +94,7 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.0.3) - aws-partitions (1.269.0) + aws-partitions (1.271.0) aws-sdk-core (3.89.1) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) From dd7f222da9f1ab7964166cce84d68a124511d47c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 00:43:27 +0000 Subject: [PATCH 060/970] chore(deps): bump aws-sdk-s3 from 1.60.1 to 1.60.2 Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.60.1 to 1.60.2. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/compare/v1.60.1...v1.60.2) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff144afc4..dcebd6243 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,7 +94,7 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.0.3) - aws-partitions (1.269.0) + aws-partitions (1.271.0) aws-sdk-core (3.89.1) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) @@ -103,7 +103,7 @@ GEM aws-sdk-kms (1.28.0) aws-sdk-core (~> 3, >= 3.71.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.60.1) + aws-sdk-s3 (1.60.2) aws-sdk-core (~> 3, >= 3.83.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) From eb458726eeeb8f3f6f4dac321be3418f4fda3ede Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 00:43:53 +0000 Subject: [PATCH 061/970] chore(deps): bump simple_form from 5.0.1 to 5.0.2 Bumps [simple_form](https://github.com/plataformatec/simple_form) from 5.0.1 to 5.0.2. - [Release notes](https://github.com/plataformatec/simple_form/releases) - [Changelog](https://github.com/heartcombo/simple_form/blob/master/CHANGELOG.md) - [Commits](https://github.com/plataformatec/simple_form/compare/v5.0.1...v5.0.2) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff144afc4..8e9009026 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -286,7 +286,7 @@ GEM activesupport (>= 3.0.0) pwned (2.0.1) raabro (1.1.6) - rack (2.1.2) + rack (2.2.1) rack-attack (6.2.2) rack (>= 1.0, < 3) rack-mini-profiler (1.1.6) @@ -383,7 +383,7 @@ GEM sidekiq-cron (1.1.0) fugit (~> 1.1) sidekiq (>= 4.2.1) - simple_form (5.0.1) + simple_form (5.0.2) actionpack (>= 5.0) activemodel (>= 5.0) simplecov (0.18.1) From db09f484212d81bb40590b39c931d83993ab2256 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 00:44:30 +0000 Subject: [PATCH 062/970] chore(deps): bump twilio-ruby from 5.31.3 to 5.31.4 Bumps [twilio-ruby](https://github.com/twilio/twilio-ruby) from 5.31.3 to 5.31.4. - [Release notes](https://github.com/twilio/twilio-ruby/releases) - [Changelog](https://github.com/twilio/twilio-ruby/blob/master/CHANGES.md) - [Commits](https://github.com/twilio/twilio-ruby/compare/5.31.3...5.31.4) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff144afc4..b774e8c52 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -413,7 +413,7 @@ GEM thor (0.20.3) thread_safe (0.3.6) tilt (2.0.10) - twilio-ruby (5.31.3) + twilio-ruby (5.31.4) faraday (~> 1.0.0) jwt (>= 1.5, <= 2.5) nokogiri (>= 1.6, < 2.0) From 19c9392da54aacbc2814482a7c753f5316f73c6c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 00:45:23 +0000 Subject: [PATCH 063/970] chore(deps-dev): bump rubocop-minitest from 0.5.1 to 0.6.0 Bumps [rubocop-minitest](https://github.com/rubocop-hq/rubocop-minitest) from 0.5.1 to 0.6.0. - [Release notes](https://github.com/rubocop-hq/rubocop-minitest/releases) - [Changelog](https://github.com/rubocop-hq/rubocop-minitest/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop-hq/rubocop-minitest/compare/v0.5.1...v0.6.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff144afc4..2181d3306 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -352,7 +352,7 @@ GEM rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.7) - rubocop-minitest (0.5.1) + rubocop-minitest (0.6.0) rubocop (>= 0.74) rubocop-performance (1.5.2) rubocop (>= 0.71.0) From 0db5f6bccc64ba68ae045f9ad12353b59bf546f2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 00:46:01 +0000 Subject: [PATCH 064/970] chore(deps): bump msgpack from 1.3.1 to 1.3.3 Bumps [msgpack](https://github.com/msgpack/msgpack-ruby) from 1.3.1 to 1.3.3. - [Release notes](https://github.com/msgpack/msgpack-ruby/releases) - [Changelog](https://github.com/msgpack/msgpack-ruby/blob/master/ChangeLog) - [Commits](https://github.com/msgpack/msgpack-ruby/compare/v1.3.1...v1.3.3) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff144afc4..2e599f9e9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -237,7 +237,7 @@ GEM minitest (5.14.0) minitest-focus (1.1.2) minitest (>= 4, < 6) - msgpack (1.3.1) + msgpack (1.3.3) multipart-post (2.1.1) net-ldap (0.16.2) nexmo (6.2.0) From 9644edaa4e68e53c5e51176cfe7afb58d8f14200 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 10 Feb 2020 12:44:57 +0300 Subject: [PATCH 065/970] Create controller and views of scholarship type --- .../reference/scholarship_types_controller.rb | 13 +++++++++ .../scholarship_types/_form.html.erb | 14 +++++++++ .../reference/scholarship_types/edit.html.erb | 1 + .../scholarship_types/index.html.erb | 8 +++++ .../reference/scholarship_types/new.html.erb | 1 + .../reference/scholarship_types.en.yml | 29 +++++++++++++++++++ .../reference/scholarship_types.tr.yml | 29 +++++++++++++++++++ config/routes/reference.rb | 1 + 8 files changed, 96 insertions(+) create mode 100644 app/controllers/reference/scholarship_types_controller.rb create mode 100644 app/views/reference/scholarship_types/_form.html.erb create mode 100644 app/views/reference/scholarship_types/edit.html.erb create mode 100644 app/views/reference/scholarship_types/index.html.erb create mode 100644 app/views/reference/scholarship_types/new.html.erb create mode 100644 config/locales/controllers/reference/scholarship_types.en.yml create mode 100644 config/locales/controllers/reference/scholarship_types.tr.yml diff --git a/app/controllers/reference/scholarship_types_controller.rb b/app/controllers/reference/scholarship_types_controller.rb new file mode 100644 index 000000000..874f53d2e --- /dev/null +++ b/app/controllers/reference/scholarship_types_controller.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Reference + class ScholarshipTypesController < ApplicationController + include ReferenceResource + + private + + def secure_params + params.require(:scholarship_type).permit(:name, :active) + end + end +end diff --git a/app/views/reference/scholarship_types/_form.html.erb b/app/views/reference/scholarship_types/_form.html.erb new file mode 100644 index 000000000..33ad5fa6a --- /dev/null +++ b/app/views/reference/scholarship_types/_form.html.erb @@ -0,0 +1,14 @@ +<%= render 'layouts/builders/form', + namespace: 'reference', + klass: @scholarship_type, + params: [ + { + field: 'name', + width: 12, + required: true + }, + { + field: 'active', + width: 12 + } + ] %> diff --git a/app/views/reference/scholarship_types/edit.html.erb b/app/views/reference/scholarship_types/edit.html.erb new file mode 100644 index 000000000..96486a36d --- /dev/null +++ b/app/views/reference/scholarship_types/edit.html.erb @@ -0,0 +1 @@ +<%= render 'form' %> \ No newline at end of file diff --git a/app/views/reference/scholarship_types/index.html.erb b/app/views/reference/scholarship_types/index.html.erb new file mode 100644 index 000000000..d38cf8cf2 --- /dev/null +++ b/app/views/reference/scholarship_types/index.html.erb @@ -0,0 +1,8 @@ +<%= render 'layouts/builders/index', + namespace: 'reference', + klass: 'scholarship_type', + collection: @scholarship_types, + pagy: @pagy, + card_header: t('.card_header'), + params: %w[name active], + actions: %w[edit destroy] %> diff --git a/app/views/reference/scholarship_types/new.html.erb b/app/views/reference/scholarship_types/new.html.erb new file mode 100644 index 000000000..96486a36d --- /dev/null +++ b/app/views/reference/scholarship_types/new.html.erb @@ -0,0 +1 @@ +<%= render 'form' %> \ No newline at end of file diff --git a/config/locales/controllers/reference/scholarship_types.en.yml b/config/locales/controllers/reference/scholarship_types.en.yml new file mode 100644 index 000000000..45201ab43 --- /dev/null +++ b/config/locales/controllers/reference/scholarship_types.en.yml @@ -0,0 +1,29 @@ +en: + activerecord: + attributes: + scholarship_type: &scholarship_type_attributes + active: Active? + name: Scholarship Type + enums: + scholarship_type: + actives: + 'true': 'Yes' + 'false': 'No' + helpers: + submit: + scholarship_type: + create: Create Scholarship Type + update: Update Scholarship Type + reference: + scholarship_types: + create: + success: Scholarship type successfully created. + destroy: + success: Scholarship type successfully deleted! + warning: Scholarship type can not be deleted. + index: + <<: *scholarship_type_attributes + card_header: Scholarship Types + new_scholarship_type_link: Create a New Scholarship Type + update: + success: Scholarship type successfully updated. diff --git a/config/locales/controllers/reference/scholarship_types.tr.yml b/config/locales/controllers/reference/scholarship_types.tr.yml new file mode 100644 index 000000000..2f9ed995d --- /dev/null +++ b/config/locales/controllers/reference/scholarship_types.tr.yml @@ -0,0 +1,29 @@ +tr: + activerecord: + attributes: + scholarship_type: &scholarship_type_attributes + active: Aktif mi? + name: Burs Türü + enums: + scholarship_type: + actives: + 'true': Evet + 'false': Hayır + helpers: + submit: + scholarship_type: + create: Burs Türü Oluştur + update: Burs Türü Güncelle + reference: + scholarship_types: + create: + success: Burs türü başarıyla oluşturuldu. + destroy: + success: Burs türü başarıyla silindi. + warning: Burs türü silinemedi! + index: + <<: *scholarship_type_attributes + card_header: Burs Türleri + new_scholarship_type_link: Yeni Burs Türü Oluştur + update: + success: Burs türü başarıyla güncellendi. \ No newline at end of file diff --git a/config/routes/reference.rb b/config/routes/reference.rb index 8630928cf..0792b200e 100644 --- a/config/routes/reference.rb +++ b/config/routes/reference.rb @@ -8,5 +8,6 @@ resources :evaluation_types, except: :show resources :high_school_types, except: :show resources :languages, except: :show + resources :scholarship_types, except: :show resources :titles, except: :show end From 797b7c0f5d9df0f3168ab797d3795dc6c07e0a5d Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 10 Feb 2020 12:45:53 +0300 Subject: [PATCH 066/970] Add scholarship link to reference dashboard --- app/views/reference/dashboard/index.html.erb | 3 +++ config/locales/controllers/reference/dashboard.en.yml | 1 + config/locales/controllers/reference/dashboard.tr.yml | 1 + 3 files changed, 5 insertions(+) diff --git a/app/views/reference/dashboard/index.html.erb b/app/views/reference/dashboard/index.html.erb index 3986f1bd3..9f9c4b617 100644 --- a/app/views/reference/dashboard/index.html.erb +++ b/app/views/reference/dashboard/index.html.erb @@ -43,6 +43,9 @@ <%= link_to %i[reference document_types], class: item_class do %> <%= t('.document_types') %> <% end %> + <%= link_to %i[reference scholarship_types], class: item_class do %> + <%= t('.scholarship_types') %> + <% end %> <%= link_to %i[reference languages], class: item_class do %> <%= t('.languages') %> <% end %> diff --git a/config/locales/controllers/reference/dashboard.en.yml b/config/locales/controllers/reference/dashboard.en.yml index 62c13ca61..290db4444 100644 --- a/config/locales/controllers/reference/dashboard.en.yml +++ b/config/locales/controllers/reference/dashboard.en.yml @@ -13,5 +13,6 @@ en: languages: Languages locations: Locations other_references: Other References + scholarship_types: Scholarship Types term_references: Term References titles: Titles diff --git a/config/locales/controllers/reference/dashboard.tr.yml b/config/locales/controllers/reference/dashboard.tr.yml index 8cedb9963..4f2d30753 100644 --- a/config/locales/controllers/reference/dashboard.tr.yml +++ b/config/locales/controllers/reference/dashboard.tr.yml @@ -13,5 +13,6 @@ tr: languages: Diller locations: Konumlar other_references: Diğer Tanımlar + scholarship_types: Burs Türleri term_references: Dönem Tanımları titles: Unvanlar From 5242a04a810a30d6d3d4e6b3ca27878805e912fe Mon Sep 17 00:00:00 2001 From: isubas Date: Mon, 10 Feb 2020 12:47:49 +0300 Subject: [PATCH 067/970] Fix rubocop offence --- test/services/activation/activation_service_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/services/activation/activation_service_test.rb b/test/services/activation/activation_service_test.rb index e57fe80ec..9d29596d7 100644 --- a/test/services/activation/activation_service_test.rb +++ b/test/services/activation/activation_service_test.rb @@ -37,7 +37,7 @@ class ActivationServiceTest < ActiveSupport::TestCase test 'check numericality and length validations' do assert_equal 11, @activation.id_number.length assert_equal 9, @activation.document_no.length - assert @activation.id_number.match(/\A\d+\z/) + assert_match @activation.id_number, /\A\d+\z/ end test 'phone number must be checked with country' do From 628cea67a7dfb816a982936a9a31168c9f071e98 Mon Sep 17 00:00:00 2001 From: isubas Date: Mon, 10 Feb 2020 13:21:57 +0300 Subject: [PATCH 068/970] Fix test --- test/services/activation/activation_service_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/services/activation/activation_service_test.rb b/test/services/activation/activation_service_test.rb index 9d29596d7..6a8017602 100644 --- a/test/services/activation/activation_service_test.rb +++ b/test/services/activation/activation_service_test.rb @@ -37,7 +37,7 @@ class ActivationServiceTest < ActiveSupport::TestCase test 'check numericality and length validations' do assert_equal 11, @activation.id_number.length assert_equal 9, @activation.document_no.length - assert_match @activation.id_number, /\A\d+\z/ + assert_match(/\A\d+\z/, @activation.id_number) end test 'phone number must be checked with country' do From 9f3f465f5d79846aee2a46e8b43b64056086ffe6 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 10 Feb 2020 14:11:57 +0300 Subject: [PATCH 069/970] Add tests of scholarship type --- .../scholarship_types_controller_test.rb | 14 ++++++++++++++ test/fixtures/scholarship_types.yml | 12 ++++++++++++ test/models/scholarship_type_test.rb | 17 +++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 test/controllers/reference/scholarship_types_controller_test.rb create mode 100644 test/fixtures/scholarship_types.yml create mode 100644 test/models/scholarship_type_test.rb diff --git a/test/controllers/reference/scholarship_types_controller_test.rb b/test/controllers/reference/scholarship_types_controller_test.rb new file mode 100644 index 000000000..73e55585a --- /dev/null +++ b/test/controllers/reference/scholarship_types_controller_test.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +require 'test_helper' +require_relative '../concerns/reference_resource_test' + +class ScholarshipTypesControllerTest < ActionDispatch::IntegrationTest + include ReferenceResourceTest + + setup do + @target_path = 'reference' + @create_params = { name: 'Test Create', active: true } + @update_params = { name: 'Test Update', active: false } + end +end diff --git a/test/fixtures/scholarship_types.yml b/test/fixtures/scholarship_types.yml new file mode 100644 index 000000000..8377b80fe --- /dev/null +++ b/test/fixtures/scholarship_types.yml @@ -0,0 +1,12 @@ +meb: + name: Milli Eğitim Bakanlığı + active: true +kkk: + name: Kara Kuvvetleri Komutanlığı + active: true +kyk: + name: KYK Bursu + active: true +scholarship_type_to_delete: + name: This scholarship type will be deleted + active: true diff --git a/test/models/scholarship_type_test.rb b/test/models/scholarship_type_test.rb new file mode 100644 index 000000000..f7ab758b5 --- /dev/null +++ b/test/models/scholarship_type_test.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'test_helper' + +class ScholarshipTypeTest < ActiveSupport::TestCase + extend Support::Minitest::ValidationHelper + + # validations: presence + validates_presence_of :name + validates_presence_of :active + + # validations: uniqueness + validates_uniqueness_of :name + + # validations: length + validates_length_of :name +end From 2fabc586b81ea36dbf63e384985f0b6a1534c21b Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Mon, 10 Feb 2020 15:55:03 +0300 Subject: [PATCH 070/970] Create given courses routes --- config/routes.rb | 1 + config/routes/instructiveness.rb | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 config/routes/instructiveness.rb diff --git a/config/routes.rb b/config/routes.rb index ec6a6beec..becba4776 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -17,6 +17,7 @@ draw :calendar_management draw :course_management draw :first_registration + draw :instructiveness draw :location draw :manager draw :meksis diff --git a/config/routes/instructiveness.rb b/config/routes/instructiveness.rb new file mode 100644 index 000000000..83623a4f7 --- /dev/null +++ b/config/routes/instructiveness.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +scope module: :instructiveness do + resources :given_courses, only: %i[index show] do + get :students, on: :member + end +end From 531449b9ea0f8b6a469fa48168ef206bb581affb Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Mon, 10 Feb 2020 15:55:28 +0300 Subject: [PATCH 071/970] Add given courses link to sidebar --- app/views/layouts/shared/_sidebar.html.erb | 5 +++++ config/locales/layouts/shared/sidebar.en.yml | 1 + config/locales/layouts/shared/sidebar.tr.yml | 1 + 3 files changed, 7 insertions(+) diff --git a/app/views/layouts/shared/_sidebar.html.erb b/app/views/layouts/shared/_sidebar.html.erb index 0acdddd6e..78cd58010 100644 --- a/app/views/layouts/shared/_sidebar.html.erb +++ b/app/views/layouts/shared/_sidebar.html.erb @@ -36,6 +36,11 @@ <%= fa_icon('book', text: t('.available_courses'), class: 'nav-icon') %> <% end %> +
From 8dd645dea7aa5c494215350cd2fc3e05cd87d889 Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 11 Feb 2020 11:12:15 +0300 Subject: [PATCH 082/970] Add link to back --- app/views/instructiveness/given_courses/show.html.erb | 2 +- app/views/instructiveness/given_courses/students.html.erb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/instructiveness/given_courses/show.html.erb b/app/views/instructiveness/given_courses/show.html.erb index 206474f0a..60dff339d 100644 --- a/app/views/instructiveness/given_courses/show.html.erb +++ b/app/views/instructiveness/given_courses/show.html.erb @@ -1,7 +1,7 @@
- <%= link_to_back :given_courses %> + <%= link_to_back(:back) %>
diff --git a/app/views/instructiveness/given_courses/students.html.erb b/app/views/instructiveness/given_courses/students.html.erb index 22909a3be..5036402d6 100644 --- a/app/views/instructiveness/given_courses/students.html.erb +++ b/app/views/instructiveness/given_courses/students.html.erb @@ -1,5 +1,8 @@
+
+ <%= link_to_back(:back) %> +
<%= fa_icon 'users' %><%= t('.students') %> From 7cdb4e4aedc5a63576b55f16b4459a1c8b8d1a0d Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 11 Feb 2020 11:29:31 +0300 Subject: [PATCH 083/970] Show only permanent enrollments --- app/views/instructiveness/given_courses/students.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/instructiveness/given_courses/students.html.erb b/app/views/instructiveness/given_courses/students.html.erb index 5036402d6..c0d658562 100644 --- a/app/views/instructiveness/given_courses/students.html.erb +++ b/app/views/instructiveness/given_courses/students.html.erb @@ -21,7 +21,7 @@ - <% group.course_enrollments.each do |enrollment| %> + <% group.course_enrollments.saved.each do |enrollment| %> <% student = enrollment.student %> <%= student.student_number %> From 73c6d904491442499916566334e036bf86175d46 Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 11 Feb 2020 11:35:41 +0300 Subject: [PATCH 084/970] Fix eager loading --- app/controllers/instructiveness/given_courses_controller.rb | 2 +- app/views/instructiveness/given_courses/students.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/instructiveness/given_courses_controller.rb b/app/controllers/instructiveness/given_courses_controller.rb index ba9ae625a..acbdf07a4 100644 --- a/app/controllers/instructiveness/given_courses_controller.rb +++ b/app/controllers/instructiveness/given_courses_controller.rb @@ -15,7 +15,7 @@ def show end def students - @groups = @course.groups.includes(course_enrollments: [semester_registration: [student: :user]]) + @groups = @course.groups end private diff --git a/app/views/instructiveness/given_courses/students.html.erb b/app/views/instructiveness/given_courses/students.html.erb index c0d658562..02739ca2f 100644 --- a/app/views/instructiveness/given_courses/students.html.erb +++ b/app/views/instructiveness/given_courses/students.html.erb @@ -21,7 +21,7 @@ - <% group.course_enrollments.saved.each do |enrollment| %> + <% group.course_enrollments.saved.includes(semester_registration: [student: :user]).each do |enrollment| %> <% student = enrollment.student %> <%= student.student_number %> From 72f885e471b31a9b2bd1df5629509676ecf5bcc9 Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 11 Feb 2020 12:14:38 +0300 Subject: [PATCH 085/970] Add search and pagination --- .../given_courses_controller.rb | 9 +++- .../given_courses/_search.html.erb | 43 +++++++++++++++++++ .../given_courses/index.html.erb | 8 ++++ .../instructiveness/given_courses.en.yml | 2 + .../instructiveness/given_courses.tr.yml | 2 + 5 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 app/views/instructiveness/given_courses/_search.html.erb diff --git a/app/controllers/instructiveness/given_courses_controller.rb b/app/controllers/instructiveness/given_courses_controller.rb index acbdf07a4..fc918d284 100644 --- a/app/controllers/instructiveness/given_courses_controller.rb +++ b/app/controllers/instructiveness/given_courses_controller.rb @@ -2,12 +2,17 @@ module Instructiveness class GivenCoursesController < ApplicationController + include SearchableModule + before_action :set_employee before_action :set_course, except: :index def index - @courses = @employee.given_courses.includes(:unit, curriculum_course: :course) - .order('units.name', 'courses.name') + courses = @employee.given_courses.includes(:unit, curriculum_course: :course) + .order('units.name', 'courses.name') + .dynamic_search(search_params(AvailableCourse)) + + @pagy, @courses = pagy(courses) end def show diff --git a/app/views/instructiveness/given_courses/_search.html.erb b/app/views/instructiveness/given_courses/_search.html.erb new file mode 100644 index 000000000..74d5c0144 --- /dev/null +++ b/app/views/instructiveness/given_courses/_search.html.erb @@ -0,0 +1,43 @@ +
+
+ +
+
+ <%= form_tag given_courses_path, method: :get do %> +
+
+ <%= label_tag :term, t('smart_search') %> + <%= text_field_tag :term, + params[:term], + placeholder: t('.smart_search_placeholder'), + class: 'form-control' %> +
+
+
+
+ <%= submit_tag t('search'), class: 'btn btn-primary' %> +
+
+ <% end %> +
+
+
+
diff --git a/app/views/instructiveness/given_courses/index.html.erb b/app/views/instructiveness/given_courses/index.html.erb index b6421b952..63da3d2aa 100644 --- a/app/views/instructiveness/given_courses/index.html.erb +++ b/app/views/instructiveness/given_courses/index.html.erb @@ -5,6 +5,7 @@ <%= fa_icon 'align-justify', text: t('.given_courses') %>
+ <%= render 'search' %> @@ -26,6 +27,13 @@
+
diff --git a/config/locales/controllers/instructiveness/given_courses.en.yml b/config/locales/controllers/instructiveness/given_courses.en.yml index 662156f66..3363f84a3 100644 --- a/config/locales/controllers/instructiveness/given_courses.en.yml +++ b/config/locales/controllers/instructiveness/given_courses.en.yml @@ -19,6 +19,8 @@ en: <<: *given_course_attributes given_courses: Given Courses course_code: Course Code + search: + smart_search_placeholder: Course Name / Course Code show: <<: *given_course_attributes coordinator: Coodinator diff --git a/config/locales/controllers/instructiveness/given_courses.tr.yml b/config/locales/controllers/instructiveness/given_courses.tr.yml index 7aad3c5c0..4810c2230 100644 --- a/config/locales/controllers/instructiveness/given_courses.tr.yml +++ b/config/locales/controllers/instructiveness/given_courses.tr.yml @@ -19,6 +19,8 @@ tr: <<: *given_course_attributes given_courses: Verilen Dersler course_code: Ders Kodu + search: + smart_search_placeholder: Ders Adı / Ders Kodu show: <<: *given_course_attributes coordinator: Koordinatör From 6c670779ebddd343c2d32b86cacffcff4e923b02 Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 11 Feb 2020 12:15:08 +0300 Subject: [PATCH 086/970] Add tests --- .../given_courses_controller_test.rb | 30 +++++++++++++++++++ test/fixtures/available_course_lecturers.yml | 2 +- test/fixtures/available_courses.yml | 2 +- test/models/available_course_group_test.rb | 4 +++ test/models/available_course_test.rb | 4 +++ test/models/course_enrollment_test.rb | 10 +++++++ test/models/employee_test.rb | 7 +++++ 7 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 test/controllers/instructiveness/given_courses_controller_test.rb diff --git a/test/controllers/instructiveness/given_courses_controller_test.rb b/test/controllers/instructiveness/given_courses_controller_test.rb new file mode 100644 index 000000000..5517eda4f --- /dev/null +++ b/test/controllers/instructiveness/given_courses_controller_test.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require 'test_helper' + +module Instructiveness + class GivenCoursesControllerTest < ActionDispatch::IntegrationTest + setup do + sign_in users(:serhat) + @course = available_courses(:compulsory_course) + end + + test 'should get index' do + get given_courses_path + assert_equal 'index', @controller.action_name + assert_response :success + end + + test 'should get show' do + get given_course_path(@course) + assert_equal 'show', @controller.action_name + assert_response :success + end + + test 'should get students' do + get students_given_course_path(@course) + assert_equal 'students', @controller.action_name + assert_response :success + end + end +end diff --git a/test/fixtures/available_course_lecturers.yml b/test/fixtures/available_course_lecturers.yml index 6418876bf..718a41f9e 100644 --- a/test/fixtures/available_course_lecturers.yml +++ b/test/fixtures/available_course_lecturers.yml @@ -28,5 +28,5 @@ compulsory_course_group_lecturer: coordinator: true compulsory_course_2_group_lecturer: group: compulsory_course_2_group - lecturer: serhat_active + lecturer: chief_john coordinator: true diff --git a/test/fixtures/available_courses.yml b/test/fixtures/available_courses.yml index 62ecb6754..48c013321 100644 --- a/test/fixtures/available_courses.yml +++ b/test/fixtures/available_courses.yml @@ -36,7 +36,7 @@ elective_course_2: compulsory_course: academic_term: active_term curriculum: bilgisayar_muhendisligi_mufredati - coordinator: serhat_passive + coordinator: serhat_active curriculum_course: compulsory_course unit: bilgisayar_muhendisligi diff --git a/test/models/available_course_group_test.rb b/test/models/available_course_group_test.rb index a65b9192e..ea001b961 100644 --- a/test/models/available_course_group_test.rb +++ b/test/models/available_course_group_test.rb @@ -31,4 +31,8 @@ class AvailableCourseGroupTest < ActiveSupport::TestCase assert available_course_groups(:elective_course_group).quota_full? assert_not available_course_groups(:elective_course_2_group).quota_full? end + + test 'number_of_enrolled_students method' do + assert_equal available_course_groups(:elective_course_group).number_of_enrolled_students, 1 + end end diff --git a/test/models/available_course_test.rb b/test/models/available_course_test.rb index 3d6fc4047..45757c584 100644 --- a/test/models/available_course_test.rb +++ b/test/models/available_course_test.rb @@ -55,4 +55,8 @@ class AvailableCourseTest < ActiveSupport::TestCase assert_includes enrollable_groups, available_course_groups(:elective_course_group_2) assert_not_includes enrollable_groups, available_course_groups(:elective_course_group) end + + test 'number_of_enrolled_students method' do + assert_equal available_courses(:elective_course).number_of_enrolled_students, 1 + end end diff --git a/test/models/course_enrollment_test.rb b/test/models/course_enrollment_test.rb index ab53b6a14..c35c03a79 100644 --- a/test/models/course_enrollment_test.rb +++ b/test/models/course_enrollment_test.rb @@ -21,4 +21,14 @@ class CourseEnrollmentTest < ActiveSupport::TestCase assert_not fake.valid? assert_not_empty fake.errors[:available_course] end + + # delegates + %i[ + ects + student + ].each do |property| + test "a course_enrollment reach #{property} parameter" do + assert course_enrollments(:elective).send(property) + end + end end diff --git a/test/models/employee_test.rb b/test/models/employee_test.rb index 69801ecb5..f03437a3a 100644 --- a/test/models/employee_test.rb +++ b/test/models/employee_test.rb @@ -63,4 +63,11 @@ class EmployeeTest < ActiveSupport::TestCase assert employees(:serhat_active).academic? assert_not employees(:chief_john).academic? end + + test 'given_courses method' do + given_courses = employees(:serhat_active).given_courses.to_a + assert_includes given_courses, available_courses(:compulsory_course) + assert_includes given_courses, available_courses(:elective_course) + assert_not_includes given_courses, available_courses(:compulsory_course_2) + end end From e90adf186d6d2118158ad08de8b2a058d935d0e9 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 11 Feb 2020 12:39:47 +0300 Subject: [PATCH 087/970] Add scholarship type to student --- ...1084915_add_scholarship_type_to_student.rb | 7 +++++++ db/structure.sql | 19 ++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20200211084915_add_scholarship_type_to_student.rb diff --git a/db/migrate/20200211084915_add_scholarship_type_to_student.rb b/db/migrate/20200211084915_add_scholarship_type_to_student.rb new file mode 100644 index 000000000..2fde4795a --- /dev/null +++ b/db/migrate/20200211084915_add_scholarship_type_to_student.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddScholarshipTypeToStudent < ActiveRecord::Migration[6.0] + def change + add_reference :students, :scholarship_type, foreign_key: true + end +end diff --git a/db/structure.sql b/db/structure.sql index 174d163e8..fa4899e20 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -3292,6 +3292,7 @@ CREATE TABLE public.students ( updated_at timestamp without time zone NOT NULL, semester integer, year integer, + scholarship_type_id bigint, CONSTRAINT students_permanently_registered_null CHECK ((permanently_registered IS NOT NULL)), CONSTRAINT students_semester_null CHECK ((semester IS NOT NULL)), CONSTRAINT students_semester_numericality CHECK ((semester > 0)), @@ -6098,6 +6099,13 @@ CREATE INDEX index_semester_registrations_on_academic_term_id ON public.semester CREATE INDEX index_semester_registrations_on_student_id ON public.semester_registrations USING btree (student_id); +-- +-- Name: index_students_on_scholarship_type_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_students_on_scholarship_type_id ON public.students USING btree (scholarship_type_id); + + -- -- Name: index_students_on_unit_id; Type: INDEX; Schema: public; Owner: - -- @@ -6563,6 +6571,14 @@ ALTER TABLE ONLY public.prospective_employees ADD CONSTRAINT fk_rails_7e3da1fde7 FOREIGN KEY (title_id) REFERENCES public.titles(id); +-- +-- Name: students fk_rails_818ba821f0; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.students + ADD CONSTRAINT fk_rails_818ba821f0 FOREIGN KEY (scholarship_type_id) REFERENCES public.scholarship_types(id); + + -- -- Name: units fk_rails_83a021318e; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7114,6 +7130,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200122124332'), ('20200123164837'), ('20200129072653'), -('20200206083358'); +('20200206083358'), +('20200211084915'); From 07ebdb722da10a781b4e852bc59bd4d2b6e94894 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 11 Feb 2020 12:47:32 +0300 Subject: [PATCH 088/970] Add relation to student and scholarship type --- app/models/scholarship_type.rb | 3 +++ app/models/student.rb | 1 + 2 files changed, 4 insertions(+) diff --git a/app/models/scholarship_type.rb b/app/models/scholarship_type.rb index a25155aaa..00afd4a8e 100644 --- a/app/models/scholarship_type.rb +++ b/app/models/scholarship_type.rb @@ -4,6 +4,9 @@ class ScholarshipType < ApplicationRecord # search include ReferenceSearch + # relations + has_many :students, dependent: :nullify + # validations validates :name, presence: true, uniqueness: true, length: { maximum: 255 } validates :active, inclusion: { in: [true, false] } diff --git a/app/models/student.rb b/app/models/student.rb index 803a02f71..9b7897fff 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -6,6 +6,7 @@ class Student < ApplicationRecord ldap_trigger :user # relations + belongs_to :scholarship_type, optional: true belongs_to :user belongs_to :unit has_one :identity, dependent: :destroy From d39f739be941f3f125eabaf31f05c0eb157f76db Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 11 Feb 2020 12:53:04 +0300 Subject: [PATCH 089/970] Add test of new relation --- test/models/scholarship_type_test.rb | 4 ++++ test/models/student_test.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/test/models/scholarship_type_test.rb b/test/models/scholarship_type_test.rb index f7ab758b5..d0902771c 100644 --- a/test/models/scholarship_type_test.rb +++ b/test/models/scholarship_type_test.rb @@ -3,8 +3,12 @@ require 'test_helper' class ScholarshipTypeTest < ActiveSupport::TestCase + extend Support::Minitest::AssociationHelper extend Support::Minitest::ValidationHelper + # relations + has_many :students, dependent: :nullify + # validations: presence validates_presence_of :name validates_presence_of :active diff --git a/test/models/student_test.rb b/test/models/student_test.rb index 75ecf6981..2597300bf 100644 --- a/test/models/student_test.rb +++ b/test/models/student_test.rb @@ -9,6 +9,7 @@ class StudentTest < ActiveSupport::TestCase include ActiveJob::TestHelper # relations + belongs_to :scholarship_type, optional: true belongs_to :user belongs_to :unit has_one :identity, dependent: :destroy From fd87320a36985461823514a580e77b1c0362667d Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 11 Feb 2020 13:30:38 +0300 Subject: [PATCH 090/970] Redirect if user has no employee record --- app/controllers/instructiveness/given_courses_controller.rb | 1 + config/locales/controllers/instructiveness/given_courses.en.yml | 2 ++ config/locales/controllers/instructiveness/given_courses.tr.yml | 2 ++ 3 files changed, 5 insertions(+) diff --git a/app/controllers/instructiveness/given_courses_controller.rb b/app/controllers/instructiveness/given_courses_controller.rb index fc918d284..38bbf00f3 100644 --- a/app/controllers/instructiveness/given_courses_controller.rb +++ b/app/controllers/instructiveness/given_courses_controller.rb @@ -27,6 +27,7 @@ def students def set_employee @employee = current_user.employees.active.last + redirect_to(root_path, alert: t('.errors.no_employee_record')) unless @employee end def set_course diff --git a/config/locales/controllers/instructiveness/given_courses.en.yml b/config/locales/controllers/instructiveness/given_courses.en.yml index 3363f84a3..234c8c1b7 100644 --- a/config/locales/controllers/instructiveness/given_courses.en.yml +++ b/config/locales/controllers/instructiveness/given_courses.en.yml @@ -1,6 +1,8 @@ en: instructiveness: given_courses: + errors: + no_employee_record: You have not an employee record. given_course: &given_course_attributes academic_term: Academic Term coordinator: Coordinator diff --git a/config/locales/controllers/instructiveness/given_courses.tr.yml b/config/locales/controllers/instructiveness/given_courses.tr.yml index 4810c2230..c8f8d4a70 100644 --- a/config/locales/controllers/instructiveness/given_courses.tr.yml +++ b/config/locales/controllers/instructiveness/given_courses.tr.yml @@ -1,6 +1,8 @@ tr: instructiveness: given_courses: + errors: + no_employee_record: Personel kaydınız bulunmamaktadır. given_course: &given_course_attributes academic_term: Akademik Dönem coordinator: Koordinatör From 4358597314780784295959ca472cf99ad3cee411 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 11 Feb 2020 13:52:53 +0300 Subject: [PATCH 091/970] Show student informations of user --- app/controllers/users_controller.rb | 1 + app/models/student.rb | 2 ++ app/views/users/_students.html.erb | 28 ++++++++++++++++++++++++++++ app/views/users/show.html.erb | 5 +++++ config/locales/models/user/en.yml | 6 ++++++ config/locales/models/user/tr.yml | 6 ++++++ 6 files changed, 48 insertions(+) create mode 100644 app/views/users/_students.html.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c907a7d90..4baf7f503 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -18,6 +18,7 @@ def show @addresses = @user.addresses.includes(district: :city) @employees = @user.employees.includes(:title).order(active: :desc) @duties = @user.duties.includes(:unit) + @students = @user.students.includes(:unit, :scholarship_type) @positions = @user.positions.includes(:administrative_function, :duty) end diff --git a/app/models/student.rb b/app/models/student.rb index 9b7897fff..47740d58d 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -29,6 +29,8 @@ class Student < ApplicationRecord # delegations delegate :addresses, to: :user + delegate :name, to: :unit, prefix: true + delegate :name, to: :scholarship_type, prefix: true, allow_nil: true # background jobs after_create_commit :build_identity_information, if: proc { identity.nil? } diff --git a/app/views/users/_students.html.erb b/app/views/users/_students.html.erb new file mode 100644 index 000000000..8ddbb1162 --- /dev/null +++ b/app/views/users/_students.html.erb @@ -0,0 +1,28 @@ +<% @students.each do |student| %> +
+
+ <%= fa_icon 'user', text: student.unit_name %> +
+ +
+ + + + + + + + + + + + + + + + + +
<%= t('.student_number') %><%= t('year') %><%= t('semester') %><%= t('.scholarship_type') %>
<%= student.student_number %><%= student.year %><%= student.semester %><%= student.scholarship_type_name %>
+
+
+<% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 40dae5b66..e64d0dce1 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -13,6 +13,10 @@ <%= fa_icon 'home' %> <%= t('.addresses') %> +
+
<%= render 'students' %>
<%= render 'employees' %>
<%= render 'disability' %>
diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index e898cef71..c7de3c4cc 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -19,6 +19,9 @@ en: administrative_function_id: Administrative Function end_date: End Date start_date: Start Date + student: &student_attributes + student_number: Student Number + scholarship_type: Scholarship Type user: &user_attributes activated: Account Activation activated_at: Account Activation Date @@ -95,5 +98,8 @@ en: employees: Employees identities: Identities other_information: Other Information + students: Öğrenci Bilgileri + students: + <<: *student_attributes update: success: User successfully updated. diff --git a/config/locales/models/user/tr.yml b/config/locales/models/user/tr.yml index 879b19a59..1b5d17096 100644 --- a/config/locales/models/user/tr.yml +++ b/config/locales/models/user/tr.yml @@ -19,6 +19,9 @@ tr: administrative_function_id: Görev end_date: Bitiş Tarihi start_date: Başlangıç Tarihi + student: &student_attributes + student_number: Öğrenci Numarası + scholarship_type: Burs Türü user: &user_attributes activated: Hesap Aktifleştirme activated_at: Hesap Aktifleştirme Tarihi @@ -108,5 +111,8 @@ tr: employees: Personel İşlemleri identities: Kimlik Bilgileri other_information: Diğer Bilgiler + students: Öğrenci Bilgileri + students: + <<: *student_attributes update: success: Kullanıcı başarıyla güncellendi. From ac6cc3809302233ed6ec1fb8e5d9df2d33154994 Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 11 Feb 2020 13:52:57 +0300 Subject: [PATCH 092/970] Make all lecturer of the group can see the course --- app/models/employee.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/employee.rb b/app/models/employee.rb index d73fcd83b..9ccc264cf 100644 --- a/app/models/employee.rb +++ b/app/models/employee.rb @@ -38,6 +38,6 @@ def academic? def given_courses AvailableCourse.joins(groups: :lecturers) - .where('coordinator_id = ? OR (coordinator = ? AND lecturer_id = ?)', id, true, id) + .where('coordinator_id = ? OR lecturer_id = ?', id, id) end end From cdbc60ff43bce6983f820840947247079702e35b Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 11 Feb 2020 13:55:34 +0300 Subject: [PATCH 093/970] Add new test --- test/fixtures/available_course_lecturers.yml | 5 ++++- test/models/employee_test.rb | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/fixtures/available_course_lecturers.yml b/test/fixtures/available_course_lecturers.yml index 718a41f9e..351b117f3 100644 --- a/test/fixtures/available_course_lecturers.yml +++ b/test/fixtures/available_course_lecturers.yml @@ -20,8 +20,11 @@ elective_course_2_group_lecturer: coordinator: true elective_course_2_group_lecturer: group: elective_course_group - lecturer: serhat_active + lecturer: chief_john coordinator: true +elective_course_2_group_lecturer: + group: elective_course_group + lecturer: serhat_active compulsory_course_group_lecturer: group: compulsory_course_group lecturer: serhat_active diff --git a/test/models/employee_test.rb b/test/models/employee_test.rb index f03437a3a..43c1ccdbe 100644 --- a/test/models/employee_test.rb +++ b/test/models/employee_test.rb @@ -68,6 +68,7 @@ class EmployeeTest < ActiveSupport::TestCase given_courses = employees(:serhat_active).given_courses.to_a assert_includes given_courses, available_courses(:compulsory_course) assert_includes given_courses, available_courses(:elective_course) + assert_includes given_courses, available_courses(:elective_course_2) assert_not_includes given_courses, available_courses(:compulsory_course_2) end end From 78d99a61144e9eaa2e4bc1432313ae5e29f2e73b Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 11 Feb 2020 14:34:11 +0300 Subject: [PATCH 094/970] Fix incorrect fixtures --- test/fixtures/available_course_lecturers.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/fixtures/available_course_lecturers.yml b/test/fixtures/available_course_lecturers.yml index 351b117f3..3d1f51c0b 100644 --- a/test/fixtures/available_course_lecturers.yml +++ b/test/fixtures/available_course_lecturers.yml @@ -17,14 +17,10 @@ elective_course_group_2_lecturer: elective_course_2_group_lecturer: group: elective_course_2_group lecturer: serhat_active - coordinator: true -elective_course_2_group_lecturer: +elective_course_2_group_lecturer_2: group: elective_course_group lecturer: chief_john coordinator: true -elective_course_2_group_lecturer: - group: elective_course_group - lecturer: serhat_active compulsory_course_group_lecturer: group: compulsory_course_group lecturer: serhat_active From bed79bd4f843b3a67008303311fa004e3028bf5d Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 11 Feb 2020 15:07:11 +0300 Subject: [PATCH 095/970] Reach last active employee with current_employee --- app/controllers/instructiveness/given_courses_controller.rb | 2 +- app/models/user.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/instructiveness/given_courses_controller.rb b/app/controllers/instructiveness/given_courses_controller.rb index 38bbf00f3..d5cbbe053 100644 --- a/app/controllers/instructiveness/given_courses_controller.rb +++ b/app/controllers/instructiveness/given_courses_controller.rb @@ -26,7 +26,7 @@ def students private def set_employee - @employee = current_user.employees.active.last + @employee = current_user.current_employee redirect_to(root_path, alert: t('.errors.no_employee_record')) unless @employee end diff --git a/app/models/user.rb b/app/models/user.rb index e9d50b241..48920980d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -130,6 +130,10 @@ def accounts (students + employees).flatten end + def current_employee + employees.active.last + end + def title employees.active.first.try(:title).try(:name) end From db79489240a6fbf2f6d8ff29248aca1094f5ae35 Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 11 Feb 2020 15:11:19 +0300 Subject: [PATCH 096/970] Add test for current_employee method --- app/controllers/instructiveness/given_courses_controller.rb | 2 +- test/models/user_test.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/instructiveness/given_courses_controller.rb b/app/controllers/instructiveness/given_courses_controller.rb index d5cbbe053..7566532e8 100644 --- a/app/controllers/instructiveness/given_courses_controller.rb +++ b/app/controllers/instructiveness/given_courses_controller.rb @@ -27,7 +27,7 @@ def students def set_employee @employee = current_user.current_employee - redirect_to(root_path, alert: t('.errors.no_employee_record')) unless @employee + raise ActiveRecord::RecordNotFound if @employee.nil? end def set_course diff --git a/test/models/user_test.rb b/test/models/user_test.rb index e37407d33..32fbdef36 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -108,6 +108,10 @@ class UserTest < ActiveSupport::TestCase assert users(:serhat).accounts end + test 'user can respond to current_employee method' do + assert_equal users(:serhat).current_employee, employees(:serhat_active) + end + test 'user can respond to title method' do assert_equal users(:serhat).title, 'Araştırma Görevlisi' end From 48f1a594d70f8b99938c115eb1441b5308ce943e Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 11 Feb 2020 15:52:06 +0300 Subject: [PATCH 097/970] Create students controller --- app/controllers/students_controller.rb | 21 ++++++++++ app/views/students/edit.html.erb | 49 ++++++++++++++++++++++ config/locales/controllers/students/en.yml | 10 +++++ config/locales/controllers/students/tr.yml | 10 +++++ config/locales/models/user/en.yml | 1 + config/locales/models/user/tr.yml | 1 + config/routes.rb | 4 +- 7 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 app/controllers/students_controller.rb create mode 100644 app/views/students/edit.html.erb create mode 100644 config/locales/controllers/students/en.yml create mode 100644 config/locales/controllers/students/tr.yml diff --git a/app/controllers/students_controller.rb b/app/controllers/students_controller.rb new file mode 100644 index 000000000..c0a326080 --- /dev/null +++ b/app/controllers/students_controller.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class StudentsController < ApplicationController + before_action :set_student + + def edit; end + + def update + @student.update(student_params) ? redirect_to(user_path(@student.user), notice: t('.success')) : render(:edit) + end + + private + + def set_student + @student = Student.find(params[:id]) + end + + def student_params + params.require(:student).permit(:student_number, :unit_id, :year, :semester, :scholarship_type_id) + end +end diff --git a/app/views/students/edit.html.erb b/app/views/students/edit.html.erb new file mode 100644 index 000000000..55fee1767 --- /dev/null +++ b/app/views/students/edit.html.erb @@ -0,0 +1,49 @@ +
+
+
+
+ <%= fa_icon 'bookmark' %> + <%= t('.form_title') %> +
+
+ <%= simple_form_for(@student) do |f| %> +
+
+ <%= f.error_notification %> + <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> +
+
+ <%= f.input :student_number %> +
+
+ <%= f.association :unit, + collection: Unit.programs.active.order(:ancestry, :name), + label_method: :names_depth_cache %> +
+ +
+ <%= f.input :year, label: t('year') %> +
+
+ <%= f.input :semester, label: t('semester') %> +
+
+ <%= f.association :scholarship_type %> +
+
+ <%= f.button :submit, class: 'btn btn-outline-success btn-sm' %> + <%= link_to_back user_path(@student.user) %> +
+
+ <% end %> +
+
+
+
+ + + diff --git a/config/locales/controllers/students/en.yml b/config/locales/controllers/students/en.yml new file mode 100644 index 000000000..4e21f5ca1 --- /dev/null +++ b/config/locales/controllers/students/en.yml @@ -0,0 +1,10 @@ +en: + students: + edit: + form_title: Update the Student Information + update: + success: Student information successfully updated. + helpers: + submit: + student: + update: Update Student \ No newline at end of file diff --git a/config/locales/controllers/students/tr.yml b/config/locales/controllers/students/tr.yml new file mode 100644 index 000000000..040f616f2 --- /dev/null +++ b/config/locales/controllers/students/tr.yml @@ -0,0 +1,10 @@ +tr: + students: + edit: + form_title: Öğrenci Bilgilerini Düzenle + update: + success: Öğrenci bilgileri başarıyla güncellendi. + helpers: + submit: + student: + update: Öğrenciyi Güncelle \ No newline at end of file diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index c7de3c4cc..179db693c 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -22,6 +22,7 @@ en: student: &student_attributes student_number: Student Number scholarship_type: Scholarship Type + unit: Unit user: &user_attributes activated: Account Activation activated_at: Account Activation Date diff --git a/config/locales/models/user/tr.yml b/config/locales/models/user/tr.yml index 1b5d17096..9ee875e83 100644 --- a/config/locales/models/user/tr.yml +++ b/config/locales/models/user/tr.yml @@ -22,6 +22,7 @@ tr: student: &student_attributes student_number: Öğrenci Numarası scholarship_type: Burs Türü + unit: Birim user: &user_attributes activated: Hesap Aktifleştirme activated_at: Hesap Aktifleştirme Tarihi diff --git a/config/routes.rb b/config/routes.rb index ec6a6beec..41affdc69 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,7 +10,7 @@ end get '/service-worker.js', to: 'service_workers/workers#index' - get '/manifest.json', to: 'service_workers/manifests#index' + get '/manifest.json', to: 'service_workers/manifests#index' root to: 'home#index' draw :account @@ -26,6 +26,8 @@ draw :yoksis draw :detsis + resources :students, only: %i[edit update] + resources :units do member do get :courses, defaults: { format: :json } From 49fbe5afdb231fc5bb309c0299d2a949550eebc8 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 11 Feb 2020 15:54:16 +0300 Subject: [PATCH 098/970] Add edit link for student of user --- app/views/users/_students.html.erb | 5 ++++- app/views/users/show.html.erb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/users/_students.html.erb b/app/views/users/_students.html.erb index 8ddbb1162..f413d2f1d 100644 --- a/app/views/users/_students.html.erb +++ b/app/views/users/_students.html.erb @@ -1,7 +1,10 @@ <% @students.each do |student| %>
- <%= fa_icon 'user', text: student.unit_name %> + <%= fa_icon 'bookmark', text: student.unit_name %> +
+ <%= link_to_actions(student, except: %w[destroy show]) %> +
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index e64d0dce1..1ba90ea86 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -15,7 +15,7 @@
+
+ <%= label_tag(:academic_term_id, t('.academic_term')) %> + <%= select_tag(:academic_term_id, + options_from_collection_for_select(AcademicTerm.all, :id, lambda { |term| full_name(term) }, params[:academic_term_id]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %> +
@@ -41,3 +49,9 @@
+ + diff --git a/config/locales/controllers/instructiveness/given_courses.en.yml b/config/locales/controllers/instructiveness/given_courses.en.yml index 3363f84a3..365f5d2ee 100644 --- a/config/locales/controllers/instructiveness/given_courses.en.yml +++ b/config/locales/controllers/instructiveness/given_courses.en.yml @@ -20,6 +20,7 @@ en: given_courses: Given Courses course_code: Course Code search: + academic_term: Academic Term smart_search_placeholder: Course Name / Course Code show: <<: *given_course_attributes diff --git a/config/locales/controllers/instructiveness/given_courses.tr.yml b/config/locales/controllers/instructiveness/given_courses.tr.yml index 4810c2230..cf16ab571 100644 --- a/config/locales/controllers/instructiveness/given_courses.tr.yml +++ b/config/locales/controllers/instructiveness/given_courses.tr.yml @@ -20,6 +20,7 @@ tr: given_courses: Verilen Dersler course_code: Ders Kodu search: + academic_term: Akademik Dönem smart_search_placeholder: Ders Adı / Ders Kodu show: <<: *given_course_attributes From cc84b1b1b2466dad9d92ed0fabd45a2ccd755ef0 Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 11 Feb 2020 16:34:52 +0300 Subject: [PATCH 103/970] Add academic term to index --- app/controllers/instructiveness/given_courses_controller.rb | 2 +- app/views/instructiveness/given_courses/index.html.erb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/instructiveness/given_courses_controller.rb b/app/controllers/instructiveness/given_courses_controller.rb index ef84598c5..9e56e7faa 100644 --- a/app/controllers/instructiveness/given_courses_controller.rb +++ b/app/controllers/instructiveness/given_courses_controller.rb @@ -8,7 +8,7 @@ class GivenCoursesController < ApplicationController before_action :set_course, except: :index def index - courses = @employee.given_courses.includes(:unit, curriculum_course: :course) + courses = @employee.given_courses.includes(:unit, :academic_term, curriculum_course: :course) .order('units.name', 'courses.name') .dynamic_search(search_params(AvailableCourse)) diff --git a/app/views/instructiveness/given_courses/index.html.erb b/app/views/instructiveness/given_courses/index.html.erb index 63da3d2aa..04816302f 100644 --- a/app/views/instructiveness/given_courses/index.html.erb +++ b/app/views/instructiveness/given_courses/index.html.erb @@ -11,6 +11,7 @@ <%= t('.course_code') %> <%= t('.curriculum_course') %> + <%= t('.academic_term') %> <%= t('.unit') %> <%= t('actions') %> @@ -20,6 +21,7 @@ <%= course.code %> <%= course.name %> + <%= full_name(course.academic_term) %> <%= course.unit.names_depth_cache %> <%= link_to_show(given_course_path(course)) %> From 386e3ebd713b94f7379de857c2570065098da790 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 11 Feb 2020 19:00:53 +0300 Subject: [PATCH 104/970] Add scopes about scholarship --- app/models/student.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/student.rb b/app/models/student.rb index 47740d58d..bb90c8793 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -18,6 +18,8 @@ class Student < ApplicationRecord # scopes # TODO: Query will be organized according to activity status scope :active, -> { where(permanently_registered: true) } + scope :not_scholarships, -> { where(scholarship_type_id: nil) } + scope :scholarships, -> { where.not(scholarship_type_id: nil) } # validations validates :unit_id, uniqueness: { scope: %i[user] } From 7e47c090192149694d8c1819b508d2eb1f89e6b7 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 11 Feb 2020 19:16:39 +0300 Subject: [PATCH 105/970] Check the student either got scholarship or not --- app/models/student.rb | 4 ++++ test/fixtures/students.yml | 1 + test/models/student_test.rb | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/app/models/student.rb b/app/models/student.rb index bb90c8793..4a4521173 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -49,6 +49,10 @@ def current_registration semester_registrations.find_by(semester: semester) || semester_registrations.create end + def scholarship? + scholarship_type_id? + end + private def build_identity_information diff --git a/test/fixtures/students.yml b/test/fixtures/students.yml index 373c137ac..3cfd1226a 100644 --- a/test/fixtures/students.yml +++ b/test/fixtures/students.yml @@ -5,6 +5,7 @@ serhat: permanently_registered: true year: 2 semester: 3 + scholarship_type: kyk serhat_omu: student_number: 98765 user: serhat diff --git a/test/models/student_test.rb b/test/models/student_test.rb index 2597300bf..072c1f865 100644 --- a/test/models/student_test.rb +++ b/test/models/student_test.rb @@ -46,6 +46,11 @@ class StudentTest < ActiveSupport::TestCase assert_equal students(:serhat_omu).gpa, 0 end + test 'scholarship?' do + assert students(:serhat).scholarship? + assert_not students(:john).scholarship? + end + # job tests test 'student enqueues Kps::IdentitySaveJob after being created' do users(:serhat).students.destroy_all From 73149bfbf36aae22afccd4346b6a049fee125cbc Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 12 Feb 2020 14:16:49 +0300 Subject: [PATCH 106/970] Change locale --- app/views/instructiveness/given_courses/students.html.erb | 2 +- .../locales/controllers/instructiveness/given_courses.en.yml | 3 +-- .../locales/controllers/instructiveness/given_courses.tr.yml | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/views/instructiveness/given_courses/students.html.erb b/app/views/instructiveness/given_courses/students.html.erb index 02739ca2f..3f926fc93 100644 --- a/app/views/instructiveness/given_courses/students.html.erb +++ b/app/views/instructiveness/given_courses/students.html.erb @@ -5,7 +5,7 @@
- <%= fa_icon 'users' %><%= t('.students') %> + <%= fa_icon 'users' %><%= t('.students', course_name: @course.name) %>
<% @groups.each do |group| %> diff --git a/config/locales/controllers/instructiveness/given_courses.en.yml b/config/locales/controllers/instructiveness/given_courses.en.yml index 365f5d2ee..12c6977c2 100644 --- a/config/locales/controllers/instructiveness/given_courses.en.yml +++ b/config/locales/controllers/instructiveness/given_courses.en.yml @@ -26,9 +26,8 @@ en: <<: *given_course_attributes coordinator: Coodinator number_of_enrolled_students: Number of Enrolled Students - students: Students students: name: Name - students: Students + students: 'Students Enrolled in %{course_name} Course' student_number: Student Number year_and_semester: Year/Semester diff --git a/config/locales/controllers/instructiveness/given_courses.tr.yml b/config/locales/controllers/instructiveness/given_courses.tr.yml index cf16ab571..52321db54 100644 --- a/config/locales/controllers/instructiveness/given_courses.tr.yml +++ b/config/locales/controllers/instructiveness/given_courses.tr.yml @@ -26,9 +26,8 @@ tr: <<: *given_course_attributes coordinator: Koordinatör number_of_enrolled_students: Kayıtlı Öğrenci Sayısı - students: Öğrenciler students: name: Adı - students: Öğrenciler + students: '%{course_name} Dersine Kayıtlanan Öğrenciler' student_number: Öğrenci Numarası year_and_semester: Sınıfı/Yarıyılı From a449f1dc00b228ee442de1b23d7b2bf47d1dadc6 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 12 Feb 2020 14:20:05 +0300 Subject: [PATCH 107/970] Fix wrong indentation --- .../instructiveness/given_courses/index.html.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/instructiveness/given_courses/index.html.erb b/app/views/instructiveness/given_courses/index.html.erb index 04816302f..488eafcec 100644 --- a/app/views/instructiveness/given_courses/index.html.erb +++ b/app/views/instructiveness/given_courses/index.html.erb @@ -30,12 +30,12 @@
+ +
From fae42c06c3f25705d349228e00de86db0df9cc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 12 Feb 2020 14:22:58 +0300 Subject: [PATCH 108/970] Add system test for wicked_pdf --- test/system/wicked_pdf_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/system/wicked_pdf_test.rb diff --git a/test/system/wicked_pdf_test.rb b/test/system/wicked_pdf_test.rb new file mode 100644 index 000000000..9e37651a1 --- /dev/null +++ b/test/system/wicked_pdf_test.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +require 'test_helper' + +class WickedPDFTest < ActiveSupport::TestCase + test 'Create a test pdf from a string' do + assert WickedPdf.new.pdf_from_string 'lorem ipsum ibi libertas' + end +end From 9b1ddea27f11fda2495414bd8eaefa361d5c567e Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 12 Feb 2020 14:23:37 +0300 Subject: [PATCH 109/970] Fix typo --- .../controllers/course_management/available_courses.en.yml | 2 +- config/locales/controllers/instructiveness/given_courses.en.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/controllers/course_management/available_courses.en.yml b/config/locales/controllers/course_management/available_courses.en.yml index e6eb4b894..3337e3de1 100644 --- a/config/locales/controllers/course_management/available_courses.en.yml +++ b/config/locales/controllers/course_management/available_courses.en.yml @@ -65,7 +65,7 @@ en: unit: Unit show: <<: *available_course_attributes - coordinator: Coodinator + coordinator: Coordinator update: success: Available course successfully updated. helpers: diff --git a/config/locales/controllers/instructiveness/given_courses.en.yml b/config/locales/controllers/instructiveness/given_courses.en.yml index 12c6977c2..163b34bae 100644 --- a/config/locales/controllers/instructiveness/given_courses.en.yml +++ b/config/locales/controllers/instructiveness/given_courses.en.yml @@ -24,7 +24,7 @@ en: smart_search_placeholder: Course Name / Course Code show: <<: *given_course_attributes - coordinator: Coodinator + coordinator: Coordinator number_of_enrolled_students: Number of Enrolled Students students: name: Name From bca82a640f63880fe5df502805a8cd5ae868db1d Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 12 Feb 2020 15:10:36 +0300 Subject: [PATCH 110/970] Fix translation --- config/locales/models/user/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index 179db693c..81d5b79ab 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -99,7 +99,7 @@ en: employees: Employees identities: Identities other_information: Other Information - students: Öğrenci Bilgileri + students: Student Information students: <<: *student_attributes update: From 98f9f03933638c7930b0679833c8db4bdaaf886d Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 12 Feb 2020 15:11:39 +0300 Subject: [PATCH 111/970] Delete unnecessary spaces --- app/views/reference/scholarship_types/_form.html.erb | 4 ++-- app/views/students/edit.html.erb | 2 -- config/locales/controllers/reference/scholarship_types.en.yml | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/views/reference/scholarship_types/_form.html.erb b/app/views/reference/scholarship_types/_form.html.erb index 33ad5fa6a..edfc8c207 100644 --- a/app/views/reference/scholarship_types/_form.html.erb +++ b/app/views/reference/scholarship_types/_form.html.erb @@ -8,7 +8,7 @@ required: true }, { - field: 'active', - width: 12 + field: 'active', + width: 12 } ] %> diff --git a/app/views/students/edit.html.erb b/app/views/students/edit.html.erb index 55fee1767..097f12dd6 100644 --- a/app/views/students/edit.html.erb +++ b/app/views/students/edit.html.erb @@ -20,7 +20,6 @@ collection: Unit.programs.active.order(:ancestry, :name), label_method: :names_depth_cache %> -
<%= f.input :year, label: t('year') %>
@@ -41,7 +40,6 @@ - diff --git a/app/views/tuition_management/tuitions/index.html.erb b/app/views/tuition_management/tuitions/index.html.erb new file mode 100644 index 000000000..d7b14cf3c --- /dev/null +++ b/app/views/tuition_management/tuitions/index.html.erb @@ -0,0 +1,34 @@ +
+
+
+
+ <%= fa_icon 'street-view', text: 'Harçlar' %> +
+ <%= link_to_new 'Yeni Harç Ekle', %i[new tuition] %> +
+
+
+ + + + + + + + + + + <% @tuitions.each do |tuition| %> + + + + + + + <% end %> + +
BirimlerÜcretYabancı Öğrenci Ücret<%= t('actions') %>
<%= tuition.units.map(&:name).join(', ') %><%= tuition.fee %><%= tuition.foreign_student_fee %>
+
+
+
+
diff --git a/app/views/tuition_management/tuitions/new.html.erb b/app/views/tuition_management/tuitions/new.html.erb new file mode 100644 index 000000000..a82707881 --- /dev/null +++ b/app/views/tuition_management/tuitions/new.html.erb @@ -0,0 +1 @@ +<%= render 'form', tuition: @tuition %> diff --git a/app/views/tuition_management/tuitions/units.json.jbuilder b/app/views/tuition_management/tuitions/units.json.jbuilder new file mode 100644 index 000000000..5484a3080 --- /dev/null +++ b/app/views/tuition_management/tuitions/units.json.jbuilder @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +json.results do + json.array!(@units) do |unit| + json.id unit.id + json.text unit.name + json.yoksis_id unit.yoksis_id + json.children(unit.children) do |unit| + json.id unit.id + json.text unit.name + json.ancestry unit.ancestry + json.children(unit.children) do |unit| + json.id unit.id + json.text unit.name + json.ancestry unit.ancestry + end + end + end +end From a5f3e62c6e3febc3c12f86ebd16c6a8adc782b79 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 18 Feb 2020 12:08:56 +0300 Subject: [PATCH 230/970] Remove null_constraint for point --- app/models/grade.rb | 1 + db/migrate/20200213110520_create_grades.rb | 2 -- db/structure.sql | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/grade.rb b/app/models/grade.rb index 7e4598b09..b4fd2b209 100644 --- a/app/models/grade.rb +++ b/app/models/grade.rb @@ -8,6 +8,7 @@ class Grade < ApplicationRecord # validations validates :point, numericality: { only_integer: true, + allow_nil: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 100 } diff --git a/db/migrate/20200213110520_create_grades.rb b/db/migrate/20200213110520_create_grades.rb index ea1172909..1ba29ff9b 100644 --- a/db/migrate/20200213110520_create_grades.rb +++ b/db/migrate/20200213110520_create_grades.rb @@ -10,8 +10,6 @@ def change t.timestamps end - add_null_constraint :grades, :point - add_numericality_constraint :grades, :point, greater_than_or_equal_to: 0, less_than_or_equal_to: 100 diff --git a/db/structure.sql b/db/structure.sql index 2d9e00dcf..59dc373f5 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1958,7 +1958,6 @@ CREATE TABLE public.grades ( point integer, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, - CONSTRAINT grades_point_null CHECK ((point IS NOT NULL)), CONSTRAINT grades_point_numericality CHECK (((point >= 0) AND (point <= 100))) ); From ba7cc83548a33bc3321c80b3443b2574279dfaef Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 18 Feb 2020 12:11:18 +0300 Subject: [PATCH 231/970] Refactor update action --- .../instructiveness/grades_controller.rb | 16 ++++---- .../instructiveness/grades/edit.html.erb | 39 +++++++++---------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/app/controllers/instructiveness/grades_controller.rb b/app/controllers/instructiveness/grades_controller.rb index 34b15dd86..088606d4b 100644 --- a/app/controllers/instructiveness/grades_controller.rb +++ b/app/controllers/instructiveness/grades_controller.rb @@ -10,13 +10,15 @@ class GradesController < ApplicationController def edit; end def update - @course.saved_enrollments.where(available_course_group: @groups).each do |enrollment| - new_point = grades_params[enrollment.id.to_s] - grade = enrollment.grades.find_or_initialize_by(course_assessment_method: @assessment) - grade.update(point: new_point) if grade.point != new_point + @grades = @assessment.grades.update(grades_params.keys, grades_params.values) + @grades.reject! { |g| g.errors.empty? } + + if @grades.empty? + @assessment.update(status: :draft) unless @assessment.draft? + redirect_with('success') + else + render :edit end - - @assessment.update(status: :draft) ? redirect_with('.success') : render(:edit) end private @@ -42,7 +44,7 @@ def set_assessment end def grades_params - params.require(:course_enrollment_grades) + params.require(:grades) end end end diff --git a/app/views/instructiveness/grades/edit.html.erb b/app/views/instructiveness/grades/edit.html.erb index 2f5efe0e1..80e5023f5 100644 --- a/app/views/instructiveness/grades/edit.html.erb +++ b/app/views/instructiveness/grades/edit.html.erb @@ -11,33 +11,30 @@
- <%= simple_form_for(:grade, url: given_course_assessment_grades_path(@course, @assessment), html: { id: 'grades_form' }) do |f| %> - <% @groups.includes(:saved_enrollments).each do |group| %> -
- <%= fa_icon 'cube' %><%= group.name %> -
- - - - - - - - - - - <% group.saved_enrollments.each do |enrollment| %> + <%= form_tag(given_course_assessment_grades_path(@course, @assessment), id: 'grades_form') do %> +
<%= t('.student_number') %><%= t('.name') %><%= t('.year_and_semester') %><%= @assessment.name %>
+ + + + + + + + + + <% @assessment.grades.each do |grade| %> + <%= fields_for "grades[]", grade do |f| %> - <% student = enrollment.student %> + <% student = grade.course_enrollment.student %> - + <% end %> - -
<%= t('.student_number') %><%= t('.name') %><%= t('.year_and_semester') %><%= @assessment.name %>
<%= student.student_number %> <%= full_name(student.user.identities.formal.first) %> <%= "#{student.year}/#{student.semester}" %><%= f.input :grade, label: false, input_html: { value: enrollment.grades.find_by(course_assessment_method: @assessment)&.point, name: "course_enrollment_grades[#{enrollment.id}]" } %><%= f.number_field(:point, required: true, class: 'form-control numeric integer required') %>
- <% end %> + <% end %> + + <% end %>
From a78aa22769ef299cd0e6fe151c3217b4b456dd87 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 18 Feb 2020 12:12:12 +0300 Subject: [PATCH 232/970] Create needed blank grades --- app/controllers/instructiveness/grades_controller.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/instructiveness/grades_controller.rb b/app/controllers/instructiveness/grades_controller.rb index 088606d4b..c0d211009 100644 --- a/app/controllers/instructiveness/grades_controller.rb +++ b/app/controllers/instructiveness/grades_controller.rb @@ -7,7 +7,15 @@ class GradesController < ApplicationController before_action :set_groups before_action :set_assessment - def edit; end + def edit + enrollments = @course.saved_enrollments + .where(available_course_group: @groups) + .where.not(id: @assessment.grades.pluck(:course_enrollment_id)) + + return if enrollments.empty? + + @assessment.grades.create(enrollments.collect { |e| { course_enrollment_id: e.id } }) + end def update @grades = @assessment.grades.update(grades_params.keys, grades_params.values) From dd7fc34fc6d66a15d32de305285a95d70206c254 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 18 Feb 2020 12:24:12 +0300 Subject: [PATCH 233/970] Add course group name to table --- app/views/instructiveness/grades/edit.html.erb | 9 ++++++--- config/locales/controllers/instructiveness/grades.en.yml | 1 + config/locales/controllers/instructiveness/grades.tr.yml | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/views/instructiveness/grades/edit.html.erb b/app/views/instructiveness/grades/edit.html.erb index 80e5023f5..30f7d4d49 100644 --- a/app/views/instructiveness/grades/edit.html.erb +++ b/app/views/instructiveness/grades/edit.html.erb @@ -15,9 +15,10 @@ - + - + + @@ -25,10 +26,12 @@ <% @assessment.grades.each do |grade| %> <%= fields_for "grades[]", grade do |f| %> - <% student = grade.course_enrollment.student %> + <% enrollment = grade.course_enrollment %> + <% student = enrollment.student %> + <% end %> diff --git a/config/locales/controllers/instructiveness/grades.en.yml b/config/locales/controllers/instructiveness/grades.en.yml index d6d602d4e..029d823a8 100644 --- a/config/locales/controllers/instructiveness/grades.en.yml +++ b/config/locales/controllers/instructiveness/grades.en.yml @@ -2,6 +2,7 @@ en: instructiveness: grades: edit: + group_name: Group Name name: Name students: 'Students Enrolled in %{course_name} Course' student_number: Student Number diff --git a/config/locales/controllers/instructiveness/grades.tr.yml b/config/locales/controllers/instructiveness/grades.tr.yml index dfa2b0a07..e95c86721 100644 --- a/config/locales/controllers/instructiveness/grades.tr.yml +++ b/config/locales/controllers/instructiveness/grades.tr.yml @@ -2,6 +2,7 @@ tr: instructiveness: grades: edit: + group_name: Grup Adı name: Adı students: '%{course_name} Dersine Kayıtlanan Öğrenciler' student_number: Öğrenci Numarası From 3139253aaf278faf19aa131f42f47248d42a8f12 Mon Sep 17 00:00:00 2001 From: isubas Date: Tue, 18 Feb 2020 17:43:13 +0300 Subject: [PATCH 234/970] =?UTF-8?q?Hesap=20ve=20sidebar=20yap=C4=B1s=C4=B1?= =?UTF-8?q?n=C4=B1=20olu=C5=9Ftur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 29 +++ app/lib/patron/role_builder.rb | 2 - app/models/patron/account.rb | 53 ++++++ app/models/patron/accounts/admin.rb | 23 +++ app/models/patron/accounts/base.rb | 50 ++++++ app/models/patron/accounts/employee.rb | 23 +++ .../patron/accounts/institution_manager.rb | 23 +++ app/models/patron/accounts/student.rb | 23 +++ app/models/patron/utils/role_querier.rb | 19 ++ app/models/user.rb | 2 +- .../_user_and_account_statistics.html.erb | 29 --- app/views/home/templates/_admin.html.erb | 1 - app/views/layouts/shared/_sidebar.html.erb | 167 ++---------------- .../layouts/shared/menus/_employee.html.erb | 5 + .../shared/menus/_institution_manager.erb | 5 + .../layouts/shared/menus/_manager.html.erb | 131 ++++++++++++++ .../layouts/shared/menus/_student.html.erb | 5 + config/initializers/role_management.rb | 1 + config/locales/layouts/shared/sidebar.en.yml | 79 +++++---- config/locales/layouts/shared/sidebar.tr.yml | 77 ++++---- config/routes.rb | 2 + 21 files changed, 498 insertions(+), 251 deletions(-) create mode 100644 app/models/patron/account.rb create mode 100644 app/models/patron/accounts/admin.rb create mode 100644 app/models/patron/accounts/base.rb create mode 100644 app/models/patron/accounts/employee.rb create mode 100644 app/models/patron/accounts/institution_manager.rb create mode 100644 app/models/patron/accounts/student.rb create mode 100644 app/models/patron/utils/role_querier.rb delete mode 100644 app/views/home/components/_user_and_account_statistics.html.erb create mode 100644 app/views/layouts/shared/menus/_employee.html.erb create mode 100644 app/views/layouts/shared/menus/_institution_manager.erb create mode 100644 app/views/layouts/shared/menus/_manager.html.erb create mode 100644 app/views/layouts/shared/menus/_student.html.erb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3489bb908..7d925bb8a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -25,6 +25,16 @@ def default_url_options user_signed_in? ? { locale: nil } : { locale: I18n.locale } end + def switch_account + account = Patron::Account.find_by(user: current_user, type: params[:type], id: params[:id]) + if account + session[:account] = account.identifier + flash[:notice] = 'Hesabınız başarıyla değişti' + end + + redirect_to root_path + end + protected def append_info_to_payload(payload) @@ -52,6 +62,19 @@ def configure_permitted_parameters devise_parameter_sanitizer.permit(:account_update, keys: %i[email]) end + def current_account + if session.key?(:account) && session.dig(:account, 'type').present? + Patron::Account.find_by( + user: current_user, type: session.dig(:account, 'type'), id: session.dig(:account, 'id') + ) + else + set_current_account + end + rescue Patron::Account::NotFound + set_current_account + end + helper_method :current_account + private def handle_unverified_request @@ -74,4 +97,10 @@ def update_preferred_language current_user.preferred_language = locale_params current_user.save(validate: false) end + + def set_current_account + account = current_user.accounts.first + session[:account] = account&.identifier + account + end end diff --git a/app/lib/patron/role_builder.rb b/app/lib/patron/role_builder.rb index a1a93c3fa..30750da44 100644 --- a/app/lib/patron/role_builder.rb +++ b/app/lib/patron/role_builder.rb @@ -31,8 +31,6 @@ def initialize(identifier:, name:, permissions:) private def check! - raise ArgumentError, 'Permissions must not be empty' if permissions.blank? - permissions.keys.each do |permission| raise ArgumentError, "Permission not found: #{permission}" unless PermissionBuilder.all.key?(permission) end diff --git a/app/models/patron/account.rb b/app/models/patron/account.rb new file mode 100644 index 000000000..99c8e2105 --- /dev/null +++ b/app/models/patron/account.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Patron + class Account + attr_reader :user, :accounts + + class Error < StandardError; end + class NotFound < Error; end + + def initialize(user) + @user = Utils::RoleQuerier.new(user) + @accounts = [] + build_accounts + end + + class << self + def call(user) + new(user).accounts + end + + def find_by(user:, type:, id:) + klass = "Patron::Accounts::#{type.to_s.camelize}".safe_constantize + account = klass&.new(id, user.id) + account&.verify? ? account : raise(NotFound) + end + end + + private + + def build_accounts + build_for_institution_manager + build_for_admin + build_for_employee + build_for_student + end + + def build_for_student + user.students.active.each { |student| accounts << Accounts::Student.new(student.id, user.id) } + end + + def build_for_employee + user.employees.active.each { |employee| accounts << Accounts::Employee.new(employee.id, user.id) } + end + + def build_for_admin + accounts << Accounts::Admin.new(user.id, user.id) if user.admin? + end + + def build_for_institution_manager + accounts << Accounts::InstitutionManager.new(user.id, user.id) if user.institution_manager? + end + end +end diff --git a/app/models/patron/accounts/admin.rb b/app/models/patron/accounts/admin.rb new file mode 100644 index 000000000..196c2e6db --- /dev/null +++ b/app/models/patron/accounts/admin.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Patron + module Accounts + class Admin < Base + def object + user + end + + def label + "#{identity.first_name} #{identity.last_name}" + end + + def type + 'admin' + end + + def verify? + object.present? + end + end + end +end diff --git a/app/models/patron/accounts/base.rb b/app/models/patron/accounts/base.rb new file mode 100644 index 000000000..4757977a4 --- /dev/null +++ b/app/models/patron/accounts/base.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module Patron + module Accounts + class Base + attr_reader :id, :user_id + def initialize(id, user_id) + @id = id.to_i + @user_id = user_id + end + + def user + @user ||= User.find(user_id) + end + + def object + raise NotImplementedError + end + + def label + raise NotImplementedError + end + + def type + raise NotImplementedError + end + + def verify? + raise NotImplementedError + end + + def active_for?(account) + account&.identifier == identifier + end + + def identifier + { + type: type, + id: id + } + end + + protected + + def identity + @identity ||= [*user.identities.user_identity].first || identities.new + end + end + end +end diff --git a/app/models/patron/accounts/employee.rb b/app/models/patron/accounts/employee.rb new file mode 100644 index 000000000..79199a82f --- /dev/null +++ b/app/models/patron/accounts/employee.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Patron + module Accounts + class Employee < Base + def object + @object ||= user.employees.find(id) + end + + def label + "#{object.staff_number} - #{object&.title_name}" + end + + def type + 'employee' + end + + def verify? + object.present? + end + end + end +end diff --git a/app/models/patron/accounts/institution_manager.rb b/app/models/patron/accounts/institution_manager.rb new file mode 100644 index 000000000..67183b089 --- /dev/null +++ b/app/models/patron/accounts/institution_manager.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Patron + module Accounts + class InstitutionManager < Base + def object + user + end + + def label + "#{identity.first_name} #{identity.last_name}" + end + + def type + 'institution_manager' + end + + def verify? + object.present? + end + end + end +end diff --git a/app/models/patron/accounts/student.rb b/app/models/patron/accounts/student.rb new file mode 100644 index 000000000..f18564bff --- /dev/null +++ b/app/models/patron/accounts/student.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Patron + module Accounts + class Student < Base + def object + @object ||= user.students.find(id) + end + + def label + "#{object.student_number} - #{object&.identity&.first_name} #{object&.identity&.last_name}" + end + + def type + 'student' + end + + def verify? + object.present? + end + end + end +end diff --git a/app/models/patron/utils/role_querier.rb b/app/models/patron/utils/role_querier.rb new file mode 100644 index 000000000..b5c0c41e2 --- /dev/null +++ b/app/models/patron/utils/role_querier.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Patron + module Utils + class RoleQuerier < SimpleDelegator + def admin? + any_roles? :manager, :admin + end + + def institution_manager? + positions&.active&.exists?( + administrative_function_id: AdministrativeFunction.where( + name: ['Rektör', 'Rektör Yardımcısı'] + ) + ) + end + end + end +end diff --git a/app/models/user.rb b/app/models/user.rb index 947f3513f..cb8b89c79 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -128,7 +128,7 @@ def send_devise_notification(notification, *args) # custom methods def accounts - (students + employees).flatten + Patron::Account.call(self) end def title diff --git a/app/views/home/components/_user_and_account_statistics.html.erb b/app/views/home/components/_user_and_account_statistics.html.erb deleted file mode 100644 index 831808e69..000000000 --- a/app/views/home/components/_user_and_account_statistics.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -
-
-
-
- <%= fa_icon('user') %> -
-
<%= User.count %>
- <%= t('.registered_users') %> -
-
-
-
-
- <%= fa_icon('id-card-o') %> -
-
<%= Identity.count %>
- <%= t('.identities') %> -
-
-
-
-
- <%= fa_icon('location-arrow') %> -
-
<%= Address.count %>
- <%= t('.addresses') %> -
-
-
diff --git a/app/views/home/templates/_admin.html.erb b/app/views/home/templates/_admin.html.erb index 7baa4b4a0..1b5f9a207 100644 --- a/app/views/home/templates/_admin.html.erb +++ b/app/views/home/templates/_admin.html.erb @@ -1,2 +1 @@ -<%= render 'home/components/user_and_account_statistics' %> <%= render 'home/components/membership_notifications' %> diff --git a/app/views/layouts/shared/_sidebar.html.erb b/app/views/layouts/shared/_sidebar.html.erb index 78cd58010..8f5c3b963 100644 --- a/app/views/layouts/shared/_sidebar.html.erb +++ b/app/views/layouts/shared/_sidebar.html.erb @@ -1,172 +1,29 @@
- <%= f.input :unit_ids, as: :grouped_select, group_method: :units, role: :group, input_html: { multiple: 'multiple' } %> + <%= f.input :unit_ids, collection: f.object.units, value_method: :id, label_method: :name, input_html: { multiple: 'multiple' } %>
<%= f.association :academic_term, label_method: lambda { |academic_term| full_name(academic_term) } %> @@ -39,7 +39,7 @@ diff --git a/app/views/tuition_management/tuitions/units.json.jbuilder b/app/views/tuition_management/tuitions/units.json.jbuilder index 5484a3080..4c0e96dee 100644 --- a/app/views/tuition_management/tuitions/units.json.jbuilder +++ b/app/views/tuition_management/tuitions/units.json.jbuilder @@ -1,19 +1,14 @@ # frozen_string_literal: true -json.results do - json.array!(@units) do |unit| - json.id unit.id - json.text unit.name - json.yoksis_id unit.yoksis_id - json.children(unit.children) do |unit| - json.id unit.id - json.text unit.name - json.ancestry unit.ancestry - json.children(unit.children) do |unit| - json.id unit.id - json.text unit.name - json.ancestry unit.ancestry - end +json.array!(@units) do |unit| + json.id unit.id + json.text unit.name + json.children(unit.children) do |child| + json.id child.id + json.text child.name + json.children(unit.children) do |c| + json.id c.id + json.text c.name end end end From 5772f76a0fa8460ade680531451957db29e62bd2 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 19 Feb 2020 11:58:02 +0300 Subject: [PATCH 243/970] Add tuition locales --- .../tuition_management/tuitions_controller.rb | 14 +++++++---- .../tuitions/_form.html.erb | 8 +++---- .../tuitions/index.html.erb | 12 +++++----- .../tuition_management/tuitions.en.yml | 23 ++++++++++++++++++ .../tuition_management/tuitions.tr.yml | 24 +++++++++++++++++++ 5 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 config/locales/controllers/tuition_management/tuitions.en.yml create mode 100644 config/locales/controllers/tuition_management/tuitions.tr.yml diff --git a/app/controllers/tuition_management/tuitions_controller.rb b/app/controllers/tuition_management/tuitions_controller.rb index 16a245ddc..02e5b846b 100644 --- a/app/controllers/tuition_management/tuitions_controller.rb +++ b/app/controllers/tuition_management/tuitions_controller.rb @@ -2,10 +2,10 @@ module TuitionManagement class TuitionsController < ApplicationController - before_action :set_tuition, only: %i[edit update] + before_action :set_tuition, only: %i[edit update destroy] def index - @tuitions = Tuition.all + @tuitions = Tuition.includes(:units, :unit_tuitions) end def new @@ -14,13 +14,19 @@ def new def create @tuition = Tuition.new(tuition_params) - @tuition.save ? redirect_to(:tuitions, notice: 'Başarılı') : render(:new) + @tuition.save ? redirect_to(:tuitions, notice: t('.success')) : render(:new) end def edit; end def update - @tuition.update(tuition_params) ? redirect_to(:tuitions, notice: 'Başarılı') : render(:edit) + @tuition.update(tuition_params) ? redirect_to(:tuitions, notice: t('.success')) : render(:edit) + end + + def destroy + return redirect_to(:tuitions, notice: t('.success')) if @tuition.destroy + + redirect_to(:tuitions, alert: t('.warning')) end def units diff --git a/app/views/tuition_management/tuitions/_form.html.erb b/app/views/tuition_management/tuitions/_form.html.erb index dce38a4b7..31fdfffdf 100644 --- a/app/views/tuition_management/tuitions/_form.html.erb +++ b/app/views/tuition_management/tuitions/_form.html.erb @@ -2,8 +2,8 @@
- <%= fa_icon 'calendar' %> - Harç Ekle + <%= fa_icon 'money' %> + <%= t('.form_title') %>
<%= simple_form_for(tuition) do |f| %> @@ -12,7 +12,7 @@ <%= f.error_notification %>
- <%= f.input :unit_ids, collection: f.object.units, value_method: :id, label_method: :name, input_html: { multiple: 'multiple' } %> + <%= f.input :unit_ids, collection: f.object.units, value_method: :id, label_method: :name, input_html: { multiple: 'multiple' }, required: true %>
<%= f.association :academic_term, label_method: lambda { |academic_term| full_name(academic_term) } %> @@ -21,7 +21,7 @@ <%= f.input :fee, required: true %>
- <%= f.input :foreign_student_fee %> + <%= f.input :foreign_student_fee, required: true %>
<%= f.button :submit, t('save'), class: 'btn btn-outline-success btn-sm' %> diff --git a/app/views/tuition_management/tuitions/index.html.erb b/app/views/tuition_management/tuitions/index.html.erb index d7b14cf3c..7ecdf7d46 100644 --- a/app/views/tuition_management/tuitions/index.html.erb +++ b/app/views/tuition_management/tuitions/index.html.erb @@ -2,18 +2,18 @@
- <%= fa_icon 'street-view', text: 'Harçlar' %> + <%= fa_icon 'money', text: t('.card_header') %>
- <%= link_to_new 'Yeni Harç Ekle', %i[new tuition] %> + <%= link_to_new t('.new_tuition_link'), %i[new tuition] %>
<%= t('.student_number') %><%= t('.student_number') %> <%= t('.name') %><%= t('.year_and_semester') %><%= t('.year_and_semester') %><%= t('.group_name') %> <%= @assessment.name %>
<%= student.student_number %> <%= full_name(student.user.identities.formal.first) %> <%= "#{student.year}/#{student.semester}" %><%= enrollment.available_course_group.name %> <%= f.number_field(:point, required: true, class: 'form-control numeric integer required') %>
- - - + + + @@ -23,7 +23,7 @@ - + <% end %> diff --git a/config/locales/controllers/tuition_management/tuitions.en.yml b/config/locales/controllers/tuition_management/tuitions.en.yml new file mode 100644 index 000000000..fa166dfdf --- /dev/null +++ b/config/locales/controllers/tuition_management/tuitions.en.yml @@ -0,0 +1,23 @@ +en: + activerecord: + attributes: + tuition: &tuition_attributes + academic_term: Academic Term + fee: Tuition Fee + foreign_student_fee: Foreign Student Tuition Fee + unit_ids: Units + tuition_management: + tuitions: + create: + success: Tuitions successfully created. + destroy: + success: Tuitions successfully deleted. + warning: Tuitions can not be deleted! + form: + form_title: Harç Ekle + index: + <<: *tuition_attributes + card_header: Harçlar + new_tuition_link: Yeni Harç Ekle + update: + success: Tuitions successfully updated. diff --git a/config/locales/controllers/tuition_management/tuitions.tr.yml b/config/locales/controllers/tuition_management/tuitions.tr.yml new file mode 100644 index 000000000..fac423578 --- /dev/null +++ b/config/locales/controllers/tuition_management/tuitions.tr.yml @@ -0,0 +1,24 @@ +tr: + activerecord: + attributes: + tuition: &tuition_attributes + academic_term: Akademik Dönem + fee: Harç Ücreti + foreign_student_fee: Yabancı Öğrenci Harç Ücreti + unit_ids: Birimler + tuition_management: + tuitions: + create: + success: Harçlar başarıyla oluşturuldu. + destroy: + success: Harçlar başarıyla silindi. + warning: Harçlar silinemedi! + form: + form_title: Add Tuition + index: + <<: *tuition_attributes + card_header: Tuitions + new_tuition_link: Add New Tuition + update: + success: Harçlar başarıyla güncellendi. + From c4c9798335ba434411ef3e342b4c6a74f0666dcc Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 19 Feb 2020 12:00:28 +0300 Subject: [PATCH 244/970] Use currency helper --- app/views/tuition_management/tuitions/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/tuition_management/tuitions/index.html.erb b/app/views/tuition_management/tuitions/index.html.erb index 7ecdf7d46..ecd34cb6b 100644 --- a/app/views/tuition_management/tuitions/index.html.erb +++ b/app/views/tuition_management/tuitions/index.html.erb @@ -21,8 +21,8 @@ <% @tuitions.each do |tuition| %> - - + + <% end %> From c1b8f297898e3941d2c99bdef1f8b8a79d39bbd7 Mon Sep 17 00:00:00 2001 From: isubas Date: Wed, 19 Feb 2020 12:08:02 +0300 Subject: [PATCH 245/970] =?UTF-8?q?Poli=C3=A7elerdeki=20kod=20tekrar=C4=B1?= =?UTF-8?q?n=C4=B1=20engelle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../calendar_event_type_policy.rb | 24 ++----------- .../calendar_management/calendar_policy.rb | 28 +-------------- app/policies/committee/agenda_policy.rb | 24 ++----------- app/policies/committee/agenda_type_policy.rb | 24 ++----------- app/policies/committee/decision_policy.rb | 20 ++--------- app/policies/committee/meeting_policy.rb | 28 +-------------- app/policies/concerns/crud_policy_methods.rb | 35 +++++++++++++++++++ .../available_course_group_policy.rb | 20 ++--------- .../available_course_policy.rb | 28 +-------------- .../course_evaluation_type_policy.rb | 20 ++--------- .../course_management/course_group_policy.rb | 28 +-------------- .../course_group_type_policy.rb | 24 ++----------- .../course_management/course_policy.rb | 28 +-------------- .../course_management/course_type_policy.rb | 24 ++----------- .../curriculum_course_group_policy.rb | 20 ++--------- .../curriculum_course_policy.rb | 20 ++--------- .../course_management/curriculum_policy.rb | 28 +-------------- .../prospective_employee_policy.rb | 24 ++----------- .../prospective_student_policy.rb | 24 ++----------- .../registration_document_policy.rb | 24 ++----------- app/policies/location/city_policy.rb | 24 ++----------- app/policies/location/country_policy.rb | 28 +-------------- app/policies/location/district_policy.rb | 20 ++--------- app/policies/meksis/building_policy.rb | 16 ++------- app/policies/patron/assignment_policy.rb | 16 ++------- app/policies/patron/query_store_policy.rb | 28 +-------------- .../reference/academic_term_policy.rb | 20 ++--------- .../reference/assessment_method_policy.rb | 20 ++--------- .../reference/course_group_type_policy.rb | 24 ++----------- app/policies/reference/course_type_policy.rb | 24 ++----------- .../reference/document_type_policy.rb | 20 ++--------- .../reference/evaluation_type_policy.rb | 20 ++--------- .../reference/high_school_type_policy.rb | 20 ++--------- app/policies/reference/language_policy.rb | 20 ++--------- .../reference/scholarship_type_policy.rb | 20 ++--------- app/policies/reference/title_policy.rb | 20 ++--------- app/policies/unit_policy.rb | 30 ++-------------- app/policies/user_management/duty_policy.rb | 20 ++--------- .../user_management/employee_policy.rb | 20 ++--------- .../user_management/position_policy.rb | 20 ++--------- app/policies/user_management/user_policy.rb | 22 ++---------- .../yoksis/administrative_function_policy.rb | 20 ++--------- .../yoksis/student_disability_type_policy.rb | 20 ++--------- .../yoksis/student_drop_out_type_policy.rb | 20 ++--------- .../yoksis/student_education_level_policy.rb | 20 ++--------- .../student_entrance_point_type_policy.rb | 20 ++--------- .../yoksis/student_entrance_type_policy.rb | 20 ++--------- app/policies/yoksis/student_grade_policy.rb | 20 ++--------- .../yoksis/student_grading_system_policy.rb | 20 ++--------- .../yoksis/student_punishment_type_policy.rb | 20 ++--------- .../student_studentship_status_policy.rb | 20 ++--------- .../unit_instruction_language_policy.rb | 20 ++--------- .../yoksis/unit_instruction_type_policy.rb | 20 ++--------- app/policies/yoksis/unit_status_policy.rb | 20 ++--------- app/policies/yoksis/unit_type_policy.rb | 20 ++--------- app/policies/yoksis/university_type_policy.rb | 20 ++--------- .../reference/academic_term_policy_test.rb | 1 + .../assessment_method_policy_test.rb | 1 + .../reference/document_type_policy_test.rb | 1 + .../reference/evaluation_type_policy_test.rb | 1 + .../reference/high_school_type_policy_test.rb | 1 + .../reference/language_policy_test.rb | 1 + .../reference/scholarship_type_policy_test.rb | 1 + test/policies/reference/title_policy_test.rb | 1 + .../administrative_function_policy_test.rb | 1 + .../student_disability_type_policy_test.rb | 1 + .../student_drop_out_type_policy_test.rb | 1 + .../student_education_level_policy_test.rb | 1 + ...student_entrance_point_type_policy_test.rb | 1 + .../student_entrance_type_policy_test.rb | 1 + .../yoksis/student_grade_policy_test.rb | 1 + .../student_grading_system_policy_test.rb | 1 + .../student_punishment_type_policy_test.rb | 1 + .../student_studentship_status_policy_test.rb | 1 + .../unit_instruction_language_policy_test.rb | 1 + .../unit_instruction_type_policy_test.rb | 1 + .../yoksis/unit_status_policy_test.rb | 1 + test/policies/yoksis/unit_type_policy_test.rb | 1 + .../yoksis/university_type_policy_test.rb | 1 + 79 files changed, 161 insertions(+), 1109 deletions(-) create mode 100644 app/policies/concerns/crud_policy_methods.rb diff --git a/app/policies/calendar_management/calendar_event_type_policy.rb b/app/policies/calendar_management/calendar_event_type_policy.rb index 775f80c8b..2dabd3cef 100644 --- a/app/policies/calendar_management/calendar_event_type_policy.rb +++ b/app/policies/calendar_management/calendar_event_type_policy.rb @@ -2,29 +2,9 @@ module CalendarManagement class CalendarEventTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end + include CrudPolicyMethods - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/calendar_management/calendar_policy.rb b/app/policies/calendar_management/calendar_policy.rb index ffac9ac06..0f54c955c 100644 --- a/app/policies/calendar_management/calendar_policy.rb +++ b/app/policies/calendar_management/calendar_policy.rb @@ -2,42 +2,16 @@ module CalendarManagement class CalendarPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end + include CrudPolicyMethods def duplicate? permitted? :write end - def edit? - permitted? :write - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def show? - permitted? :read - end - def units? permitted? :read end - def update? - permitted? :write - end - private def permitted?(*privileges) diff --git a/app/policies/committee/agenda_policy.rb b/app/policies/committee/agenda_policy.rb index 25f438be1..9861b95b0 100644 --- a/app/policies/committee/agenda_policy.rb +++ b/app/policies/committee/agenda_policy.rb @@ -2,29 +2,9 @@ module Committee class AgendaPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end + include CrudPolicyMethods - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/committee/agenda_type_policy.rb b/app/policies/committee/agenda_type_policy.rb index bc98b3a02..142a7993e 100644 --- a/app/policies/committee/agenda_type_policy.rb +++ b/app/policies/committee/agenda_type_policy.rb @@ -2,29 +2,9 @@ module Committee class AgendaTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end + include CrudPolicyMethods - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/committee/decision_policy.rb b/app/policies/committee/decision_policy.rb index 7fc989807..10df86a52 100644 --- a/app/policies/committee/decision_policy.rb +++ b/app/policies/committee/decision_policy.rb @@ -2,25 +2,9 @@ module Committee class DecisionPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def edit? - permitted? :write - end - - def new? - permitted? :write - end - - def show? - permitted? :read - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :destroy?, :index? private diff --git a/app/policies/committee/meeting_policy.rb b/app/policies/committee/meeting_policy.rb index 10c465669..923972266 100644 --- a/app/policies/committee/meeting_policy.rb +++ b/app/policies/committee/meeting_policy.rb @@ -2,33 +2,7 @@ module Committee class MeetingPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def show? - permitted? :read - end - - def update? - permitted? :write - end + include CrudPolicyMethods private diff --git a/app/policies/concerns/crud_policy_methods.rb b/app/policies/concerns/crud_policy_methods.rb new file mode 100644 index 000000000..49d7e9e95 --- /dev/null +++ b/app/policies/concerns/crud_policy_methods.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module CrudPolicyMethods + extend ActiveSupport::Concern + + included do + def create? + permitted? :write + end + + def destroy? + permitted? :destroy + end + + def edit? + update? + end + + def index? + permitted? :read + end + + def new? + create? + end + + def show? + permitted? :read + end + + def update? + permitted? :write + end + end +end diff --git a/app/policies/course_management/available_course_group_policy.rb b/app/policies/course_management/available_course_group_policy.rb index ccdaefff6..ff2a342f6 100644 --- a/app/policies/course_management/available_course_group_policy.rb +++ b/app/policies/course_management/available_course_group_policy.rb @@ -2,25 +2,9 @@ module CourseManagement class AvailableCourseGroupPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :index?, :show? private diff --git a/app/policies/course_management/available_course_policy.rb b/app/policies/course_management/available_course_policy.rb index 4376b1fa6..638341e65 100644 --- a/app/policies/course_management/available_course_policy.rb +++ b/app/policies/course_management/available_course_policy.rb @@ -2,33 +2,7 @@ module CourseManagement class AvailableCoursePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def show? - permitted? :read - end - - def update? - permitted? :write - end + include CrudPolicyMethods private diff --git a/app/policies/course_management/course_evaluation_type_policy.rb b/app/policies/course_management/course_evaluation_type_policy.rb index ff02212ee..121f70a2d 100644 --- a/app/policies/course_management/course_evaluation_type_policy.rb +++ b/app/policies/course_management/course_evaluation_type_policy.rb @@ -2,25 +2,9 @@ module CourseManagement class CourseEvaluationTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :index?, :show? private diff --git a/app/policies/course_management/course_group_policy.rb b/app/policies/course_management/course_group_policy.rb index 23263fa70..9897e2ed7 100644 --- a/app/policies/course_management/course_group_policy.rb +++ b/app/policies/course_management/course_group_policy.rb @@ -2,33 +2,7 @@ module CourseManagement class CourseGroupPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def show? - permitted? :read - end - - def update? - permitted? :write - end + include CrudPolicyMethods private diff --git a/app/policies/course_management/course_group_type_policy.rb b/app/policies/course_management/course_group_type_policy.rb index ba70bd28c..b52e8fdc3 100644 --- a/app/policies/course_management/course_group_type_policy.rb +++ b/app/policies/course_management/course_group_type_policy.rb @@ -2,29 +2,9 @@ module CourseManagement class CourseGroupTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end + include CrudPolicyMethods - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/course_management/course_policy.rb b/app/policies/course_management/course_policy.rb index c42374e14..8404caef7 100644 --- a/app/policies/course_management/course_policy.rb +++ b/app/policies/course_management/course_policy.rb @@ -2,33 +2,7 @@ module CourseManagement class CoursePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def show? - permitted? :read - end - - def update? - permitted? :write - end + include CrudPolicyMethods private diff --git a/app/policies/course_management/course_type_policy.rb b/app/policies/course_management/course_type_policy.rb index fcfd7dd12..be010d062 100644 --- a/app/policies/course_management/course_type_policy.rb +++ b/app/policies/course_management/course_type_policy.rb @@ -2,29 +2,9 @@ module CourseManagement class CourseTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end + include CrudPolicyMethods - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/course_management/curriculum_course_group_policy.rb b/app/policies/course_management/curriculum_course_group_policy.rb index 2abc82926..832576243 100644 --- a/app/policies/course_management/curriculum_course_group_policy.rb +++ b/app/policies/course_management/curriculum_course_group_policy.rb @@ -2,25 +2,9 @@ module CourseManagement class CurriculumCourseGroupPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :index?, :show? private diff --git a/app/policies/course_management/curriculum_course_policy.rb b/app/policies/course_management/curriculum_course_policy.rb index 6d87b9df7..3c1698da3 100644 --- a/app/policies/course_management/curriculum_course_policy.rb +++ b/app/policies/course_management/curriculum_course_policy.rb @@ -2,25 +2,9 @@ module CourseManagement class CurriculumCoursePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :index?, :show? private diff --git a/app/policies/course_management/curriculum_policy.rb b/app/policies/course_management/curriculum_policy.rb index 0dfebeed6..dcc211fd3 100644 --- a/app/policies/course_management/curriculum_policy.rb +++ b/app/policies/course_management/curriculum_policy.rb @@ -2,38 +2,12 @@ module CourseManagement class CurriculumPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods def openable_courses? permitted?(:read) || user.privilege?(:available_course_management, :write) end - def show? - permitted? :read - end - - def update? - permitted? :write - end - private def permitted?(*privileges) diff --git a/app/policies/first_registration/prospective_employee_policy.rb b/app/policies/first_registration/prospective_employee_policy.rb index e12f4ab4f..69c2ef15d 100644 --- a/app/policies/first_registration/prospective_employee_policy.rb +++ b/app/policies/first_registration/prospective_employee_policy.rb @@ -2,29 +2,9 @@ module FirstRegistration class ProspectiveEmployeePolicy < ApplicationPolicy - def create? - new? - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end + include CrudPolicyMethods - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def update? - edit? - end + undef :show? private diff --git a/app/policies/first_registration/prospective_student_policy.rb b/app/policies/first_registration/prospective_student_policy.rb index fd67ee11d..e597267d3 100644 --- a/app/policies/first_registration/prospective_student_policy.rb +++ b/app/policies/first_registration/prospective_student_policy.rb @@ -2,34 +2,14 @@ module FirstRegistration class ProspectiveStudentPolicy < ApplicationPolicy - def create? - new? - end - - def edit? - permitted? :write - end - - def index? - permitted? :read - end + include CrudPolicyMethods - def new? - permitted? :write - end + undef :destroy? def register? permitted? :write end - def show? - permitted? :read - end - - def update? - edit? - end - private def permitted?(*privileges) diff --git a/app/policies/first_registration/registration_document_policy.rb b/app/policies/first_registration/registration_document_policy.rb index d8a6779a9..ebfa98174 100644 --- a/app/policies/first_registration/registration_document_policy.rb +++ b/app/policies/first_registration/registration_document_policy.rb @@ -2,29 +2,9 @@ module FirstRegistration class RegistrationDocumentPolicy < ApplicationPolicy - def create? - new? - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end + include CrudPolicyMethods - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def update? - edit? - end + undef :show? private diff --git a/app/policies/location/city_policy.rb b/app/policies/location/city_policy.rb index e533e2baa..d7448f774 100644 --- a/app/policies/location/city_policy.rb +++ b/app/policies/location/city_policy.rb @@ -2,29 +2,9 @@ module Location class CityPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end + include CrudPolicyMethods - def new? - permitted? :write - end - - def show? - permitted? :read - end - - def update? - permitted? :write - end + undef :index? private diff --git a/app/policies/location/country_policy.rb b/app/policies/location/country_policy.rb index 98f195cee..31ec0a9f5 100644 --- a/app/policies/location/country_policy.rb +++ b/app/policies/location/country_policy.rb @@ -2,33 +2,7 @@ module Location class CountryPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def show? - permitted? :read - end - - def update? - permitted? :write - end + include CrudPolicyMethods private diff --git a/app/policies/location/district_policy.rb b/app/policies/location/district_policy.rb index 295bda1c9..3667d2e1c 100644 --- a/app/policies/location/district_policy.rb +++ b/app/policies/location/district_policy.rb @@ -2,25 +2,9 @@ module Location class DistrictPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :index?, :show? private diff --git a/app/policies/meksis/building_policy.rb b/app/policies/meksis/building_policy.rb index 9874cab75..fc6247a65 100644 --- a/app/policies/meksis/building_policy.rb +++ b/app/policies/meksis/building_policy.rb @@ -2,21 +2,9 @@ module Meksis class BuildingPolicy < ApplicationPolicy - def edit? - permitted? :write - end - - def index? - permitted? :read - end + include CrudPolicyMethods - def show? - permitted? :read - end - - def update? - permitted? :write - end + undef :new?, :create?, :destroy? private diff --git a/app/policies/patron/assignment_policy.rb b/app/policies/patron/assignment_policy.rb index e0e3f1848..3d02dc26c 100644 --- a/app/policies/patron/assignment_policy.rb +++ b/app/policies/patron/assignment_policy.rb @@ -2,21 +2,9 @@ module Patron class AssignmentPolicy < ApplicationPolicy - def index? - permitted? :read - end - - def show? - permitted? :read - end - - def update? - permitted? :write - end + include CrudPolicyMethods - def edit? - update? - end + undef :new?, :create?, :destroy? def preview_scope? permitted? :read diff --git a/app/policies/patron/query_store_policy.rb b/app/policies/patron/query_store_policy.rb index 5433532b4..f95d0f9f0 100644 --- a/app/policies/patron/query_store_policy.rb +++ b/app/policies/patron/query_store_policy.rb @@ -2,33 +2,7 @@ module Patron class QueryStorePolicy < ApplicationPolicy - def index? - permitted? :read - end - - def show? - permitted? :read - end - - def new? - create? - end - - def create? - permitted? :write - end - - def update? - permitted? :write - end - - def edit? - update? - end - - def destroy? - permitted? :destroy - end + include CrudPolicyMethods def preview? permitted? :read diff --git a/app/policies/reference/academic_term_policy.rb b/app/policies/reference/academic_term_policy.rb index adfd0128e..e6d51970b 100644 --- a/app/policies/reference/academic_term_policy.rb +++ b/app/policies/reference/academic_term_policy.rb @@ -2,25 +2,9 @@ module Reference class AcademicTermPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/reference/assessment_method_policy.rb b/app/policies/reference/assessment_method_policy.rb index e6645dc77..262e8596b 100644 --- a/app/policies/reference/assessment_method_policy.rb +++ b/app/policies/reference/assessment_method_policy.rb @@ -2,25 +2,9 @@ module Reference class AssessmentMethodPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/reference/course_group_type_policy.rb b/app/policies/reference/course_group_type_policy.rb index 4a3aa1412..14940768c 100644 --- a/app/policies/reference/course_group_type_policy.rb +++ b/app/policies/reference/course_group_type_policy.rb @@ -2,29 +2,9 @@ module Reference class CourseGroupTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end + include CrudPolicyMethods - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/reference/course_type_policy.rb b/app/policies/reference/course_type_policy.rb index aa84f7503..3d9e7fb4c 100644 --- a/app/policies/reference/course_type_policy.rb +++ b/app/policies/reference/course_type_policy.rb @@ -2,29 +2,9 @@ module Reference class CourseTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end + include CrudPolicyMethods - def index? - permitted? :read - end - - def new? - permitted? :write - end - - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/reference/document_type_policy.rb b/app/policies/reference/document_type_policy.rb index de15beab0..c1a11e900 100644 --- a/app/policies/reference/document_type_policy.rb +++ b/app/policies/reference/document_type_policy.rb @@ -2,25 +2,9 @@ module Reference class DocumentTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/reference/evaluation_type_policy.rb b/app/policies/reference/evaluation_type_policy.rb index 10ad574ec..669bf926f 100644 --- a/app/policies/reference/evaluation_type_policy.rb +++ b/app/policies/reference/evaluation_type_policy.rb @@ -2,25 +2,9 @@ module Reference class EvaluationTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/reference/high_school_type_policy.rb b/app/policies/reference/high_school_type_policy.rb index 76e6a794c..c7425bd5f 100644 --- a/app/policies/reference/high_school_type_policy.rb +++ b/app/policies/reference/high_school_type_policy.rb @@ -2,25 +2,9 @@ module Reference class HighSchoolTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/reference/language_policy.rb b/app/policies/reference/language_policy.rb index 7480b8b69..2b322f40d 100644 --- a/app/policies/reference/language_policy.rb +++ b/app/policies/reference/language_policy.rb @@ -2,25 +2,9 @@ module Reference class LanguagePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/reference/scholarship_type_policy.rb b/app/policies/reference/scholarship_type_policy.rb index 69d94c465..510060128 100644 --- a/app/policies/reference/scholarship_type_policy.rb +++ b/app/policies/reference/scholarship_type_policy.rb @@ -2,25 +2,9 @@ module Reference class ScholarshipTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/reference/title_policy.rb b/app/policies/reference/title_policy.rb index 8338911b7..e44399bee 100644 --- a/app/policies/reference/title_policy.rb +++ b/app/policies/reference/title_policy.rb @@ -2,25 +2,9 @@ module Reference class TitlePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/unit_policy.rb b/app/policies/unit_policy.rb index c61863110..f685f0ebc 100644 --- a/app/policies/unit_policy.rb +++ b/app/policies/unit_policy.rb @@ -1,50 +1,24 @@ # frozen_string_literal: true class UnitPolicy < ApplicationPolicy + include CrudPolicyMethods + def courses? permitted? :read end - def create? - permitted? :write - end - def curriculums? permitted? :read end - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - def employees? permitted? :read end - def index? - permitted? :read - end - - def new? - permitted? :write - end - def programs? permitted? :read end - def show? - permitted? :read - end - - def update? - permitted? :write - end - private def permitted?(*privileges) diff --git a/app/policies/user_management/duty_policy.rb b/app/policies/user_management/duty_policy.rb index 9308c6e43..1b0fcd3ae 100644 --- a/app/policies/user_management/duty_policy.rb +++ b/app/policies/user_management/duty_policy.rb @@ -2,25 +2,9 @@ module UserManagement class DutyPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :index?, :show? private diff --git a/app/policies/user_management/employee_policy.rb b/app/policies/user_management/employee_policy.rb index c852c1e8d..c3d08b1a7 100644 --- a/app/policies/user_management/employee_policy.rb +++ b/app/policies/user_management/employee_policy.rb @@ -2,25 +2,9 @@ module UserManagement class EmployeePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :index?, :show? private diff --git a/app/policies/user_management/position_policy.rb b/app/policies/user_management/position_policy.rb index c2e798295..a03b37eb4 100644 --- a/app/policies/user_management/position_policy.rb +++ b/app/policies/user_management/position_policy.rb @@ -2,25 +2,9 @@ module UserManagement class PositionPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def edit? - permitted? :write - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :index?, :show? private diff --git a/app/policies/user_management/user_policy.rb b/app/policies/user_management/user_policy.rb index a7a221252..5bd198572 100644 --- a/app/policies/user_management/user_policy.rb +++ b/app/policies/user_management/user_policy.rb @@ -2,31 +2,15 @@ module UserManagement class UserPolicy < ApplicationPolicy - def destroy? - permitted? :destroy - end + include CrudPolicyMethods - def edit? - permitted? :write - end - - def index? - permitted? :read - end + undef :create?, :new? def save_address_from_mernis? - permitted? :report + permitted? :write end def save_identity_from_mernis? - permitted? :report - end - - def show? - permitted? :read - end - - def update? permitted? :write end diff --git a/app/policies/yoksis/administrative_function_policy.rb b/app/policies/yoksis/administrative_function_policy.rb index 0b603e44e..00d472540 100644 --- a/app/policies/yoksis/administrative_function_policy.rb +++ b/app/policies/yoksis/administrative_function_policy.rb @@ -2,25 +2,9 @@ module Yoksis class AdministrativeFunctionPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? protected diff --git a/app/policies/yoksis/student_disability_type_policy.rb b/app/policies/yoksis/student_disability_type_policy.rb index 7a5cb706e..4e63ac448 100644 --- a/app/policies/yoksis/student_disability_type_policy.rb +++ b/app/policies/yoksis/student_disability_type_policy.rb @@ -2,25 +2,9 @@ module Yoksis class StudentDisabilityTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/yoksis/student_drop_out_type_policy.rb b/app/policies/yoksis/student_drop_out_type_policy.rb index cefcabbc3..3d391e4d8 100644 --- a/app/policies/yoksis/student_drop_out_type_policy.rb +++ b/app/policies/yoksis/student_drop_out_type_policy.rb @@ -2,25 +2,9 @@ module Yoksis class StudentDropOutTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/yoksis/student_education_level_policy.rb b/app/policies/yoksis/student_education_level_policy.rb index 4c643dd30..04c125c93 100644 --- a/app/policies/yoksis/student_education_level_policy.rb +++ b/app/policies/yoksis/student_education_level_policy.rb @@ -2,25 +2,9 @@ module Yoksis class StudentEducationLevelPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/yoksis/student_entrance_point_type_policy.rb b/app/policies/yoksis/student_entrance_point_type_policy.rb index 9fd64a5d1..9a2a430da 100644 --- a/app/policies/yoksis/student_entrance_point_type_policy.rb +++ b/app/policies/yoksis/student_entrance_point_type_policy.rb @@ -2,25 +2,9 @@ module Yoksis class StudentEntrancePointTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/yoksis/student_entrance_type_policy.rb b/app/policies/yoksis/student_entrance_type_policy.rb index 039e3768a..3dd2d4730 100644 --- a/app/policies/yoksis/student_entrance_type_policy.rb +++ b/app/policies/yoksis/student_entrance_type_policy.rb @@ -2,25 +2,9 @@ module Yoksis class StudentEntranceTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/yoksis/student_grade_policy.rb b/app/policies/yoksis/student_grade_policy.rb index 158e94666..78672d2c9 100644 --- a/app/policies/yoksis/student_grade_policy.rb +++ b/app/policies/yoksis/student_grade_policy.rb @@ -2,25 +2,9 @@ module Yoksis class StudentGradePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/yoksis/student_grading_system_policy.rb b/app/policies/yoksis/student_grading_system_policy.rb index 8a007903d..682f62b2d 100644 --- a/app/policies/yoksis/student_grading_system_policy.rb +++ b/app/policies/yoksis/student_grading_system_policy.rb @@ -2,25 +2,9 @@ module Yoksis class StudentGradingSystemPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/yoksis/student_punishment_type_policy.rb b/app/policies/yoksis/student_punishment_type_policy.rb index d9095b80a..8c3f75c5b 100644 --- a/app/policies/yoksis/student_punishment_type_policy.rb +++ b/app/policies/yoksis/student_punishment_type_policy.rb @@ -2,25 +2,9 @@ module Yoksis class StudentPunishmentTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/yoksis/student_studentship_status_policy.rb b/app/policies/yoksis/student_studentship_status_policy.rb index 3003ec504..6945defff 100644 --- a/app/policies/yoksis/student_studentship_status_policy.rb +++ b/app/policies/yoksis/student_studentship_status_policy.rb @@ -2,25 +2,9 @@ module Yoksis class StudentStudentshipStatusPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/yoksis/unit_instruction_language_policy.rb b/app/policies/yoksis/unit_instruction_language_policy.rb index 9db573642..72a3d39dd 100644 --- a/app/policies/yoksis/unit_instruction_language_policy.rb +++ b/app/policies/yoksis/unit_instruction_language_policy.rb @@ -2,25 +2,9 @@ module Yoksis class UnitInstructionLanguagePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/yoksis/unit_instruction_type_policy.rb b/app/policies/yoksis/unit_instruction_type_policy.rb index 6deb149d1..f42342412 100644 --- a/app/policies/yoksis/unit_instruction_type_policy.rb +++ b/app/policies/yoksis/unit_instruction_type_policy.rb @@ -2,25 +2,9 @@ module Yoksis class UnitInstructionTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/yoksis/unit_status_policy.rb b/app/policies/yoksis/unit_status_policy.rb index b5c0dce19..ba577cafc 100644 --- a/app/policies/yoksis/unit_status_policy.rb +++ b/app/policies/yoksis/unit_status_policy.rb @@ -2,25 +2,9 @@ module Yoksis class UnitStatusPolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/yoksis/unit_type_policy.rb b/app/policies/yoksis/unit_type_policy.rb index e58557c59..456aef142 100644 --- a/app/policies/yoksis/unit_type_policy.rb +++ b/app/policies/yoksis/unit_type_policy.rb @@ -2,25 +2,9 @@ module Yoksis class UnitTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/app/policies/yoksis/university_type_policy.rb b/app/policies/yoksis/university_type_policy.rb index af01d8a2c..faef83f6b 100644 --- a/app/policies/yoksis/university_type_policy.rb +++ b/app/policies/yoksis/university_type_policy.rb @@ -2,25 +2,9 @@ module Yoksis class UniversityTypePolicy < ApplicationPolicy - def create? - permitted? :write - end - - def destroy? - permitted? :destroy - end - - def index? - permitted? :read - end - - def new? - permitted? :write - end + include CrudPolicyMethods - def update? - permitted? :write - end + undef :show? private diff --git a/test/policies/reference/academic_term_policy_test.rb b/test/policies/reference/academic_term_policy_test.rb index da9907170..02237f38d 100644 --- a/test/policies/reference/academic_term_policy_test.rb +++ b/test/policies/reference/academic_term_policy_test.rb @@ -7,6 +7,7 @@ class AcademicTermPolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/reference/assessment_method_policy_test.rb b/test/policies/reference/assessment_method_policy_test.rb index 41d651507..012867e3e 100644 --- a/test/policies/reference/assessment_method_policy_test.rb +++ b/test/policies/reference/assessment_method_policy_test.rb @@ -7,6 +7,7 @@ class AssessmentMethodPolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/reference/document_type_policy_test.rb b/test/policies/reference/document_type_policy_test.rb index b911c3d14..1ccacc3df 100644 --- a/test/policies/reference/document_type_policy_test.rb +++ b/test/policies/reference/document_type_policy_test.rb @@ -7,6 +7,7 @@ class DocumentTypePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/reference/evaluation_type_policy_test.rb b/test/policies/reference/evaluation_type_policy_test.rb index adc867a25..52173bb0b 100644 --- a/test/policies/reference/evaluation_type_policy_test.rb +++ b/test/policies/reference/evaluation_type_policy_test.rb @@ -7,6 +7,7 @@ class EvaluationTypePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/reference/high_school_type_policy_test.rb b/test/policies/reference/high_school_type_policy_test.rb index 7b4e2af4c..08a75a875 100644 --- a/test/policies/reference/high_school_type_policy_test.rb +++ b/test/policies/reference/high_school_type_policy_test.rb @@ -7,6 +7,7 @@ class HighSchoolTypePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/reference/language_policy_test.rb b/test/policies/reference/language_policy_test.rb index f3562e538..10b5eb9d9 100644 --- a/test/policies/reference/language_policy_test.rb +++ b/test/policies/reference/language_policy_test.rb @@ -7,6 +7,7 @@ class LanguagePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/reference/scholarship_type_policy_test.rb b/test/policies/reference/scholarship_type_policy_test.rb index d6087bea8..79421be2c 100644 --- a/test/policies/reference/scholarship_type_policy_test.rb +++ b/test/policies/reference/scholarship_type_policy_test.rb @@ -7,6 +7,7 @@ class ScholarshipTypePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/reference/title_policy_test.rb b/test/policies/reference/title_policy_test.rb index 34e1408bd..e18e6aeb4 100644 --- a/test/policies/reference/title_policy_test.rb +++ b/test/policies/reference/title_policy_test.rb @@ -7,6 +7,7 @@ class TitlePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/administrative_function_policy_test.rb b/test/policies/yoksis/administrative_function_policy_test.rb index 739b88823..1d56ab4e1 100644 --- a/test/policies/yoksis/administrative_function_policy_test.rb +++ b/test/policies/yoksis/administrative_function_policy_test.rb @@ -7,6 +7,7 @@ class AdministrativeFunctionPolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/student_disability_type_policy_test.rb b/test/policies/yoksis/student_disability_type_policy_test.rb index 8d332a797..ee27abb9c 100644 --- a/test/policies/yoksis/student_disability_type_policy_test.rb +++ b/test/policies/yoksis/student_disability_type_policy_test.rb @@ -7,6 +7,7 @@ class StudentDisabilityTypePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/student_drop_out_type_policy_test.rb b/test/policies/yoksis/student_drop_out_type_policy_test.rb index d6b1b22de..b84d6a638 100644 --- a/test/policies/yoksis/student_drop_out_type_policy_test.rb +++ b/test/policies/yoksis/student_drop_out_type_policy_test.rb @@ -7,6 +7,7 @@ class StudentDropOutTypePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/student_education_level_policy_test.rb b/test/policies/yoksis/student_education_level_policy_test.rb index bd5610c58..9f69b4801 100644 --- a/test/policies/yoksis/student_education_level_policy_test.rb +++ b/test/policies/yoksis/student_education_level_policy_test.rb @@ -7,6 +7,7 @@ class StudentEducationLevelPolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/student_entrance_point_type_policy_test.rb b/test/policies/yoksis/student_entrance_point_type_policy_test.rb index d0918cf9e..492c2f02b 100644 --- a/test/policies/yoksis/student_entrance_point_type_policy_test.rb +++ b/test/policies/yoksis/student_entrance_point_type_policy_test.rb @@ -7,6 +7,7 @@ class StudentEntrancePointTypePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/student_entrance_type_policy_test.rb b/test/policies/yoksis/student_entrance_type_policy_test.rb index ba930ecb3..1dc1bfed7 100644 --- a/test/policies/yoksis/student_entrance_type_policy_test.rb +++ b/test/policies/yoksis/student_entrance_type_policy_test.rb @@ -7,6 +7,7 @@ class StudentEntranceTypePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/student_grade_policy_test.rb b/test/policies/yoksis/student_grade_policy_test.rb index 03fb1d93f..59fe524f0 100644 --- a/test/policies/yoksis/student_grade_policy_test.rb +++ b/test/policies/yoksis/student_grade_policy_test.rb @@ -7,6 +7,7 @@ class StudentGradePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/student_grading_system_policy_test.rb b/test/policies/yoksis/student_grading_system_policy_test.rb index 54412eee1..caf0b4447 100644 --- a/test/policies/yoksis/student_grading_system_policy_test.rb +++ b/test/policies/yoksis/student_grading_system_policy_test.rb @@ -7,6 +7,7 @@ class StudentGradingSystemPolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/student_punishment_type_policy_test.rb b/test/policies/yoksis/student_punishment_type_policy_test.rb index 77222d91c..b5405d1ed 100644 --- a/test/policies/yoksis/student_punishment_type_policy_test.rb +++ b/test/policies/yoksis/student_punishment_type_policy_test.rb @@ -7,6 +7,7 @@ class StudentPunishmentTypePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/student_studentship_status_policy_test.rb b/test/policies/yoksis/student_studentship_status_policy_test.rb index 6904b4093..efa92be9e 100644 --- a/test/policies/yoksis/student_studentship_status_policy_test.rb +++ b/test/policies/yoksis/student_studentship_status_policy_test.rb @@ -7,6 +7,7 @@ class StudentStudentshipStatusPolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/unit_instruction_language_policy_test.rb b/test/policies/yoksis/unit_instruction_language_policy_test.rb index a0c8c23a3..fe0adc2ca 100644 --- a/test/policies/yoksis/unit_instruction_language_policy_test.rb +++ b/test/policies/yoksis/unit_instruction_language_policy_test.rb @@ -7,6 +7,7 @@ class UnitInstructionLanguagePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/unit_instruction_type_policy_test.rb b/test/policies/yoksis/unit_instruction_type_policy_test.rb index d56590d3c..024c6c581 100644 --- a/test/policies/yoksis/unit_instruction_type_policy_test.rb +++ b/test/policies/yoksis/unit_instruction_type_policy_test.rb @@ -7,6 +7,7 @@ class UnitInstructionTypePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/unit_status_policy_test.rb b/test/policies/yoksis/unit_status_policy_test.rb index 93e46b2d0..165d3e09f 100644 --- a/test/policies/yoksis/unit_status_policy_test.rb +++ b/test/policies/yoksis/unit_status_policy_test.rb @@ -7,6 +7,7 @@ class UnitStatusPolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/unit_type_policy_test.rb b/test/policies/yoksis/unit_type_policy_test.rb index 8cd83fe47..8634be662 100644 --- a/test/policies/yoksis/unit_type_policy_test.rb +++ b/test/policies/yoksis/unit_type_policy_test.rb @@ -7,6 +7,7 @@ class UnitTypePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? diff --git a/test/policies/yoksis/university_type_policy_test.rb b/test/policies/yoksis/university_type_policy_test.rb index f661290af..22b0c27f9 100644 --- a/test/policies/yoksis/university_type_policy_test.rb +++ b/test/policies/yoksis/university_type_policy_test.rb @@ -7,6 +7,7 @@ class UniversityTypePolicyTest < PunditTestCase %w[ create? destroy? + edit? index? new? update? From f7d5a17d449138c6f88e087ce526da69c78376a2 Mon Sep 17 00:00:00 2001 From: isubas Date: Wed, 19 Feb 2020 12:10:56 +0300 Subject: [PATCH 246/970] =?UTF-8?q?Yanl=C4=B1=C5=9Fl=C4=B1kla=20eklenen=20?= =?UTF-8?q?yorum=20sat=C4=B1r=C4=B1n=C4=B1=20kald=C4=B1r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/xokul/connection.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/xokul/connection.rb b/app/services/xokul/connection.rb index 58f1613f3..5869aee4b 100644 --- a/app/services/xokul/connection.rb +++ b/app/services/xokul/connection.rb @@ -24,5 +24,5 @@ def self.request(path, params: {}, **options) end end - # private_constant :Connection + private_constant :Connection end From f403bd3ab7cea70f7a19b7d0e4eabf54c60c41d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Suba=C5=9F?= Date: Wed, 19 Feb 2020 12:14:15 +0300 Subject: [PATCH 247/970] Update config/locales/layouts/shared/sidebar.en.yml Co-Authored-By: Dilara Koca --- config/locales/layouts/shared/sidebar.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/layouts/shared/sidebar.en.yml b/config/locales/layouts/shared/sidebar.en.yml index 708138759..4c4860b25 100644 --- a/config/locales/layouts/shared/sidebar.en.yml +++ b/config/locales/layouts/shared/sidebar.en.yml @@ -13,7 +13,7 @@ en: calendars: Calendars committee_units: Committee Units committees: Committees - course_groups: Course Unit Group + course_groups: Course Groups course_management: Course Management course_unit_groups: Course Unit Group courses: Courses From b385b2cd0fe7a41213ed1d2615125470fdee7526 Mon Sep 17 00:00:00 2001 From: isubas Date: Wed, 19 Feb 2020 13:28:34 +0300 Subject: [PATCH 248/970] =?UTF-8?q?Ufak=20d=C3=BCzeltmeler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/patron/accounts/employee.rb | 2 +- app/models/patron/accounts/student.rb | 2 +- app/policies/manager/dashboard_policy.rb | 4 +--- app/policies/manager/stats/article_policy.rb | 4 +--- app/policies/manager/stats/employee_policy.rb | 4 +--- app/policies/manager/stats/student_policy.rb | 4 +--- 6 files changed, 6 insertions(+), 14 deletions(-) diff --git a/app/models/patron/accounts/employee.rb b/app/models/patron/accounts/employee.rb index 95476446a..a8156b0e5 100644 --- a/app/models/patron/accounts/employee.rb +++ b/app/models/patron/accounts/employee.rb @@ -8,7 +8,7 @@ def object end def label - "#{I18n.t('patron.accounts.employee')} - #{object&.title_name} (#{object.staff_number})" + "#{I18n.t('patron.accounts.employee')} - #{object&.title_name} (#{object&.staff_number})" end def type diff --git a/app/models/patron/accounts/student.rb b/app/models/patron/accounts/student.rb index 635fa0fe2..e882dad41 100644 --- a/app/models/patron/accounts/student.rb +++ b/app/models/patron/accounts/student.rb @@ -8,7 +8,7 @@ def object end def label - "#{I18n.t('patron.accounts.student')} - #{object.student_number}" + "#{I18n.t('patron.accounts.student')} - #{object&.student_number}" end def type diff --git a/app/policies/manager/dashboard_policy.rb b/app/policies/manager/dashboard_policy.rb index 870846f06..6b54df40c 100644 --- a/app/policies/manager/dashboard_policy.rb +++ b/app/policies/manager/dashboard_policy.rb @@ -9,9 +9,7 @@ def stats? private def manager? - user.positions.active.exists?( - administrative_function_id: AdministrativeFunction.where(name: ['Rektör', 'Rektör Yardımcısı']).ids - ) + Patron::Utils::RoleQuerier.new(user).institution_manager? end end end diff --git a/app/policies/manager/stats/article_policy.rb b/app/policies/manager/stats/article_policy.rb index 345bfecd1..2fbbe3791 100644 --- a/app/policies/manager/stats/article_policy.rb +++ b/app/policies/manager/stats/article_policy.rb @@ -10,9 +10,7 @@ def index? private def manager? - user.positions.active.exists?( - administrative_function_id: AdministrativeFunction.where(name: ['Rektör', 'Rektör Yardımcısı']).ids - ) + Patron::Utils::RoleQuerier.new(user).institution_manager? end end end diff --git a/app/policies/manager/stats/employee_policy.rb b/app/policies/manager/stats/employee_policy.rb index ee407d3c9..60b176c9c 100644 --- a/app/policies/manager/stats/employee_policy.rb +++ b/app/policies/manager/stats/employee_policy.rb @@ -14,9 +14,7 @@ def index? private def manager? - user.positions.active.exists?( - administrative_function_id: AdministrativeFunction.where(name: ['Rektör', 'Rektör Yardımcısı']).ids - ) + Patron::Utils::RoleQuerier.new(user).institution_manager? end end end diff --git a/app/policies/manager/stats/student_policy.rb b/app/policies/manager/stats/student_policy.rb index f86489cb7..23ac8598c 100644 --- a/app/policies/manager/stats/student_policy.rb +++ b/app/policies/manager/stats/student_policy.rb @@ -30,9 +30,7 @@ def non_graduates? private def manager? - user.positions.active.exists?( - administrative_function_id: AdministrativeFunction.where(name: ['Rektör', 'Rektör Yardımcısı']).ids - ) + Patron::Utils::RoleQuerier.new(user).institution_manager? end end end From a7e46326522ba0b125b51c37f783e7639281b55c Mon Sep 17 00:00:00 2001 From: isubas Date: Wed, 19 Feb 2020 13:53:18 +0300 Subject: [PATCH 249/970] =?UTF-8?q?Ufak=20d=C3=BCzeltme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 87c507065..838de03d8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -27,12 +27,15 @@ def default_url_options def switch_account account = Patron::Account.find_by(user: current_user, type: params[:type], id: params[:id]) + path = root_path + if account session[:account] = account.identifier - flash[:notice] = t('switched_account') + flash[:notice] = t('switched_account') + path = [*account&.root_path, only_path: true] end - redirect_to account&.root_path || root_path + redirect_to path end protected From 126b8902fa0f65a9bb9b05ad36c85e977e9a6524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Suba=C5=9F?= Date: Wed, 19 Feb 2020 14:02:03 +0300 Subject: [PATCH 250/970] Update config/locales/layouts/shared/sidebar.en.yml Co-Authored-By: Dilara Koca --- config/locales/layouts/shared/sidebar.en.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/locales/layouts/shared/sidebar.en.yml b/config/locales/layouts/shared/sidebar.en.yml index 4c4860b25..fa33a36d2 100644 --- a/config/locales/layouts/shared/sidebar.en.yml +++ b/config/locales/layouts/shared/sidebar.en.yml @@ -15,7 +15,6 @@ en: committees: Committees course_groups: Course Groups course_management: Course Management - course_unit_groups: Course Unit Group courses: Courses curriculums: Curriculums detsis: DETSIS From e3e40922cc0bd74c6e173922eb2e01d2820b434a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Suba=C5=9F?= Date: Wed, 19 Feb 2020 14:02:14 +0300 Subject: [PATCH 251/970] Update config/locales/layouts/shared/sidebar.tr.yml Co-Authored-By: Dilara Koca --- config/locales/layouts/shared/sidebar.tr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/locales/layouts/shared/sidebar.tr.yml b/config/locales/layouts/shared/sidebar.tr.yml index 429125c0c..23fceaa31 100644 --- a/config/locales/layouts/shared/sidebar.tr.yml +++ b/config/locales/layouts/shared/sidebar.tr.yml @@ -15,7 +15,6 @@ tr: committees: Kurullar/Komisyonlar course_groups: Ders Grupları course_management: Ders İşlemleri - course_unit_groups: Ders Grupları courses: Dersler curriculums: Müfredatlar detsis: DETSİS From fa25ad63306735e79e0beee2b6b2f807317a9d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Suba=C5=9F?= Date: Wed, 19 Feb 2020 14:05:31 +0300 Subject: [PATCH 252/970] Update config/locales/models/user/en.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Serhat Celil İLERİ --- config/locales/models/user/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index 477164ce2..4d413ba77 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -85,7 +85,7 @@ en: identities: Identities last_name: Last Name new_user_link: Create a New User - smart_search_placeholder: TC/YU number, e-mail address, first of last name + smart_search_placeholder: TC/YU number, e-mail address, first or last name new: form_title: Create Account save_address_from_mernis: From c3e088a33a9103e39660221bbb4f02620ae8ad76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Suba=C5=9F?= Date: Wed, 19 Feb 2020 14:05:55 +0300 Subject: [PATCH 253/970] Update config/locales/models/user/en.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Serhat Celil İLERİ --- config/locales/models/user/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index 4d413ba77..795132959 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -90,7 +90,7 @@ en: form_title: Create Account save_address_from_mernis: wait: The address was recently created or updated. You can update the address once a week. - will_update: We have received your request to create or update addresses, the address will be updated within a few seconds. + will_update: We have received your request to create or update addresses, the address will be updated within a few seconds/minutes. save_identity_from_mernis: wait: The identity was recently created or updated. You can update the identity once a week. will_update: We have received your request for an identity creation or an update, and within a few seconds/minutes the identity will be updated. From db3dd9fbbece8ec99df9aed1b76d07ff037b1b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Suba=C5=9F?= Date: Wed, 19 Feb 2020 15:28:26 +0300 Subject: [PATCH 254/970] Update app/controllers/application_controller.rb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Recai Oktaş --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 838de03d8..2ac9d7b63 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -103,7 +103,7 @@ def update_preferred_language def set_current_account if (account = current_user.accounts.first) - session[:account] = account&.identifier + session[:account] = account.identifier account else session.delete(:account) From 18be3579f4eccdc06779a6438b382dc7ad19b4e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Suba=C5=9F?= Date: Wed, 19 Feb 2020 15:28:44 +0300 Subject: [PATCH 255/970] Update app/models/patron/accounts/base.rb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Recai Oktaş --- app/models/patron/accounts/base.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/patron/accounts/base.rb b/app/models/patron/accounts/base.rb index 247e0aa62..67ca18c26 100644 --- a/app/models/patron/accounts/base.rb +++ b/app/models/patron/accounts/base.rb @@ -4,6 +4,7 @@ module Patron module Accounts class Base attr_reader :id, :user_id + def initialize(id, user_id) @id = id.to_i @user_id = user_id From 02966cdc020c4c6e86dbf0feabedc49c9a49916f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Suba=C5=9F?= Date: Wed, 19 Feb 2020 15:28:57 +0300 Subject: [PATCH 256/970] Update app/controllers/studentship/course_enrollments_controller.rb Co-Authored-By: Ecmel Albayrak --- app/controllers/studentship/course_enrollments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/studentship/course_enrollments_controller.rb b/app/controllers/studentship/course_enrollments_controller.rb index 47f43f527..456d86dac 100644 --- a/app/controllers/studentship/course_enrollments_controller.rb +++ b/app/controllers/studentship/course_enrollments_controller.rb @@ -60,7 +60,7 @@ def set_course_enrollment end def authorized? - authorize @student, policy_class: Studentship::CourseEnrollmentPolicy + authorize(@student, policy_class: Studentship::CourseEnrollmentPolicy) end def check_registrability From 19b8175b2a3abc526b38e7ace38a0fd5cd81ad76 Mon Sep 17 00:00:00 2001 From: isubas Date: Wed, 19 Feb 2020 15:32:07 +0300 Subject: [PATCH 257/970] =?UTF-8?q?Y=C3=96KS=C4=B0S=20i=C3=A7in=20izin=20o?= =?UTF-8?q?lu=C5=9Ftur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/initializers/role_management.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/config/initializers/role_management.rb b/config/initializers/role_management.rb index b85612d9e..b6960c680 100644 --- a/config/initializers/role_management.rb +++ b/config/initializers/role_management.rb @@ -63,8 +63,8 @@ class RoleManagement description: 'Ülke, Şehir ve İlçe Yönetim Yetkisi', privileges: %i[read write destroy] permission :meksis_management, - name: 'Meksis Yönetimi', - description: 'Meksis Yönetim Yetkisi', + name: 'MEKSİS Yönetimi', + description: 'MEKSİS Yönetim Yetkisi', privileges: %i[read write destroy] permission :reference_management, name: 'Referans Yönetimi', @@ -98,7 +98,10 @@ class RoleManagement name: 'Personel Yönetimi', description: 'Personel Yönetim Yetkisi', privileges: %i[read write destroy report] - + permission :yoksis_management, + name: 'YÖKSİS Yönetimi', + description: 'YÖKSİS Yönetim Yetkisi', + privileges: %i[read write destroy] # roles role :authorization_manager, name: 'Yetkilendirme Yöneticisi', @@ -130,7 +133,8 @@ class RoleManagement registration_management_for_students: %i[read write destroy], student_management: %i[read write destroy report], unit_management: %i[read write destroy report], - user_management: %i[read write destroy report] + user_management: %i[read write destroy report], + yoksis_management: %i[read write destroy] } role :manager, name: 'Yönetici', permissions: {} end From dbf9c8468e4891f2b9765206659945441159ad3e Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 19 Feb 2020 15:33:47 +0300 Subject: [PATCH 258/970] Show academic term to tution index page --- app/controllers/tuition_management/tuitions_controller.rb | 2 +- app/views/tuition_management/tuitions/index.html.erb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/tuition_management/tuitions_controller.rb b/app/controllers/tuition_management/tuitions_controller.rb index 02e5b846b..cd9315d8e 100644 --- a/app/controllers/tuition_management/tuitions_controller.rb +++ b/app/controllers/tuition_management/tuitions_controller.rb @@ -5,7 +5,7 @@ class TuitionsController < ApplicationController before_action :set_tuition, only: %i[edit update destroy] def index - @tuitions = Tuition.includes(:units, :unit_tuitions) + @tuitions = Tuition.includes(:units, :unit_tuitions, :academic_term) end def new diff --git a/app/views/tuition_management/tuitions/index.html.erb b/app/views/tuition_management/tuitions/index.html.erb index ecd34cb6b..ccf6e69f9 100644 --- a/app/views/tuition_management/tuitions/index.html.erb +++ b/app/views/tuition_management/tuitions/index.html.erb @@ -12,6 +12,7 @@ + @@ -21,6 +22,7 @@ <% @tuitions.each do |tuition| %> + From 0662aa2c506877218e07f9b522a5eac3b80bc104 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 19 Feb 2020 15:51:53 +0300 Subject: [PATCH 259/970] Fix translation --- .../locales/controllers/tuition_management/tuitions.en.yml | 6 +++--- .../locales/controllers/tuition_management/tuitions.tr.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/locales/controllers/tuition_management/tuitions.en.yml b/config/locales/controllers/tuition_management/tuitions.en.yml index fa166dfdf..c939d3e54 100644 --- a/config/locales/controllers/tuition_management/tuitions.en.yml +++ b/config/locales/controllers/tuition_management/tuitions.en.yml @@ -14,10 +14,10 @@ en: success: Tuitions successfully deleted. warning: Tuitions can not be deleted! form: - form_title: Harç Ekle + form_title: Add Tuition index: <<: *tuition_attributes - card_header: Harçlar - new_tuition_link: Yeni Harç Ekle + card_header: Unit Tuition Fees + new_tuition_link: Add New Tuition update: success: Tuitions successfully updated. diff --git a/config/locales/controllers/tuition_management/tuitions.tr.yml b/config/locales/controllers/tuition_management/tuitions.tr.yml index fac423578..9502af738 100644 --- a/config/locales/controllers/tuition_management/tuitions.tr.yml +++ b/config/locales/controllers/tuition_management/tuitions.tr.yml @@ -14,11 +14,11 @@ tr: success: Harçlar başarıyla silindi. warning: Harçlar silinemedi! form: - form_title: Add Tuition + form_title: Harç Ekle index: <<: *tuition_attributes - card_header: Tuitions - new_tuition_link: Add New Tuition + card_header: Birim Harç Ücretleri + new_tuition_link: Yeni Harç Ekle update: success: Harçlar başarıyla güncellendi. From a980b62cd233e3614d3974e47ea257f19a6e985c Mon Sep 17 00:00:00 2001 From: isubas Date: Wed, 19 Feb 2020 16:02:31 +0300 Subject: [PATCH 260/970] Fix rubocop offences --- app/models/patron/accounts/base.rb | 2 +- app/views/layouts/shared/menus/_admin.html.erb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/patron/accounts/base.rb b/app/models/patron/accounts/base.rb index 67ca18c26..599bb7527 100644 --- a/app/models/patron/accounts/base.rb +++ b/app/models/patron/accounts/base.rb @@ -4,7 +4,7 @@ module Patron module Accounts class Base attr_reader :id, :user_id - + def initialize(id, user_id) @id = id.to_i @user_id = user_id diff --git a/app/views/layouts/shared/menus/_admin.html.erb b/app/views/layouts/shared/menus/_admin.html.erb index 7f1252a8a..96aae7a26 100644 --- a/app/views/layouts/shared/menus/_admin.html.erb +++ b/app/views/layouts/shared/menus/_admin.html.erb @@ -181,4 +181,3 @@ <% end %> - From e54011e38b6a91f6fde0342576bec773240bab30 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 19 Feb 2020 16:25:16 +0300 Subject: [PATCH 261/970] Add search bar --- .../tuition_management/tuitions_controller.rb | 6 ++- app/models/tuition.rb | 6 +++ .../tuitions/_search.html.erb | 50 +++++++++++++++++++ .../tuitions/index.html.erb | 1 + .../tuition_management/tuitions.en.yml | 2 + .../tuition_management/tuitions.tr.yml | 2 + 6 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 app/views/tuition_management/tuitions/_search.html.erb diff --git a/app/controllers/tuition_management/tuitions_controller.rb b/app/controllers/tuition_management/tuitions_controller.rb index cd9315d8e..5b5f8ac4d 100644 --- a/app/controllers/tuition_management/tuitions_controller.rb +++ b/app/controllers/tuition_management/tuitions_controller.rb @@ -2,10 +2,14 @@ module TuitionManagement class TuitionsController < ApplicationController + include SearchableModule + before_action :set_tuition, only: %i[edit update destroy] def index - @tuitions = Tuition.includes(:units, :unit_tuitions, :academic_term) + tuitions = Tuition.includes(:units, :unit_tuitions, :academic_term) + + @pagy, @tuitions = pagy(tuitions.dynamic_search(search_params(Tuition))) end def new diff --git a/app/models/tuition.rb b/app/models/tuition.rb index 56aaa7eac..438119a98 100644 --- a/app/models/tuition.rb +++ b/app/models/tuition.rb @@ -1,6 +1,12 @@ # frozen_string_literal: true class Tuition < ApplicationRecord + # search + include DynamicSearch + + # dynamic_search + search_keys :academic_term_id + # relations belongs_to :academic_term has_many :unit_tuitions, dependent: :destroy diff --git a/app/views/tuition_management/tuitions/_search.html.erb b/app/views/tuition_management/tuitions/_search.html.erb new file mode 100644 index 000000000..dac1843d0 --- /dev/null +++ b/app/views/tuition_management/tuitions/_search.html.erb @@ -0,0 +1,50 @@ +
+
+ +
+
+ <%= form_tag tuitions_path, method: :get do %> +
+
+ <%= label_tag(:academic_term_id, t('.academic_term')) %> + <%= select_tag(:academic_term_id, + options_from_collection_for_select(AcademicTerm.all, :id, lambda { |term| full_name(term) }, params[:academic_term_id]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %> +
+
+
+
+ <%= submit_tag t('search'), class: 'btn btn-primary' %> +
+
+ <% end %> +
+
+
+
+ + diff --git a/app/views/tuition_management/tuitions/index.html.erb b/app/views/tuition_management/tuitions/index.html.erb index ccf6e69f9..b5122f9af 100644 --- a/app/views/tuition_management/tuitions/index.html.erb +++ b/app/views/tuition_management/tuitions/index.html.erb @@ -8,6 +8,7 @@
+ <%= render 'search' %>
BirimlerÜcretYabancı Öğrenci Ücret<%= t('.unit_ids') %><%= t('.fee') %><%= t('.foreign_student_fee') %> <%= t('actions') %>
<%= tuition.units.map(&:name).join(', ') %> <%= tuition.fee %> <%= tuition.foreign_student_fee %><%= link_to_actions(tuition, except: :show) %>
<%= tuition.units.map(&:name).join(', ') %><%= tuition.fee %><%= tuition.foreign_student_fee %><%= number_to_currency(tuition.fee) %><%= number_to_currency(tuition.foreign_student_fee) %> <%= link_to_actions(tuition, except: :show) %>
<%= t('.unit_ids') %><%= t('.academic_term') %> <%= t('.fee') %> <%= t('.foreign_student_fee') %> <%= t('actions') %>
<%= tuition.units.map(&:name).join(', ') %><%= full_name(tuition.academic_term) %> <%= number_to_currency(tuition.fee) %> <%= number_to_currency(tuition.foreign_student_fee) %> <%= link_to_actions(tuition, except: :show) %>
diff --git a/config/locales/controllers/tuition_management/tuitions.en.yml b/config/locales/controllers/tuition_management/tuitions.en.yml index c939d3e54..cf06d045e 100644 --- a/config/locales/controllers/tuition_management/tuitions.en.yml +++ b/config/locales/controllers/tuition_management/tuitions.en.yml @@ -19,5 +19,7 @@ en: <<: *tuition_attributes card_header: Unit Tuition Fees new_tuition_link: Add New Tuition + search: + academic_term: Academic Term update: success: Tuitions successfully updated. diff --git a/config/locales/controllers/tuition_management/tuitions.tr.yml b/config/locales/controllers/tuition_management/tuitions.tr.yml index 9502af738..51e10eebe 100644 --- a/config/locales/controllers/tuition_management/tuitions.tr.yml +++ b/config/locales/controllers/tuition_management/tuitions.tr.yml @@ -19,6 +19,8 @@ tr: <<: *tuition_attributes card_header: Birim Harç Ücretleri new_tuition_link: Yeni Harç Ekle + search: + academic_term: Akademik Dönem update: success: Harçlar başarıyla güncellendi. From 5a4321bef14f8a44ada28225b35c72e849b695d3 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 20 Feb 2020 10:02:35 +0300 Subject: [PATCH 262/970] Fix linter error --- app/views/tuition_management/tuitions/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/tuition_management/tuitions/_form.html.erb b/app/views/tuition_management/tuitions/_form.html.erb index 31fdfffdf..2010b7b9a 100644 --- a/app/views/tuition_management/tuitions/_form.html.erb +++ b/app/views/tuition_management/tuitions/_form.html.erb @@ -3,7 +3,7 @@
<%= fa_icon 'money' %> - <%= t('.form_title') %> + <%= t('.form_title') %>
<%= simple_form_for(tuition) do |f| %> From ef520a44a1591266a5809a348056488f872d2824 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 20 Feb 2020 10:04:52 +0300 Subject: [PATCH 263/970] Don't close when selecting unit --- app/views/tuition_management/tuitions/_form.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/tuition_management/tuitions/_form.html.erb b/app/views/tuition_management/tuitions/_form.html.erb index 2010b7b9a..afcb5b403 100644 --- a/app/views/tuition_management/tuitions/_form.html.erb +++ b/app/views/tuition_management/tuitions/_form.html.erb @@ -38,6 +38,7 @@ From 31ece3ab1e08598f612b739c3317046da5111e2f Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 25 Feb 2020 13:53:27 +0300 Subject: [PATCH 311/970] Show edit button unless saved --- app/views/instructiveness/assessments/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/instructiveness/assessments/show.html.erb b/app/views/instructiveness/assessments/show.html.erb index f38e69173..8b8117099 100644 --- a/app/views/instructiveness/assessments/show.html.erb +++ b/app/views/instructiveness/assessments/show.html.erb @@ -13,7 +13,7 @@ <%= link_to(t('.draft'), draft_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.saved? %> <%= link_to(t('.save'), save_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.draft? && @assessment.fully_graded? %> <% end %> - <%= link_to(t('action_group.edit'), edit_given_course_assessment_path(@course, @assessment), class: 'btn btn-outline-success btn-sm') if @assessment.draft? %> + <%= link_to(t('action_group.edit'), edit_given_course_assessment_path(@course, @assessment), class: 'btn btn-outline-success btn-sm') unless @assessment.saved? %>
From 16e566b1605eb397e1e9c12ade18e7269109bad1 Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 25 Feb 2020 13:53:50 +0300 Subject: [PATCH 312/970] Add missing tests --- .../instructiveness/assessments_controller_test.rb | 5 +++++ test/models/course_assessment_method_test.rb | 2 +- test/policies/instructiveness/assessment_policy_test.rb | 3 +++ test/services/ldap/entity_test.rb | 4 ++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/test/controllers/instructiveness/assessments_controller_test.rb b/test/controllers/instructiveness/assessments_controller_test.rb index 37cfc3f24..1ff756fbe 100644 --- a/test/controllers/instructiveness/assessments_controller_test.rb +++ b/test/controllers/instructiveness/assessments_controller_test.rb @@ -11,6 +11,11 @@ class AssessmentsControllerTest < ActionDispatch::IntegrationTest @course_enrollment = course_enrollments(:johns_enrollment) end + test 'should get show' do + get given_course_assessment_path(@course, @assessment) + assert_response :success + end + test 'should get edit' do get edit_given_course_assessment_path(@course, @assessment) assert_response :success diff --git a/test/models/course_assessment_method_test.rb b/test/models/course_assessment_method_test.rb index e31843cbd..5ba7259a5 100644 --- a/test/models/course_assessment_method_test.rb +++ b/test/models/course_assessment_method_test.rb @@ -8,7 +8,7 @@ class CourseAssessmentMethodTest < ActiveSupport::TestCase extend Support::Minitest::ValidationHelper # enums - enum status: { no_grade_entered: 0, draft: 1 } + enum status: { no_grade_entered: 0, draft: 1, saved: 2 } # relations belongs_to :assessment_method diff --git a/test/policies/instructiveness/assessment_policy_test.rb b/test/policies/instructiveness/assessment_policy_test.rb index 9a768f29e..09786dde7 100644 --- a/test/policies/instructiveness/assessment_policy_test.rb +++ b/test/policies/instructiveness/assessment_policy_test.rb @@ -5,8 +5,11 @@ module Instructiveness class AssessmentPolicyTest < PunditTestCase %w[ + show? edit? update? + save? + draft? ].each do |method| test method do assert_permit users(:serhat), record: employees(:serhat_active) diff --git a/test/services/ldap/entity_test.rb b/test/services/ldap/entity_test.rb index 367f87776..c700fe984 100644 --- a/test/services/ldap/entity_test.rb +++ b/test/services/ldap/entity_test.rb @@ -42,10 +42,10 @@ class EntityTest < ActiveSupport::TestCase member@_.baum employee@_.baum faculty@_.baum - member@_.bilgisayar-pr.bilgisayar.muhendislik - student@_.bilgisayar-pr.bilgisayar.muhendislik member@_.mf-mat-pr.matematik-fen.egitim student@_.mf-mat-pr.matematik-fen.egitim + member@_.bilgisayar-pr.bilgisayar.muhendislik + student@_.bilgisayar-pr.bilgisayar.muhendislik ].map { |item| "#{item}.#{Tenant.configuration.ldap.organization}" } assert_equal @entity.eduPersonScopedAffiliation, affiliations From 3f5892ee6d0f4c80b39ea70614a5cc922bb210bc Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 25 Feb 2020 14:17:19 +0300 Subject: [PATCH 313/970] Create tuition policy --- .../tuition_management/tuitions_controller.rb | 5 +++++ app/policies/tuition_management/tuition_policy.rb | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 app/policies/tuition_management/tuition_policy.rb diff --git a/app/controllers/tuition_management/tuitions_controller.rb b/app/controllers/tuition_management/tuitions_controller.rb index a58a98305..c9ec10c6a 100644 --- a/app/controllers/tuition_management/tuitions_controller.rb +++ b/app/controllers/tuition_management/tuitions_controller.rb @@ -5,6 +5,7 @@ class TuitionsController < ApplicationController include SearchableModule before_action :set_tuition, only: %i[edit update destroy] + before_action :authorized? def index tuitions = Tuition.includes(:units, :unit_tuitions, :academic_term) @@ -44,6 +45,10 @@ def set_tuition @tuition = Tuition.find(params[:id]) end + def authorized? + authorize([:tuition_management, @tuition || Tuition]) + end + def tuition_params params.require(:tuition).permit(:academic_term_id, :fee, :foreign_student_fee, unit_ids: []) end diff --git a/app/policies/tuition_management/tuition_policy.rb b/app/policies/tuition_management/tuition_policy.rb new file mode 100644 index 000000000..bb438e670 --- /dev/null +++ b/app/policies/tuition_management/tuition_policy.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module TuitionManagement + class TuitionPolicy < ApplicationPolicy + include CrudPolicyMethods + + undef :show? + + private + + def permitted?(*privileges) + user.privilege? :tuition_management, privileges + end + end +end From d86ee701c8d0c2732d0e52f3648fb3315a92e725 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 25 Feb 2020 14:19:58 +0300 Subject: [PATCH 314/970] Add tuition management permission to role management --- config/initializers/role_management.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/initializers/role_management.rb b/config/initializers/role_management.rb index b6960c680..2fdb3ead2 100644 --- a/config/initializers/role_management.rb +++ b/config/initializers/role_management.rb @@ -102,6 +102,11 @@ class RoleManagement name: 'YÖKSİS Yönetimi', description: 'YÖKSİS Yönetim Yetkisi', privileges: %i[read write destroy] + permission :tuition_management, + name: 'Harç Yönetimi', + description: 'Harç Yönetim Yetkisi', + privileges: %i[read write destroy] + # roles role :authorization_manager, name: 'Yetkilendirme Yöneticisi', @@ -134,7 +139,8 @@ class RoleManagement student_management: %i[read write destroy report], unit_management: %i[read write destroy report], user_management: %i[read write destroy report], - yoksis_management: %i[read write destroy] + yoksis_management: %i[read write destroy], + tuition_management: %i[read write destroy] } role :manager, name: 'Yönetici', permissions: {} end From e88eea1d61105a38244bacbd914026b7552b5dd0 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 25 Feb 2020 14:20:51 +0300 Subject: [PATCH 315/970] Reach to tuition management from sidebar --- app/views/layouts/shared/menus/_admin.html.erb | 16 ++++++++++++++++ config/locales/layouts/shared/sidebar.en.yml | 2 ++ config/locales/layouts/shared/sidebar.tr.yml | 2 ++ 3 files changed, 20 insertions(+) diff --git a/app/views/layouts/shared/menus/_admin.html.erb b/app/views/layouts/shared/menus/_admin.html.erb index 96aae7a26..2da713f5b 100644 --- a/app/views/layouts/shared/menus/_admin.html.erb +++ b/app/views/layouts/shared/menus/_admin.html.erb @@ -44,6 +44,22 @@ <% end %> + + +
<% student = enrollment.student %> @@ -48,7 +48,7 @@ - + <% end %> <% end %> From 3c0a8f65e4865f1a6e739e2d61c45d3010fa39c7 Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 25 Feb 2020 15:43:25 +0300 Subject: [PATCH 321/970] Use ids instead of map --- app/models/course_assessment_method.rb | 4 ++-- app/views/instructiveness/assessments/edit.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/course_assessment_method.rb b/app/models/course_assessment_method.rb index d315a9c51..f82ed7bc0 100644 --- a/app/models/course_assessment_method.rb +++ b/app/models/course_assessment_method.rb @@ -32,7 +32,7 @@ def build_grades_for(enrollments) end def fully_graded? - enrollments_ids = available_course.saved_enrollments.map(&:id) - grades.where.not(point: nil).where(course_enrollment_id: enrollments_ids).count == enrollments_ids.count + enrollment_ids = available_course.saved_enrollments.ids + grades.where.not(point: nil).where(course_enrollment_id: enrollment_ids).count == enrollment_ids.count end end diff --git a/app/views/instructiveness/assessments/edit.html.erb b/app/views/instructiveness/assessments/edit.html.erb index 3acf848c0..c7d682e46 100644 --- a/app/views/instructiveness/assessments/edit.html.erb +++ b/app/views/instructiveness/assessments/edit.html.erb @@ -38,7 +38,7 @@ <% end %> <%= f.simple_fields_for :grades do |grade| %> - <% if @enrollments.map(&:id).include?(grade.object.course_enrollment_id) %> + <% if @enrollments.ids.include?(grade.object.course_enrollment_id) %> <% enrollment = grade.object.course_enrollment %> <%= grade.input(:course_enrollment_id, as: :hidden, wrapper: false, input_html: { value: enrollment.id }) %> From a4f256f2dff4250384d99b77f40b1c6a8a979e3b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2020 16:08:28 +0000 Subject: [PATCH 322/970] chore(deps): bump nokogiri in /plugins/tenant/common Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.5 to 1.10.8. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.5...v1.10.8) Signed-off-by: dependabot[bot] --- plugins/tenant/common/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tenant/common/Gemfile.lock b/plugins/tenant/common/Gemfile.lock index 216f73fb3..7cffc823c 100644 --- a/plugins/tenant/common/Gemfile.lock +++ b/plugins/tenant/common/Gemfile.lock @@ -91,7 +91,7 @@ GEM minitest-focus (1.1.2) minitest (>= 4, < 6) nio4r (2.5.2) - nokogiri (1.10.5) + nokogiri (1.10.8) mini_portile2 (~> 2.4.0) rack (2.0.8) rack-test (1.1.0) From ce332c2fde83a929bfc02a20016a2edcd42e9e2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2020 16:08:28 +0000 Subject: [PATCH 323/970] chore(deps): bump nokogiri from 1.10.5 to 1.10.8 in /plugins/support Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.5 to 1.10.8. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.5...v1.10.8) Signed-off-by: dependabot[bot] --- plugins/support/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/support/Gemfile.lock b/plugins/support/Gemfile.lock index 6b51814c1..cdf0d999e 100644 --- a/plugins/support/Gemfile.lock +++ b/plugins/support/Gemfile.lock @@ -85,7 +85,7 @@ GEM minitest-focus (1.1.2) minitest (>= 4, < 6) nio4r (2.5.2) - nokogiri (1.10.5) + nokogiri (1.10.8) mini_portile2 (~> 2.4.0) rack (2.0.8) rack-test (1.1.0) From 8b18953e64452e47541c71b93992524b81b2781e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2020 16:08:31 +0000 Subject: [PATCH 324/970] chore(deps): bump nokogiri from 1.10.5 to 1.10.8 in /plugins/tenant/omu Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.5 to 1.10.8. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.5...v1.10.8) Signed-off-by: dependabot[bot] --- plugins/tenant/omu/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tenant/omu/Gemfile.lock b/plugins/tenant/omu/Gemfile.lock index 37d72eac8..f5ffe93af 100644 --- a/plugins/tenant/omu/Gemfile.lock +++ b/plugins/tenant/omu/Gemfile.lock @@ -98,7 +98,7 @@ GEM minitest-focus (1.1.2) minitest (>= 4, < 6) nio4r (2.5.2) - nokogiri (1.10.5) + nokogiri (1.10.8) mini_portile2 (~> 2.4.0) rack (2.0.8) rack-test (1.1.0) From 23176a7070530850a9d06de5a28c6ddc4a88ac39 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 25 Feb 2020 20:10:29 +0300 Subject: [PATCH 325/970] Add pagination nav --- app/views/tuition_management/tuitions/index.html.erb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/views/tuition_management/tuitions/index.html.erb b/app/views/tuition_management/tuitions/index.html.erb index b5122f9af..2a00b9483 100644 --- a/app/views/tuition_management/tuitions/index.html.erb +++ b/app/views/tuition_management/tuitions/index.html.erb @@ -33,5 +33,10 @@
<%= full_name(student.user.identities.formal.first) %> <%= "#{student.year}/#{student.semester}" %> <%= enrollment.available_course_group.name %><%= grade.input(:point, label: false) %><%= grade.input(:point, label: false, wrapper: false) %>
+ From 607f074563886039c22529d8874b15008eb63388 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 25 Feb 2020 20:12:37 +0300 Subject: [PATCH 326/970] Search with unit to tuitions --- .../tuition_management/tuitions_controller.rb | 3 ++- app/views/tuition_management/tuitions/_search.html.erb | 10 +++++++++- .../controllers/tuition_management/tuitions.en.yml | 1 + .../controllers/tuition_management/tuitions.tr.yml | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/controllers/tuition_management/tuitions_controller.rb b/app/controllers/tuition_management/tuitions_controller.rb index c9ec10c6a..6b1ae98ec 100644 --- a/app/controllers/tuition_management/tuitions_controller.rb +++ b/app/controllers/tuition_management/tuitions_controller.rb @@ -8,7 +8,8 @@ class TuitionsController < ApplicationController before_action :authorized? def index - tuitions = Tuition.includes(:units, :unit_tuitions, :academic_term) + tuitions = Unit.find_by(id: params[:unit_id])&.tuitions&.includes(:units, :unit_tuitions, :academic_term) || + Tuition.includes(:units, :unit_tuitions, :academic_term) @pagy, @tuitions = pagy(tuitions.dynamic_search(search_params(Tuition))) end diff --git a/app/views/tuition_management/tuitions/_search.html.erb b/app/views/tuition_management/tuitions/_search.html.erb index dac1843d0..f38fb0d05 100644 --- a/app/views/tuition_management/tuitions/_search.html.erb +++ b/app/views/tuition_management/tuitions/_search.html.erb @@ -23,7 +23,15 @@
<%= form_tag tuitions_path, method: :get do %>
-
+
+ <%= label_tag(:unit_id, t('.unit')) %> + <%= select_tag(:unit_id, + options_from_collection_for_select(Unit.active.programs.order(:name), :id, :names_depth_cache, params[:unit_id]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %> +
+
<%= label_tag(:academic_term_id, t('.academic_term')) %> <%= select_tag(:academic_term_id, options_from_collection_for_select(AcademicTerm.all, :id, lambda { |term| full_name(term) }, params[:academic_term_id]), diff --git a/config/locales/controllers/tuition_management/tuitions.en.yml b/config/locales/controllers/tuition_management/tuitions.en.yml index 61b317cd5..a13cb98bc 100644 --- a/config/locales/controllers/tuition_management/tuitions.en.yml +++ b/config/locales/controllers/tuition_management/tuitions.en.yml @@ -21,5 +21,6 @@ en: new_tuition_link: Add New Tuition search: academic_term: Academic Term + unit: Birimler update: success: Tuitions successfully updated. diff --git a/config/locales/controllers/tuition_management/tuitions.tr.yml b/config/locales/controllers/tuition_management/tuitions.tr.yml index ceb1ab71a..64751cd57 100644 --- a/config/locales/controllers/tuition_management/tuitions.tr.yml +++ b/config/locales/controllers/tuition_management/tuitions.tr.yml @@ -21,6 +21,7 @@ tr: new_tuition_link: Yeni Harç Ekle search: academic_term: Akademik Dönem + unit: Birimler update: success: Harçlar başarıyla güncellendi. From a5f8043d7836e0d94dc649c9c354a52a7769b51c Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 25 Feb 2020 20:22:59 +0300 Subject: [PATCH 327/970] Add method policy for units --- app/policies/tuition_management/tuition_policy.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/policies/tuition_management/tuition_policy.rb b/app/policies/tuition_management/tuition_policy.rb index bb438e670..3e13ec772 100644 --- a/app/policies/tuition_management/tuition_policy.rb +++ b/app/policies/tuition_management/tuition_policy.rb @@ -6,6 +6,10 @@ class TuitionPolicy < ApplicationPolicy undef :show? + def units? + permitted? :read + end + private def permitted?(*privileges) From 21094de5b7c25c3f7f709149adcc41bbba481690 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 25 Feb 2020 20:30:34 +0300 Subject: [PATCH 328/970] Use select2 for unit field --- app/views/tuition_management/tuitions/_search.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/tuition_management/tuitions/_search.html.erb b/app/views/tuition_management/tuitions/_search.html.erb index f38fb0d05..273de284c 100644 --- a/app/views/tuition_management/tuitions/_search.html.erb +++ b/app/views/tuition_management/tuitions/_search.html.erb @@ -54,5 +54,6 @@ From 5889e49684b4526d6fb6b6954cb6cd34d9f4b3e9 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 25 Feb 2020 20:40:55 +0300 Subject: [PATCH 329/970] Create partial for js part --- .../tuitions/_form.html.erb | 21 +------------------ .../tuitions/_select2.html.erb | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 20 deletions(-) create mode 100644 app/views/tuition_management/tuitions/_select2.html.erb diff --git a/app/views/tuition_management/tuitions/_form.html.erb b/app/views/tuition_management/tuitions/_form.html.erb index 162965ff2..d0ccadf79 100644 --- a/app/views/tuition_management/tuitions/_form.html.erb +++ b/app/views/tuition_management/tuitions/_form.html.erb @@ -37,23 +37,4 @@
- +<%= render 'select2' %> diff --git a/app/views/tuition_management/tuitions/_select2.html.erb b/app/views/tuition_management/tuitions/_select2.html.erb new file mode 100644 index 000000000..b133fae44 --- /dev/null +++ b/app/views/tuition_management/tuitions/_select2.html.erb @@ -0,0 +1,21 @@ + From 701a99f7f0af6fc1e85f18375f49174a5ee7888d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beg=C3=BCm=20Topy=C4=B1ld=C4=B1z?= Date: Wed, 26 Feb 2020 11:03:16 +0300 Subject: [PATCH 330/970] Update config/locales/controllers/instructiveness/assessments.en.yml --- config/locales/controllers/instructiveness/assessments.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/controllers/instructiveness/assessments.en.yml b/config/locales/controllers/instructiveness/assessments.en.yml index 8c8e2db00..a4522b456 100644 --- a/config/locales/controllers/instructiveness/assessments.en.yml +++ b/config/locales/controllers/instructiveness/assessments.en.yml @@ -2,7 +2,7 @@ en: activerecord: attributes: grade: - point: Puan + point: Point grades: point: Puan enums: From ef307507bdf7f7de06af1f894627336abf300aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beg=C3=BCm=20Topy=C4=B1ld=C4=B1z?= Date: Wed, 26 Feb 2020 11:03:23 +0300 Subject: [PATCH 331/970] Update config/locales/controllers/instructiveness/assessments.en.yml --- config/locales/controllers/instructiveness/assessments.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/controllers/instructiveness/assessments.en.yml b/config/locales/controllers/instructiveness/assessments.en.yml index a4522b456..a2785c3f0 100644 --- a/config/locales/controllers/instructiveness/assessments.en.yml +++ b/config/locales/controllers/instructiveness/assessments.en.yml @@ -4,7 +4,7 @@ en: grade: point: Point grades: - point: Puan + point: Point enums: course_assessment_method: statuses: From e7477d236df26f4f0d62dfbe7a255fff90d2aa19 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 26 Feb 2020 13:17:27 +0300 Subject: [PATCH 332/970] Change form title message --- app/views/tuition_management/tuitions/_form.html.erb | 2 +- app/views/tuition_management/tuitions/edit.html.erb | 2 +- app/views/tuition_management/tuitions/new.html.erb | 2 +- .../locales/controllers/tuition_management/tuitions.en.yml | 6 ++++-- .../locales/controllers/tuition_management/tuitions.tr.yml | 6 ++++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/views/tuition_management/tuitions/_form.html.erb b/app/views/tuition_management/tuitions/_form.html.erb index d0ccadf79..f4bf9a41e 100644 --- a/app/views/tuition_management/tuitions/_form.html.erb +++ b/app/views/tuition_management/tuitions/_form.html.erb @@ -3,7 +3,7 @@
<%= fa_icon 'money' %> - <%= t('.form_title') %> + <%= form_title %>
<%= simple_form_for(tuition) do |f| %> diff --git a/app/views/tuition_management/tuitions/edit.html.erb b/app/views/tuition_management/tuitions/edit.html.erb index a82707881..863f9da4e 100644 --- a/app/views/tuition_management/tuitions/edit.html.erb +++ b/app/views/tuition_management/tuitions/edit.html.erb @@ -1 +1 @@ -<%= render 'form', tuition: @tuition %> +<%= render 'form', tuition: @tuition, form_title: t('.form_title') %> diff --git a/app/views/tuition_management/tuitions/new.html.erb b/app/views/tuition_management/tuitions/new.html.erb index a82707881..863f9da4e 100644 --- a/app/views/tuition_management/tuitions/new.html.erb +++ b/app/views/tuition_management/tuitions/new.html.erb @@ -1 +1 @@ -<%= render 'form', tuition: @tuition %> +<%= render 'form', tuition: @tuition, form_title: t('.form_title') %> diff --git a/config/locales/controllers/tuition_management/tuitions.en.yml b/config/locales/controllers/tuition_management/tuitions.en.yml index a13cb98bc..569e4ecd5 100644 --- a/config/locales/controllers/tuition_management/tuitions.en.yml +++ b/config/locales/controllers/tuition_management/tuitions.en.yml @@ -13,12 +13,14 @@ en: destroy: success: Tuitions successfully deleted. warning: Tuitions can not be deleted! - form: - form_title: Add Tuition to Units + edit: + form_title: Update Tuition Information of Units index: <<: *tuition_attributes card_header: Unit Tuition Fees new_tuition_link: Add New Tuition + new: + form_title: Add Tuition to Units search: academic_term: Academic Term unit: Birimler diff --git a/config/locales/controllers/tuition_management/tuitions.tr.yml b/config/locales/controllers/tuition_management/tuitions.tr.yml index 64751cd57..0f1082c35 100644 --- a/config/locales/controllers/tuition_management/tuitions.tr.yml +++ b/config/locales/controllers/tuition_management/tuitions.tr.yml @@ -13,12 +13,14 @@ tr: destroy: success: Harçlar başarıyla silindi. warning: Harçlar silinemedi! - form: - form_title: Birimlere Harç Ekle + edit: + form_title: Birimlerin Harç Bilgilerini Düzenle index: <<: *tuition_attributes card_header: Birim Harç Ücretleri new_tuition_link: Yeni Harç Ekle + new: + form_title: Birimlere Harç Ekle search: academic_term: Akademik Dönem unit: Birimler From a331f42b99e8b87c6d32b0ba9bb77a2d50bda64d Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 26 Feb 2020 13:20:44 +0300 Subject: [PATCH 333/970] Add role permission sample for tuition management --- test/fixtures/patron/permissions.yml | 5 ++++- test/fixtures/patron/role_permissions.yml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/fixtures/patron/permissions.yml b/test/fixtures/patron/permissions.yml index 65e7bd3ca..779109fb8 100644 --- a/test/fixtures/patron/permissions.yml +++ b/test/fixtures/patron/permissions.yml @@ -97,4 +97,7 @@ registration_management_for_employees: employee_management: name: Personel Yönetimi identifier: employee_management - description: Personel Yönetim Yetkisi +tuition_management: + name: Harç Yönetimi + identifier: tuition_management + description: Harç Yönetim Yetkisi diff --git a/test/fixtures/patron/role_permissions.yml b/test/fixtures/patron/role_permissions.yml index cb8bb045a..6913c5cf0 100644 --- a/test/fixtures/patron/role_permissions.yml +++ b/test/fixtures/patron/role_permissions.yml @@ -94,4 +94,7 @@ twenty_four: role: admin permission: employee_management privileges: <%= Patron::RolePermission.privileges.to_i([:read, :write, :destroy, :report]) %> - +twenty_five: + role: admin + permission: tuition_management + privileges: <%= Patron::RolePermission.privileges.to_i([:read, :write, :destroy]) %> From d73ff5330174a63e871810948bfa6311dcb325f0 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 26 Feb 2020 13:22:17 +0300 Subject: [PATCH 334/970] Create tuition policy test --- .../tuition_management/tuition_policy_test.rb | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/policies/tuition_management/tuition_policy_test.rb diff --git a/test/policies/tuition_management/tuition_policy_test.rb b/test/policies/tuition_management/tuition_policy_test.rb new file mode 100644 index 000000000..96428dd10 --- /dev/null +++ b/test/policies/tuition_management/tuition_policy_test.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'pundit_test_case' + +module TuitionManagement + class TuitionPolicyTest < PunditTestCase + %w[ + create? + destroy? + edit? + index? + new? + update? + ].each do |method| + test method do + assert_permit users(:serhat) + assert_not_permit users(:mine) + end + end + end +end From ed8d245919fc19485405e5c93ef5d87612bdffc3 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 26 Feb 2020 13:56:20 +0300 Subject: [PATCH 335/970] Create tuition controller test --- .../tuitions_controller_test.rb | 84 +++++++++++++++++++ test/fixtures/tuitions.yml | 5 ++ test/fixtures/unit_tuitions.yml | 4 + 3 files changed, 93 insertions(+) create mode 100644 test/controllers/tuition_management/tuitions_controller_test.rb diff --git a/test/controllers/tuition_management/tuitions_controller_test.rb b/test/controllers/tuition_management/tuitions_controller_test.rb new file mode 100644 index 000000000..da661c858 --- /dev/null +++ b/test/controllers/tuition_management/tuitions_controller_test.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +require 'test_helper' + +module TuitionManagement + class TuitionsControllerTest < ActionDispatch::IntegrationTest + setup do + sign_in users(:serhat) + @tuition = tuitions(:one) + end + + test 'should get index' do + get tuitions_path + assert_response :success + assert_select '#add-button', translate('.index.new_tuition_link') + assert_select '#collapseSearchLink', t('search') + end + + test 'should get new' do + get new_tuition_path + assert_response :success + end + + test 'should create tuition' do + assert_difference('Tuition.count') do + post tuitions_path, params: { + tuition: { + unit_ids: [units(:bilgisayar_muhendisligi_programi).id], + academic_term_id: academic_terms(:spring_2017_2018).id, + fee: 350, + foreign_student_fee: 2500 + } + } + end + + assert_equal 'create', @controller.action_name + + tuition = Tuition.last + assert_equal units(:bilgisayar_muhendisligi_programi).name, tuition.units.map(&:name).join(', ') + assert_equal academic_terms(:spring_2017_2018), tuition.academic_term + assert_equal 350, tuition.fee + assert_equal 2500, tuition.foreign_student_fee + + assert_redirected_to :tuitions + assert_equal translate('.create.success'), flash[:notice] + end + + test 'should get edit' do + get edit_tuition_path(@tuition) + assert_equal 'edit', @controller.action_name + assert_response :success + assert_select '.card-header strong', translate('.edit.form_title') + end + + test 'should update tuition' do + tuition = Tuition.last + patch tuition_path(tuition), + params: { + tuition: { fee: 800 } + } + + tuition.reload + + assert_equal 800, tuition.fee + assert_redirected_to tuitions_path + assert_equal translate('.update.success'), flash[:notice] + end + + test 'should destroy tuition' do + assert_difference('Tuition.count', -1) do + delete tuition_path(tuitions(:tuition_to_delete)) + end + + assert_redirected_to tuitions_path + assert_equal translate('.destroy.success'), flash[:notice] + end + + private + + def translate(key) + t("tuition_management.tuitions#{key}") + end + end +end diff --git a/test/fixtures/tuitions.yml b/test/fixtures/tuitions.yml index eb75fee10..e2f3c8bb5 100644 --- a/test/fixtures/tuitions.yml +++ b/test/fixtures/tuitions.yml @@ -7,3 +7,8 @@ two: academic_term: spring_2018_2019 fee: 305,00 foreign_student_fee: 2.180,00 + +tuition_to_delete: + academic_term: spring_2018_2019 + fee: 275,00 + foreign_student_fee: 1.250,00 diff --git a/test/fixtures/unit_tuitions.yml b/test/fixtures/unit_tuitions.yml index 6bd731804..5bdb1c6d8 100644 --- a/test/fixtures/unit_tuitions.yml +++ b/test/fixtures/unit_tuitions.yml @@ -5,3 +5,7 @@ one: two: unit: bilgisayar_muhendisligi_programi tuition: two + +unit_tuition_to_delete: + unit: fen_bilgisi_ogretmenligi_programi + tuition: tuition_to_delete From 5e5d76dd81b81592297a986152d899a22b89fdd8 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 10:20:42 +0300 Subject: [PATCH 336/970] Add coordinatorships relation to employee --- app/controllers/instructiveness/assessments_controller.rb | 2 +- app/models/employee.rb | 2 ++ app/views/instructiveness/assessments/show.html.erb | 2 +- test/models/employee_test.rb | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/instructiveness/assessments_controller.rb b/app/controllers/instructiveness/assessments_controller.rb index 1b1b647f4..4459a16a1 100644 --- a/app/controllers/instructiveness/assessments_controller.rb +++ b/app/controllers/instructiveness/assessments_controller.rb @@ -65,7 +65,7 @@ def check_status end def check_coordinator - redirect_with('.errors.not_coordinator') unless @employee.coordinator_of?(@course) + redirect_with('.errors.not_coordinator') unless @employee.coordinatorships.include?(@course) end def assessment_params diff --git a/app/models/employee.rb b/app/models/employee.rb index 439c3b105..cdf68e592 100644 --- a/app/models/employee.rb +++ b/app/models/employee.rb @@ -13,6 +13,8 @@ class Employee < ApplicationRecord has_many :positions, through: :duties has_many :administrative_functions, through: :duties has_many :available_course_lecturers, foreign_key: :lecturer_id, inverse_of: :lecturer, dependent: :destroy + has_many :coordinatorships, class_name: 'AvailableCourse', foreign_key: :coordinator_id, + inverse_of: :coordinator, dependent: :destroy # validations validates :active, inclusion: { in: [true, false] } diff --git a/app/views/instructiveness/assessments/show.html.erb b/app/views/instructiveness/assessments/show.html.erb index 8b8117099..908c75daa 100644 --- a/app/views/instructiveness/assessments/show.html.erb +++ b/app/views/instructiveness/assessments/show.html.erb @@ -9,7 +9,7 @@ <%= fa_icon 'users' %><%= t('.students', course_name: @course.name) %>
- <% if @employee.coordinator_of?(@course) %> + <% if @employee.coordinatorships.include?(@course) %> <%= link_to(t('.draft'), draft_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.saved? %> <%= link_to(t('.save'), save_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.draft? && @assessment.fully_graded? %> <% end %> diff --git a/test/models/employee_test.rb b/test/models/employee_test.rb index f7d69d719..d75f2252b 100644 --- a/test/models/employee_test.rb +++ b/test/models/employee_test.rb @@ -11,6 +11,8 @@ class EmployeeTest < ActiveSupport::TestCase belongs_to :user has_many :administrative_functions, through: :duties has_many :available_course_lecturers, foreign_key: :lecturer_id, inverse_of: :lecturer, dependent: :destroy + has_many :coordinatorships, class_name: 'AvailableCourse', foreign_key: :coordinator_id, + inverse_of: :coordinator, dependent: :destroy has_many :duties, dependent: :destroy has_many :units, through: :duties has_many :positions, through: :duties From 096ee2abe3fadf08e80816e75925a332e4de475c Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 10:22:20 +0300 Subject: [PATCH 337/970] Remove unneeded custom method --- app/models/employee.rb | 4 ---- test/models/employee_test.rb | 6 ------ 2 files changed, 10 deletions(-) diff --git a/app/models/employee.rb b/app/models/employee.rb index cdf68e592..64c514e11 100644 --- a/app/models/employee.rb +++ b/app/models/employee.rb @@ -42,8 +42,4 @@ def given_courses AvailableCourse.joins(groups: :lecturers) .where('coordinator_id = ? OR lecturer_id = ?', id, id) end - - def coordinator_of?(available_course) - id == available_course.coordinator_id - end end diff --git a/test/models/employee_test.rb b/test/models/employee_test.rb index d75f2252b..3abf138b6 100644 --- a/test/models/employee_test.rb +++ b/test/models/employee_test.rb @@ -73,10 +73,4 @@ class EmployeeTest < ActiveSupport::TestCase assert_includes given_courses, available_courses(:elective_course_2) assert_not_includes given_courses, available_courses(:compulsory_course_2) end - - test 'coordinator_of? course method' do - course = available_courses(:elective_course) - assert employees(:vice_rector).coordinator_of?(course) - assert_not employees(:serhat_active).coordinator_of?(course) - end end From 5f83500bcdf5ef754ab8eafd1c28c86fc6158212 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 10:30:31 +0300 Subject: [PATCH 338/970] Add delegation to reach academic term --- app/models/course_enrollment.rb | 2 +- app/models/grade.rb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/course_enrollment.rb b/app/models/course_enrollment.rb index 2cf1cd0a4..5561b8ca6 100644 --- a/app/models/course_enrollment.rb +++ b/app/models/course_enrollment.rb @@ -15,7 +15,7 @@ class CourseEnrollment < ApplicationRecord # delegates delegate :ects, to: :available_course - delegate :student, to: :semester_registration + delegate :student, :academic_term, to: :semester_registration # custom methods def grade_of(assessment) diff --git a/app/models/grade.rb b/app/models/grade.rb index b4fd2b209..df1c39d40 100644 --- a/app/models/grade.rb +++ b/app/models/grade.rb @@ -13,4 +13,7 @@ class Grade < ApplicationRecord less_than_or_equal_to: 100 } validates :course_enrollment, uniqueness: { scope: :course_assessment_method_id } + + # delegates + delegate :student, :academic_term, to: :course_enrollment end From a59edbd1fc6c3abe34ffb46f54412556c5f3863a Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 11:11:55 +0300 Subject: [PATCH 339/970] Move enrollments under authoriy check to controller --- .../instructiveness/assessments_controller.rb | 8 +++++-- .../instructiveness/assessments/edit.html.erb | 24 +++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/app/controllers/instructiveness/assessments_controller.rb b/app/controllers/instructiveness/assessments_controller.rb index 4459a16a1..a403bb63a 100644 --- a/app/controllers/instructiveness/assessments_controller.rb +++ b/app/controllers/instructiveness/assessments_controller.rb @@ -15,12 +15,16 @@ def show def edit @enrollments = @course.enrollments_under_authority_of(@employee) - @assessment.build_grades_for(@enrollments.where.not(id: @assessment.grades.map(&:course_enrollment_id))) + @grades = @assessment.grades_under_authority_of(@employee) + + @assessment.build_grades_for(@enrollments.where.not(id: @assessment.grades.map(&:course_enrollment_id))) end def update + return redirect_with('success') if @assessment.update(assessment_params) + @enrollments = @course.enrollments_under_authority_of(@employee) - @assessment.update(assessment_params) ? redirect_with('success') : render(:edit) + @grades = @assessment.grades.select { |grade| @enrollments.ids.include?(grade.course_enrollment_id) } + render(:edit) end def save diff --git a/app/views/instructiveness/assessments/edit.html.erb b/app/views/instructiveness/assessments/edit.html.erb index c7d682e46..beb488ad6 100644 --- a/app/views/instructiveness/assessments/edit.html.erb +++ b/app/views/instructiveness/assessments/edit.html.erb @@ -37,20 +37,18 @@ <% end %> <% end %> - <%= f.simple_fields_for :grades do |grade| %> - <% if @enrollments.ids.include?(grade.object.course_enrollment_id) %> - <% enrollment = grade.object.course_enrollment %> - <%= grade.input(:course_enrollment_id, as: :hidden, wrapper: false, input_html: { value: enrollment.id }) %> + <%= f.simple_fields_for :grades, @grades do |grade| %> + <% enrollment = grade.object.course_enrollment %> + <%= grade.input(:course_enrollment_id, as: :hidden, wrapper: false, input_html: { value: enrollment.id }) %> - - <% student = enrollment.student %> - <%= student.student_number %> - <%= full_name(student.user.identities.formal.first) %> - <%= "#{student.year}/#{student.semester}" %> - <%= enrollment.available_course_group.name %> - <%= grade.input(:point, label: false, wrapper: false) %> - - <% end %> + + <% student = enrollment.student %> + <%= student.student_number %> + <%= full_name(student.user.identities.formal.first) %> + <%= "#{student.year}/#{student.semester}" %> + <%= enrollment.available_course_group.name %> + <%= grade.input(:point, label: false, wrapper: false) %> + <% end %> <% end %> From 71eb472cb8de510b0113d18ad9ec70d4ba4d87d1 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 11:56:59 +0300 Subject: [PATCH 340/970] Fix redirects from save & draft methods --- .../instructiveness/assessments_controller.rb | 10 ++++------ .../controllers/instructiveness/assessments.en.yml | 2 ++ .../controllers/instructiveness/assessments.tr.yml | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/instructiveness/assessments_controller.rb b/app/controllers/instructiveness/assessments_controller.rb index a403bb63a..b1c814192 100644 --- a/app/controllers/instructiveness/assessments_controller.rb +++ b/app/controllers/instructiveness/assessments_controller.rb @@ -28,18 +28,16 @@ def update end def save - return redirect_with('error') unless @assessment.draft? + return redirect_with('not_draft_error') unless @assessment.draft? return redirect_with('not_full_graded_error') unless @assessment.fully_graded? - @assessment.update(status: :saved) - redirect_with('success') + @assessment.update(status: :saved) ? redirect_with('success') : redirect_with('error') end def draft - return redirect_with('error') unless @assessment.saved? + return redirect_with('not_saved_error') unless @assessment.saved? - @assessment.update(status: :draft) - redirect_with('success') + @assessment.update(status: :draft) ? redirect_with('success') : redirect_with('error') end private diff --git a/config/locales/controllers/instructiveness/assessments.en.yml b/config/locales/controllers/instructiveness/assessments.en.yml index a2785c3f0..8a35469ca 100644 --- a/config/locales/controllers/instructiveness/assessments.en.yml +++ b/config/locales/controllers/instructiveness/assessments.en.yml @@ -21,6 +21,7 @@ en: status: Status draft: error: Assessment could not be drafted. + not_saved_error: Assessment is not in saved status, could not be drafted. success: Assessment successfully drafted. edit: group_name: Group Name @@ -30,6 +31,7 @@ en: year_and_semester: Year/Semester save: error: Assessment could not be saved permanently. + not_draft_error: Assessment is not in draft status, could not be saved permanently. not_full_graded_error: Assessment could not be saved permanently, there are enrollments with no grade entries. success: Assessment saved permanently. show: diff --git a/config/locales/controllers/instructiveness/assessments.tr.yml b/config/locales/controllers/instructiveness/assessments.tr.yml index 3ab3171bc..c3bd10931 100644 --- a/config/locales/controllers/instructiveness/assessments.tr.yml +++ b/config/locales/controllers/instructiveness/assessments.tr.yml @@ -21,6 +21,7 @@ tr: status: Durum draft: error: Notlandırma taslak durumuna alınamadı. + not_saved_error: Notlandırma kalıcı olarak kaydedilemedi, kaydedilmiş durumda değil. success: Notlandırma taslak durumuna alındı. edit: group_name: Grup Adı @@ -30,6 +31,7 @@ tr: year_and_semester: Sınıfı/Yarıyılı save: error: Notlandırma kalıcı olarak kaydedilemedi. + not_draft_error: Notlandırma kalıcı olarak kaydedilemedi, taslak durumunda değil. not_full_graded_error: Notlandırma kalıcı olarak kaydedilemedi, not girişi yapılmamış kayıtlanmalar bulunmaktadır. success: Notlandırma başarıyla kalıcı olarak kaydedildi. show: From 006429a7973c83bc89d42002891b8781411d0fbc Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 12:36:05 +0300 Subject: [PATCH 341/970] Add saved enrollments relation --- app/models/course_assessment_method.rb | 1 + app/models/course_evaluation_type.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/models/course_assessment_method.rb b/app/models/course_assessment_method.rb index f82ed7bc0..5b626f255 100644 --- a/app/models/course_assessment_method.rb +++ b/app/models/course_assessment_method.rb @@ -8,6 +8,7 @@ class CourseAssessmentMethod < ApplicationRecord belongs_to :assessment_method belongs_to :course_evaluation_type has_many :grades, dependent: :destroy + has_many :saved_enrollments, through: :course_evaluation_type accepts_nested_attributes_for :grades # validations diff --git a/app/models/course_evaluation_type.rb b/app/models/course_evaluation_type.rb index 3a0690424..d861a1e69 100644 --- a/app/models/course_evaluation_type.rb +++ b/app/models/course_evaluation_type.rb @@ -6,6 +6,7 @@ class CourseEvaluationType < ApplicationRecord belongs_to :evaluation_type has_many :course_assessment_methods, dependent: :destroy has_many :assessment_methods, through: :course_assessment_methods + has_many :saved_enrollments, through: :available_course accepts_nested_attributes_for :course_assessment_methods, allow_destroy: true, reject_if: :all_blank # validations From 602d3b49034c47deef9a0578af22e405644790be Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 12:37:09 +0300 Subject: [PATCH 342/970] Update fully_graded? method --- app/models/course_assessment_method.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/course_assessment_method.rb b/app/models/course_assessment_method.rb index 5b626f255..9a5f77327 100644 --- a/app/models/course_assessment_method.rb +++ b/app/models/course_assessment_method.rb @@ -33,7 +33,8 @@ def build_grades_for(enrollments) end def fully_graded? - enrollment_ids = available_course.saved_enrollments.ids - grades.where.not(point: nil).where(course_enrollment_id: enrollment_ids).count == enrollment_ids.count + return false if saved_enrollments.empty? + + grades.where.not(point: nil).where(course_enrollment_id: saved_enrollments.ids).count == saved_enrollments.ids.count end end From a264230ef64e0f70e9ce89a316c91c76a5105d26 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 12:40:34 +0300 Subject: [PATCH 343/970] Check if any enrollments for edit & update actions --- app/controllers/instructiveness/assessments_controller.rb | 5 +++++ app/views/instructiveness/assessments/show.html.erb | 2 +- .../locales/controllers/instructiveness/assessments.en.yml | 4 ++++ .../locales/controllers/instructiveness/assessments.tr.yml | 4 ++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/controllers/instructiveness/assessments_controller.rb b/app/controllers/instructiveness/assessments_controller.rb index b1c814192..500fff288 100644 --- a/app/controllers/instructiveness/assessments_controller.rb +++ b/app/controllers/instructiveness/assessments_controller.rb @@ -7,6 +7,7 @@ class AssessmentsController < ApplicationController before_action :set_assessment before_action :authorized? before_action :check_status, only: %i[edit update] + before_action :check_any_enrollments, only: %i[edit update] before_action :check_coordinator, only: %i[save draft] def show @@ -66,6 +67,10 @@ def check_status redirect_with('.errors.saved') if @assessment.saved? end + def check_any_enrollments + redirect_with('errors.no_enrollments') if @assessment.saved_enrollments.empty? + end + def check_coordinator redirect_with('.errors.not_coordinator') unless @employee.coordinatorships.include?(@course) end diff --git a/app/views/instructiveness/assessments/show.html.erb b/app/views/instructiveness/assessments/show.html.erb index 908c75daa..c500a95d1 100644 --- a/app/views/instructiveness/assessments/show.html.erb +++ b/app/views/instructiveness/assessments/show.html.erb @@ -13,7 +13,7 @@ <%= link_to(t('.draft'), draft_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.saved? %> <%= link_to(t('.save'), save_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.draft? && @assessment.fully_graded? %> <% end %> - <%= link_to(t('action_group.edit'), edit_given_course_assessment_path(@course, @assessment), class: 'btn btn-outline-success btn-sm') unless @assessment.saved? %> + <%= link_to(t('action_group.edit'), edit_given_course_assessment_path(@course, @assessment), class: 'btn btn-outline-success btn-sm') unless @assessment.saved? || @assessment.saved_enrollments.empty? %>
diff --git a/config/locales/controllers/instructiveness/assessments.en.yml b/config/locales/controllers/instructiveness/assessments.en.yml index 8a35469ca..d10792663 100644 --- a/config/locales/controllers/instructiveness/assessments.en.yml +++ b/config/locales/controllers/instructiveness/assessments.en.yml @@ -29,6 +29,10 @@ en: students: 'Students Enrolled in %{course_name} Course' student_number: Student Number year_and_semester: Year/Semester + errors: + no_enrollments: There are no students enrolled in the course. + not_coordinator: The process can only be carried out by the course coordinator. + saved: Assessment was saved permanently, updating cannot be done. save: error: Assessment could not be saved permanently. not_draft_error: Assessment is not in draft status, could not be saved permanently. diff --git a/config/locales/controllers/instructiveness/assessments.tr.yml b/config/locales/controllers/instructiveness/assessments.tr.yml index c3bd10931..0dbb741e8 100644 --- a/config/locales/controllers/instructiveness/assessments.tr.yml +++ b/config/locales/controllers/instructiveness/assessments.tr.yml @@ -29,6 +29,10 @@ tr: students: '%{course_name} Dersine Kayıtlanan Öğrenciler' student_number: Öğrenci Numarası year_and_semester: Sınıfı/Yarıyılı + errors: + no_enrollments: Derse kayıtlanmış öğrenci bulunmamaktadır. + not_coordinator: İşlem yalnızca ders koordinatörü tarafından gerçekleştirilebilir. + saved: Notlandırma kesin olarak kaydedilmiş, güncelleme işlemi yapılamaz. save: error: Notlandırma kalıcı olarak kaydedilemedi. not_draft_error: Notlandırma kalıcı olarak kaydedilemedi, taslak durumunda değil. From a88b3e9e011fa99ddfd27da572de290a01c10cf8 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 12:41:53 +0300 Subject: [PATCH 344/970] Fix typo --- app/controllers/instructiveness/assessments_controller.rb | 2 +- config/locales/controllers/instructiveness/assessments.en.yml | 2 +- config/locales/controllers/instructiveness/assessments.tr.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/instructiveness/assessments_controller.rb b/app/controllers/instructiveness/assessments_controller.rb index 500fff288..e0c8c194d 100644 --- a/app/controllers/instructiveness/assessments_controller.rb +++ b/app/controllers/instructiveness/assessments_controller.rb @@ -30,7 +30,7 @@ def update def save return redirect_with('not_draft_error') unless @assessment.draft? - return redirect_with('not_full_graded_error') unless @assessment.fully_graded? + return redirect_with('not_fully_graded_error') unless @assessment.fully_graded? @assessment.update(status: :saved) ? redirect_with('success') : redirect_with('error') end diff --git a/config/locales/controllers/instructiveness/assessments.en.yml b/config/locales/controllers/instructiveness/assessments.en.yml index d10792663..f3a51dbad 100644 --- a/config/locales/controllers/instructiveness/assessments.en.yml +++ b/config/locales/controllers/instructiveness/assessments.en.yml @@ -36,7 +36,7 @@ en: save: error: Assessment could not be saved permanently. not_draft_error: Assessment is not in draft status, could not be saved permanently. - not_full_graded_error: Assessment could not be saved permanently, there are enrollments with no grade entries. + not_fully_graded_error: Assessment could not be saved permanently, there are enrollments with no grade entries. success: Assessment saved permanently. show: draft: Draft diff --git a/config/locales/controllers/instructiveness/assessments.tr.yml b/config/locales/controllers/instructiveness/assessments.tr.yml index 0dbb741e8..c0264ed19 100644 --- a/config/locales/controllers/instructiveness/assessments.tr.yml +++ b/config/locales/controllers/instructiveness/assessments.tr.yml @@ -36,7 +36,7 @@ tr: save: error: Notlandırma kalıcı olarak kaydedilemedi. not_draft_error: Notlandırma kalıcı olarak kaydedilemedi, taslak durumunda değil. - not_full_graded_error: Notlandırma kalıcı olarak kaydedilemedi, not girişi yapılmamış kayıtlanmalar bulunmaktadır. + not_fully_graded_error: Notlandırma kalıcı olarak kaydedilemedi, not girişi yapılmamış kayıtlanmalar bulunmaktadır. success: Notlandırma başarıyla kalıcı olarak kaydedildi. show: draft: Taslak Durumuna Getir From 5e77938abee6c33e7fad57cbcb19e2084222f9a0 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 12:48:23 +0300 Subject: [PATCH 345/970] Make callback names more meaningful --- .../instructiveness/assessments_controller.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/instructiveness/assessments_controller.rb b/app/controllers/instructiveness/assessments_controller.rb index e0c8c194d..04b76d0bc 100644 --- a/app/controllers/instructiveness/assessments_controller.rb +++ b/app/controllers/instructiveness/assessments_controller.rb @@ -6,9 +6,9 @@ class AssessmentsController < ApplicationController before_action :set_course before_action :set_assessment before_action :authorized? - before_action :check_status, only: %i[edit update] - before_action :check_any_enrollments, only: %i[edit update] - before_action :check_coordinator, only: %i[save draft] + before_action :not_saved?, only: %i[edit update] + before_action :any_enrollments?, only: %i[edit update] + before_action :coordinator?, only: %i[save draft] def show @enrollments = @course.enrollments_under_authority_of(@employee) @@ -63,15 +63,15 @@ def set_assessment @assessment = @course.course_assessment_methods.find(params[:id]) end - def check_status + def not_saved? redirect_with('.errors.saved') if @assessment.saved? end - def check_any_enrollments + def any_enrollments? redirect_with('errors.no_enrollments') if @assessment.saved_enrollments.empty? end - def check_coordinator + def coordinator? redirect_with('.errors.not_coordinator') unless @employee.coordinatorships.include?(@course) end From 73ac00531ca67891751ff78913d4f897d81edda7 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 13:27:52 +0300 Subject: [PATCH 346/970] Add set enrollments callback to check if any --- .../instructiveness/assessments_controller.rb | 25 ++++++++----------- .../instructiveness/assessments.en.yml | 2 +- .../instructiveness/assessments.tr.yml | 2 +- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/app/controllers/instructiveness/assessments_controller.rb b/app/controllers/instructiveness/assessments_controller.rb index 04b76d0bc..c5de06047 100644 --- a/app/controllers/instructiveness/assessments_controller.rb +++ b/app/controllers/instructiveness/assessments_controller.rb @@ -5,17 +5,14 @@ class AssessmentsController < ApplicationController before_action :set_employee before_action :set_course before_action :set_assessment + before_action :set_enrollments before_action :authorized? before_action :not_saved?, only: %i[edit update] - before_action :any_enrollments?, only: %i[edit update] before_action :coordinator?, only: %i[save draft] - def show - @enrollments = @course.enrollments_under_authority_of(@employee) - end + def show; end def edit - @enrollments = @course.enrollments_under_authority_of(@employee) @grades = @assessment.grades_under_authority_of(@employee) + @assessment.build_grades_for(@enrollments.where.not(id: @assessment.grades.map(&:course_enrollment_id))) end @@ -23,7 +20,6 @@ def edit def update return redirect_with('success') if @assessment.update(assessment_params) - @enrollments = @course.enrollments_under_authority_of(@employee) @grades = @assessment.grades.select { |grade| @enrollments.ids.include?(grade.course_enrollment_id) } render(:edit) end @@ -51,10 +47,6 @@ def set_employee not_found if (@employee = current_user.current_employee).nil? end - def authorized? - authorize(@employee, policy_class: Instructiveness::AssessmentPolicy) - end - def set_course @course = @employee.given_courses.find(params[:given_course_id]) end @@ -63,12 +55,17 @@ def set_assessment @assessment = @course.course_assessment_methods.find(params[:id]) end - def not_saved? - redirect_with('.errors.saved') if @assessment.saved? + def set_enrollments + @enrollments = @course.enrollments_under_authority_of(@employee) + redirect_to given_course_path(@course), flash: { info: t('.errors.no_enrollments') } if @enrollments.empty? + end + + def authorized? + authorize(@employee, policy_class: Instructiveness::AssessmentPolicy) end - def any_enrollments? - redirect_with('errors.no_enrollments') if @assessment.saved_enrollments.empty? + def not_saved? + redirect_with('.errors.saved') if @assessment.saved? end def coordinator? diff --git a/config/locales/controllers/instructiveness/assessments.en.yml b/config/locales/controllers/instructiveness/assessments.en.yml index f3a51dbad..266e9c05b 100644 --- a/config/locales/controllers/instructiveness/assessments.en.yml +++ b/config/locales/controllers/instructiveness/assessments.en.yml @@ -30,7 +30,7 @@ en: student_number: Student Number year_and_semester: Year/Semester errors: - no_enrollments: There are no students enrolled in the course. + no_enrollments: There are no students enrolled in the course under your authority. not_coordinator: The process can only be carried out by the course coordinator. saved: Assessment was saved permanently, updating cannot be done. save: diff --git a/config/locales/controllers/instructiveness/assessments.tr.yml b/config/locales/controllers/instructiveness/assessments.tr.yml index c0264ed19..a5965c920 100644 --- a/config/locales/controllers/instructiveness/assessments.tr.yml +++ b/config/locales/controllers/instructiveness/assessments.tr.yml @@ -30,7 +30,7 @@ tr: student_number: Öğrenci Numarası year_and_semester: Sınıfı/Yarıyılı errors: - no_enrollments: Derse kayıtlanmış öğrenci bulunmamaktadır. + no_enrollments: Yetkiniz altında derse kayıtlanmış öğrenci bulunmamaktadır. not_coordinator: İşlem yalnızca ders koordinatörü tarafından gerçekleştirilebilir. saved: Notlandırma kesin olarak kaydedilmiş, güncelleme işlemi yapılamaz. save: From ffb27e7ae86d0ef040448900119a740b6cdd443c Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 13:48:02 +0300 Subject: [PATCH 347/970] Add lecturer field to grade --- .../instructiveness/assessments_controller.rb | 2 +- app/models/grade.rb | 1 + .../instructiveness/assessments/edit.html.erb | 1 + db/migrate/20200213110520_create_grades.rb | 1 + db/structure.sql | 16 ++++++++++++++++ .../assessments_controller_test.rb | 2 +- test/fixtures/grades.yml | 3 +++ 7 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/controllers/instructiveness/assessments_controller.rb b/app/controllers/instructiveness/assessments_controller.rb index c5de06047..190d41e1f 100644 --- a/app/controllers/instructiveness/assessments_controller.rb +++ b/app/controllers/instructiveness/assessments_controller.rb @@ -74,7 +74,7 @@ def coordinator? def assessment_params params.require(:course_assessment_method) - .permit(grades_attributes: %i[id course_enrollment_id point]) + .permit(grades_attributes: %i[id course_enrollment_id lecturer_id point]) .merge(status: :draft) end end diff --git a/app/models/grade.rb b/app/models/grade.rb index df1c39d40..a8e020c95 100644 --- a/app/models/grade.rb +++ b/app/models/grade.rb @@ -4,6 +4,7 @@ class Grade < ApplicationRecord # relations belongs_to :course_assessment_method belongs_to :course_enrollment + belongs_to :lecturer, class_name: 'Employee' # validations validates :point, numericality: { diff --git a/app/views/instructiveness/assessments/edit.html.erb b/app/views/instructiveness/assessments/edit.html.erb index beb488ad6..aa0b69b83 100644 --- a/app/views/instructiveness/assessments/edit.html.erb +++ b/app/views/instructiveness/assessments/edit.html.erb @@ -40,6 +40,7 @@ <%= f.simple_fields_for :grades, @grades do |grade| %> <% enrollment = grade.object.course_enrollment %> <%= grade.input(:course_enrollment_id, as: :hidden, wrapper: false, input_html: { value: enrollment.id }) %> + <%= grade.input(:lecturer_id, as: :hidden, wrapper: false, input_html: { value: @employee.id }) %> <% student = enrollment.student %> diff --git a/db/migrate/20200213110520_create_grades.rb b/db/migrate/20200213110520_create_grades.rb index 1ba29ff9b..daeb76f28 100644 --- a/db/migrate/20200213110520_create_grades.rb +++ b/db/migrate/20200213110520_create_grades.rb @@ -5,6 +5,7 @@ def change create_table :grades do |t| t.references :course_assessment_method, foreign_key: true, null: false t.references :course_enrollment, foreign_key: true, null: false + t.references :lecturer, foreign_key: { to_table: :employees }, null: false t.integer :point t.timestamps diff --git a/db/structure.sql b/db/structure.sql index 59dc373f5..f6628b8a8 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1955,6 +1955,7 @@ CREATE TABLE public.grades ( id bigint NOT NULL, course_assessment_method_id bigint NOT NULL, course_enrollment_id bigint NOT NULL, + lecturer_id bigint NOT NULL, point integer, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, @@ -5897,6 +5898,13 @@ CREATE INDEX index_grades_on_course_assessment_method_id ON public.grades USING CREATE INDEX index_grades_on_course_enrollment_id ON public.grades USING btree (course_enrollment_id); +-- +-- Name: index_grades_on_lecturer_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_grades_on_lecturer_id ON public.grades USING btree (lecturer_id); + + -- -- Name: index_group_courses_on_course_group_id; Type: INDEX; Schema: public; Owner: - -- @@ -6939,6 +6947,14 @@ ALTER TABLE ONLY public.prospective_employees ADD CONSTRAINT fk_rails_cfef503ec1 FOREIGN KEY (unit_id) REFERENCES public.units(id); +-- +-- Name: grades fk_rails_d05f1e31bd; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.grades + ADD CONSTRAINT fk_rails_d05f1e31bd FOREIGN KEY (lecturer_id) REFERENCES public.employees(id); + + -- -- Name: academic_credentials fk_rails_d55570421b; Type: FK CONSTRAINT; Schema: public; Owner: - -- diff --git a/test/controllers/instructiveness/assessments_controller_test.rb b/test/controllers/instructiveness/assessments_controller_test.rb index 1ff756fbe..e4ceaae41 100644 --- a/test/controllers/instructiveness/assessments_controller_test.rb +++ b/test/controllers/instructiveness/assessments_controller_test.rb @@ -25,7 +25,7 @@ class AssessmentsControllerTest < ActionDispatch::IntegrationTest patch given_course_assessment_path(@course, @assessment), params: { course_assessment_method: { grades_attributes: { - '0' => { course_enrollment_id: @course_enrollment.id, point: 50 } + '0' => { course_enrollment_id: @course_enrollment.id, point: 50, lecturer_id: employees(:vice_rector).id } } } } diff --git a/test/fixtures/grades.yml b/test/fixtures/grades.yml index 49a3b8e73..7fe829908 100644 --- a/test/fixtures/grades.yml +++ b/test/fixtures/grades.yml @@ -2,10 +2,13 @@ elective_midterm_project_grade: course_assessment_method: elective_midterm_project_assessment course_enrollment: elective point: 50 + lecturer: vice_rector johns_elective_midterm_project_grade: course_assessment_method: elective_midterm_project_assessment course_enrollment: johns_enrollment point: 40 + lecturer: vice_rector johns_compulsory_midterm_project_grade: course_assessment_method: elective_midterm_project_assessment course_enrollment: compulsory + lecturer: serhat_active From eb5489f7ff5a5ad0db71e51ad1d7ba4de5d13f93 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 16:11:22 +0300 Subject: [PATCH 348/970] Remove unused span --- .../instructiveness/given_courses/_evaluation_types.html.erb | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/views/instructiveness/given_courses/_evaluation_types.html.erb b/app/views/instructiveness/given_courses/_evaluation_types.html.erb index 1ffc3688e..3d7c84725 100644 --- a/app/views/instructiveness/given_courses/_evaluation_types.html.erb +++ b/app/views/instructiveness/given_courses/_evaluation_types.html.erb @@ -9,9 +9,6 @@ <% @evaluation_types.each do |evaluation_type| %>
<%= fa_icon 'sticky-note' %><%= "#{evaluation_type.name} (%#{evaluation_type.percentage})" %> - - -
From b476d6b74822bfe93657d6ea2a54c542b42e7bc2 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 27 Feb 2020 16:12:02 +0300 Subject: [PATCH 349/970] Add missing test --- test/models/grade_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/models/grade_test.rb b/test/models/grade_test.rb index 1a26706b3..eada64845 100644 --- a/test/models/grade_test.rb +++ b/test/models/grade_test.rb @@ -9,6 +9,7 @@ class GradeTest < ActiveSupport::TestCase # relations belongs_to :course_assessment_method belongs_to :course_enrollment + belongs_to :lecturer, class_name: 'Employee' # validations: uniqueness test 'uniqueness validations for grade of a course_enrollment' do From 94ea64df034f21d009ec0abc6868ffaae07c6639 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 1 Mar 2020 23:08:20 +0000 Subject: [PATCH 350/970] chore(deps): [security] bump puma from 4.3.1 to 4.3.3 Bumps [puma](https://github.com/puma/puma) from 4.3.1 to 4.3.3. **This update includes security fixes.** - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v4.3.1...v4.3.3) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 887459eb6..be23ef0d5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -280,7 +280,7 @@ GEM pry-rails (0.3.9) pry (>= 0.10.4) public_suffix (4.0.3) - puma (4.3.1) + puma (4.3.3) nio4r (~> 2.0) pundit (2.1.0) activesupport (>= 3.0.0) From f673ad8e100ede0e2d16894eab275e39fe3e7e7d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:13:51 +0000 Subject: [PATCH 351/970] chore(deps): bump bindata from 2.4.5 to 2.4.6 Bumps [bindata](https://github.com/dmendel/bindata) from 2.4.5 to 2.4.6. - [Release notes](https://github.com/dmendel/bindata/releases) - [Changelog](https://github.com/dmendel/bindata/blob/master/ChangeLog.rdoc) - [Commits](https://github.com/dmendel/bindata/compare/v2.4.5...v2.4.6) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 887459eb6..321165e40 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -118,7 +118,7 @@ GEM html_tokenizer (~> 0.0.6) parser (>= 2.4) smart_properties - bindata (2.4.5) + bindata (2.4.6) bindex (0.8.1) bootsnap (1.4.5) msgpack (~> 1.0) From 04644f22cced52e9fa24f459d143611c893c1892 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:14:38 +0000 Subject: [PATCH 352/970] chore(deps): bump nokogiri from 1.10.8 to 1.10.9 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.8 to 1.10.9. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.10.9/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.8...v1.10.9) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 887459eb6..2297f5db1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -244,7 +244,7 @@ GEM jwt (~> 2) zeitwerk (~> 2, >= 2.2) nio4r (2.5.2) - nokogiri (1.10.8) + nokogiri (1.10.9) mini_portile2 (~> 2.4.0) omniauth (1.9.0) hashie (>= 3.4.6, < 3.7.0) From 463ce5de21f4eae428bfb3f986c16aec064265cf Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:15:02 +0000 Subject: [PATCH 353/970] chore(deps): bump nexmo from 6.2.0 to 6.3.0 Bumps [nexmo](https://github.com/Nexmo/nexmo-ruby) from 6.2.0 to 6.3.0. - [Release notes](https://github.com/Nexmo/nexmo-ruby/releases) - [Changelog](https://github.com/Nexmo/nexmo-ruby/blob/master/CHANGES.md) - [Commits](https://github.com/Nexmo/nexmo-ruby/compare/v6.2.0...v6.3.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 887459eb6..32509919f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -240,8 +240,9 @@ GEM msgpack (1.3.3) multipart-post (2.1.1) net-ldap (0.16.2) - nexmo (6.2.0) + nexmo (6.3.0) jwt (~> 2) + sorbet-runtime (~> 0.5) zeitwerk (~> 2, >= 2.2) nio4r (2.5.2) nokogiri (1.10.8) @@ -393,6 +394,7 @@ GEM slack-notifier (2.3.2) smart_properties (1.15.0) smstools (0.2.0) + sorbet-runtime (0.5.5406) spring (2.1.0) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) From 6c430253a2d4d0a09f443536125ae746166d94ea Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:15:30 +0000 Subject: [PATCH 354/970] chore(deps): bump simplecov-html from 0.12.1 to 0.12.2 Bumps [simplecov-html](https://github.com/colszowka/simplecov-html) from 0.12.1 to 0.12.2. - [Release notes](https://github.com/colszowka/simplecov-html/releases) - [Changelog](https://github.com/colszowka/simplecov-html/blob/master/CHANGELOG.md) - [Commits](https://github.com/colszowka/simplecov-html/compare/v0.12.1...v0.12.2) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 887459eb6..1b7487950 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -389,7 +389,7 @@ GEM simplecov (0.18.3) docile (~> 1.1) simplecov-html (~> 0.11) - simplecov-html (0.12.1) + simplecov-html (0.12.2) slack-notifier (2.3.2) smart_properties (1.15.0) smstools (0.2.0) From 479f928f95fd1c4277d78eec2eb4031ff003632e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:16:02 +0000 Subject: [PATCH 355/970] chore(deps): bump aws-partitions from 1.275.0 to 1.278.0 Bumps [aws-partitions](https://github.com/aws/aws-sdk-ruby) from 1.275.0 to 1.278.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-partitions/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 887459eb6..5249dc88a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,7 +94,7 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.0.3) - aws-partitions (1.275.0) + aws-partitions (1.278.0) aws-sdk-core (3.90.1) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) From 62843f18f662ccbceabc8510ed2e4958174e4a24 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:16:39 +0000 Subject: [PATCH 356/970] chore(deps): bump hashdiff from 1.0.0 to 1.0.1 Bumps [hashdiff](https://github.com/liufengyun/hashdiff) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/liufengyun/hashdiff/releases) - [Changelog](https://github.com/liufengyun/hashdiff/blob/master/changelog.md) - [Commits](https://github.com/liufengyun/hashdiff/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 887459eb6..63a053126 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -188,7 +188,7 @@ GEM activesupport (>= 4.2.0) groupdate (5.0.0) activesupport (>= 5) - hashdiff (1.0.0) + hashdiff (1.0.1) hashie (3.6.0) html_tokenizer (0.0.7) httpclient (2.8.3) From 5c68757871a7d1d0387ede70026a65deb1f43a64 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:17:18 +0000 Subject: [PATCH 357/970] chore(deps): bump parser from 2.7.0.2 to 2.7.0.3 Bumps [parser](https://github.com/whitequark/parser) from 2.7.0.2 to 2.7.0.3. - [Release notes](https://github.com/whitequark/parser/releases) - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v2.7.0.2...v2.7.0.3) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 887459eb6..58f2a3aef 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -266,7 +266,7 @@ GEM orm_adapter (0.5.0) pagy (3.7.3) parallel (1.19.1) - parser (2.7.0.2) + parser (2.7.0.3) ast (~> 2.4.0) pg (1.2.2) pg_search (2.3.2) From 98bea6e3147f3af62a05ea25d8075baafc77e3b7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:17:59 +0000 Subject: [PATCH 358/970] chore(deps-dev): bump simplecov from 0.18.3 to 0.18.5 Bumps [simplecov](https://github.com/colszowka/simplecov) from 0.18.3 to 0.18.5. - [Release notes](https://github.com/colszowka/simplecov/releases) - [Changelog](https://github.com/colszowka/simplecov/blob/master/CHANGELOG.md) - [Commits](https://github.com/colszowka/simplecov/compare/v0.18.3...v0.18.5) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 887459eb6..86accf1d0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -386,10 +386,10 @@ GEM simple_form (5.0.2) actionpack (>= 5.0) activemodel (>= 5.0) - simplecov (0.18.3) + simplecov (0.18.5) docile (~> 1.1) simplecov-html (~> 0.11) - simplecov-html (0.12.1) + simplecov-html (0.12.2) slack-notifier (2.3.2) smart_properties (1.15.0) smstools (0.2.0) From 2aeb76ee6de7d47eece368716ca3d32770aa58c7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:18:43 +0000 Subject: [PATCH 359/970] chore(deps): bump aws-sigv4 from 1.1.0 to 1.1.1 Bumps [aws-sigv4](https://github.com/aws/aws-sdk-ruby) from 1.1.0 to 1.1.1. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sigv4/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/compare/1.1.0...1.1.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 887459eb6..120b795c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -107,7 +107,7 @@ GEM aws-sdk-core (~> 3, >= 3.83.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) - aws-sigv4 (1.1.0) + aws-sigv4 (1.1.1) aws-eventstream (~> 1.0, >= 1.0.2) bcrypt (3.1.13) better_html (1.0.14) From 3e422b13e82425c4ef5778f6364913113e9535cc Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:28:30 +0000 Subject: [PATCH 360/970] chore(deps): bump postcss-safe-parser from 4.0.1 to 4.0.2 Bumps [postcss-safe-parser](https://github.com/postcss/postcss-safe-parser) from 4.0.1 to 4.0.2. - [Release notes](https://github.com/postcss/postcss-safe-parser/releases) - [Changelog](https://github.com/postcss/postcss-safe-parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss-safe-parser/compare/4.0.1...4.0.2) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index b4b0092b9..e78840d6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6545,11 +6545,11 @@ postcss-replace-overflow-wrap@^3.0.0: postcss "^7.0.2" postcss-safe-parser@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-4.0.1.tgz#8756d9e4c36fdce2c72b091bbc8ca176ab1fcdea" - integrity sha512-xZsFA3uX8MO3yAda03QrG3/Eg1LN3EPfjjf07vke/46HERLZyHrTsQ9E1r1w1W//fWEhtYNndo2hQplN2cVpCQ== + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-4.0.2.tgz#a6d4e48f0f37d9f7c11b2a581bf00f8ba4870b96" + integrity sha512-Uw6ekxSWNLCPesSv/cmqf2bY/77z11O7jZGPax3ycZMFU/oi2DMH9i89AdHc1tRwFg/arFoEwX0IS3LCUxJh1g== dependencies: - postcss "^7.0.0" + postcss "^7.0.26" postcss-selector-matches@^4.0.0: version "4.0.0" From dc13bce512bd3133f27db27851caf7c6db424991 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:29:02 +0000 Subject: [PATCH 361/970] chore(deps): bump esquery from 1.0.1 to 1.1.0 Bumps [esquery](https://github.com/jrfeenst/esquery) from 1.0.1 to 1.1.0. - [Release notes](https://github.com/jrfeenst/esquery/releases) - [Commits](https://github.com/jrfeenst/esquery/compare/v1.0.1...v1.1.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b4b0092b9..893aa638e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3103,9 +3103,9 @@ esprima@^4.0.0: integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" - integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + version "1.1.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.1.0.tgz#c5c0b66f383e7656404f86b31334d72524eddb48" + integrity sha512-MxYW9xKmROWF672KqjO75sszsA8Mxhw06YFeS5VHlB98KDHbOSurm3ArsjO60Eaf3QmGMCP1yn+0JQkNLo/97Q== dependencies: estraverse "^4.0.0" From d01e9becb33515bc40d3650d7dde9904f08d4a13 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:30:00 +0000 Subject: [PATCH 362/970] chore(deps): bump caniuse-lite from 1.0.30001028 to 1.0.30001030 Bumps [caniuse-lite](https://github.com/ben-eb/caniuse-lite) from 1.0.30001028 to 1.0.30001030. - [Release notes](https://github.com/ben-eb/caniuse-lite/releases) - [Changelog](https://github.com/ben-eb/caniuse-lite/blob/master/CHANGELOG.md) - [Commits](https://github.com/ben-eb/caniuse-lite/compare/v1.0.30001028...v1.0.30001030) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b4b0092b9..ff62c5a63 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1827,9 +1827,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001020, caniuse-lite@^1.0.30001027: - version "1.0.30001028" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001028.tgz#f2241242ac70e0fa9cda55c2776d32a0867971c2" - integrity sha512-Vnrq+XMSHpT7E+LWoIYhs3Sne8h9lx9YJV3acH3THNCwU/9zV93/ta4xVfzTtnqd3rvnuVpVjE3DFqf56tr3aQ== + version "1.0.30001030" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001030.tgz#78076c4c6d67d3e41d6eb9399853fb27fe6e44ee" + integrity sha512-QGK0W4Ft/Ac+zTjEiRJfwDNATvS3fodDczBXrH42784kcfqcDKpEPfN08N0HQjrAp8He/Jw8QiSS9QRn7XAbUw== case-sensitive-paths-webpack-plugin@^2.2.0: version "2.3.0" From f0353d6e185a0949cead78b7427275cf87accb34 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:30:25 +0000 Subject: [PATCH 363/970] chore(deps): bump postcss-flexbugs-fixes from 4.1.0 to 4.2.0 Bumps [postcss-flexbugs-fixes](https://github.com/luisrudge/postcss-flexbugs-fixes) from 4.1.0 to 4.2.0. - [Release notes](https://github.com/luisrudge/postcss-flexbugs-fixes/releases) - [Changelog](https://github.com/luisrudge/postcss-flexbugs-fixes/blob/master/CHANGELOG.md) - [Commits](https://github.com/luisrudge/postcss-flexbugs-fixes/commits) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index b4b0092b9..66d158d78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6151,11 +6151,11 @@ postcss-env-function@^2.0.2: postcss-values-parser "^2.0.0" postcss-flexbugs-fixes@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-4.1.0.tgz#e094a9df1783e2200b7b19f875dcad3b3aff8b20" - integrity sha512-jr1LHxQvStNNAHlgco6PzY308zvLklh7SJVYuWUwyUQncofaAlD2l+P/gxKHOdqWKe7xJSkVLFF/2Tp+JqMSZA== + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-4.2.0.tgz#662b3dcb6354638b9213a55eed8913bcdc8d004a" + integrity sha512-QRE0n3hpkxxS/OGvzOa+PDuy4mh/Jg4o9ui22/ko5iGYOG3M5dfJabjnAZjTdh2G9F85c7Hv8hWcEDEKW/xceQ== dependencies: - postcss "^7.0.0" + postcss "^7.0.26" postcss-focus-visible@^4.0.0: version "4.0.0" From d35a59b04d50e27bb7f30e7f0bb5b43ae24ea221 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:32:18 +0000 Subject: [PATCH 364/970] chore(deps): bump resolve from 1.14.2 to 1.15.1 Bumps [resolve](https://github.com/browserify/resolve) from 1.14.2 to 1.15.1. - [Release notes](https://github.com/browserify/resolve/releases) - [Commits](https://github.com/browserify/resolve/compare/v1.14.2...v1.15.1) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b4b0092b9..76e671082 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7105,9 +7105,9 @@ resolve-url@^0.2.1: integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.3.2, resolve@^1.8.1: - version "1.14.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.14.2.tgz#dbf31d0fa98b1f29aa5169783b9c290cb865fea2" - integrity sha512-EjlOBLBO1kxsUxsKjLt7TAECyKW6fOh1VRkykQkKGzcBbjjPIxBqGh0jf7GJ3k/f5mxMqW3htMD3WdTUVtW8HQ== + version "1.15.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" + integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== dependencies: path-parse "^1.0.6" From f12ba080904efba138501e46fffa5be940e9f010 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 08:04:03 +0000 Subject: [PATCH 365/970] chore(deps): bump nokogiri from 1.10.5 to 1.10.9 in /plugins/tenant/acme Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.5 to 1.10.9. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.10.9/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.5...v1.10.9) Signed-off-by: dependabot[bot] --- plugins/tenant/acme/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tenant/acme/Gemfile.lock b/plugins/tenant/acme/Gemfile.lock index d9bb33445..7208ece84 100644 --- a/plugins/tenant/acme/Gemfile.lock +++ b/plugins/tenant/acme/Gemfile.lock @@ -98,7 +98,7 @@ GEM minitest-focus (1.1.2) minitest (>= 4, < 6) nio4r (2.5.2) - nokogiri (1.10.5) + nokogiri (1.10.9) mini_portile2 (~> 2.4.0) rack (2.0.8) rack-test (1.1.0) From 08c98f922cd5befb99d5a581fc808d1609170b91 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 2 Mar 2020 12:26:39 +0300 Subject: [PATCH 366/970] Fix test caused by conflicts --- db/structure.sql | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/db/structure.sql b/db/structure.sql index 00ce82bb9..628826548 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -6474,19 +6474,18 @@ ALTER TABLE ONLY public.addresses -- -<<<<<<< HEAD -- Name: unit_tuitions fk_rails_2b01e356e7; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.unit_tuitions ADD CONSTRAINT fk_rails_2b01e356e7 FOREIGN KEY (unit_id) REFERENCES public.units(id); -======= + +-- -- Name: grades fk_rails_2edc8b4497; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.grades ADD CONSTRAINT fk_rails_2edc8b4497 FOREIGN KEY (course_assessment_method_id) REFERENCES public.course_assessment_methods(id); ->>>>>>> develop -- @@ -7370,12 +7369,9 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200129072653'), ('20200206083358'), ('20200211084915'), -<<<<<<< HEAD ('20200215132359'), -('20200217110305'); -======= +('20200217110305'), ('20200213110520'), ('20200213124638'); ->>>>>>> develop From 3f98f2996083639b9ed7ed087a8b64c9bc604de7 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 2 Mar 2020 12:35:53 +0300 Subject: [PATCH 367/970] Fix order --- db/structure.sql | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/db/structure.sql b/db/structure.sql index 628826548..c43740386 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -6480,6 +6480,7 @@ ALTER TABLE ONLY public.addresses ALTER TABLE ONLY public.unit_tuitions ADD CONSTRAINT fk_rails_2b01e356e7 FOREIGN KEY (unit_id) REFERENCES public.units(id); + -- -- Name: grades fk_rails_2edc8b4497; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7369,9 +7370,9 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200129072653'), ('20200206083358'), ('20200211084915'), -('20200215132359'), -('20200217110305'), ('20200213110520'), -('20200213124638'); +('20200213124638'), +('20200215132359'), +('20200217110305'); From 61e58e4f13ab0315a2fb01b91aa1a1c10ac7bd22 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 2 Mar 2020 13:07:57 +0300 Subject: [PATCH 368/970] Fix n+1 query --- app/validators/unit_tuition_validator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/validators/unit_tuition_validator.rb b/app/validators/unit_tuition_validator.rb index 59bbedc13..21d278360 100644 --- a/app/validators/unit_tuition_validator.rb +++ b/app/validators/unit_tuition_validator.rb @@ -9,7 +9,8 @@ def validate(record) end def tuition_exists? - UnitTuition.where.not(id: @unit_tuition).where(unit: @unit).map(&:academic_term).uniq.include?(@academic_term) + UnitTuition.includes(tuition: :academic_term) + .where.not(id: @unit_tuition).where(unit: @unit).map(&:academic_term).include?(@academic_term) end def error_message From 4cc3cc0906fe91ea98dc0f52e1563b8c5dd2d56e Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 2 Mar 2020 14:11:26 +0300 Subject: [PATCH 369/970] Both fees cannot be left empty --- app/models/tuition.rb | 5 +++++ .../locales/controllers/tuition_management/tuitions.en.yml | 6 ++++++ .../locales/controllers/tuition_management/tuitions.tr.yml | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/app/models/tuition.rb b/app/models/tuition.rb index c433fbc52..263ac18b5 100644 --- a/app/models/tuition.rb +++ b/app/models/tuition.rb @@ -15,5 +15,10 @@ class Tuition < ApplicationRecord # validations validates :fee, numericality: { greater_than_or_equal_to: 0 } validates :foreign_student_fee, numericality: { greater_than_or_equal_to: 0 } + validate :fee_must_be_specified validates_associated :unit_tuitions + + def fee_must_be_specified + errors.add(:base, :not_specified_fees) if [fee, foreign_student_fee].map(&:zero?).all? + end end diff --git a/config/locales/controllers/tuition_management/tuitions.en.yml b/config/locales/controllers/tuition_management/tuitions.en.yml index 569e4ecd5..71237f8e5 100644 --- a/config/locales/controllers/tuition_management/tuitions.en.yml +++ b/config/locales/controllers/tuition_management/tuitions.en.yml @@ -6,6 +6,12 @@ en: fee: Tuition Fee foreign_student_fee: Foreign Student Tuition Fee unit_ids: Units + errors: + models: + tuition: + attributes: + base: + not_specified_fees: Both fees cannot be left empty. tuition_management: tuitions: create: diff --git a/config/locales/controllers/tuition_management/tuitions.tr.yml b/config/locales/controllers/tuition_management/tuitions.tr.yml index 0f1082c35..dcce02585 100644 --- a/config/locales/controllers/tuition_management/tuitions.tr.yml +++ b/config/locales/controllers/tuition_management/tuitions.tr.yml @@ -6,6 +6,12 @@ tr: fee: Harç Ücreti foreign_student_fee: Yabancı Öğrenci Harç Ücreti unit_ids: Birimler + errors: + models: + tuition: + attributes: + base: + not_specified_fees: Harç ücretlerinin ikisi birden boş geçilemez. tuition_management: tuitions: create: From 27e4a0b88a4b2641066edffc9c9692f8d5fadb35 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 3 Mar 2020 08:48:59 +0300 Subject: [PATCH 370/970] Show depth name of units --- app/views/tuition_management/tuitions/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/tuition_management/tuitions/index.html.erb b/app/views/tuition_management/tuitions/index.html.erb index 2a00b9483..2814c7eb5 100644 --- a/app/views/tuition_management/tuitions/index.html.erb +++ b/app/views/tuition_management/tuitions/index.html.erb @@ -22,7 +22,7 @@ <% @tuitions.each do |tuition| %> - + From e464047dcccb0b816e43ef22b0a3ff1fe16ddeaa Mon Sep 17 00:00:00 2001 From: Ecmel Albayrak Date: Tue, 3 Mar 2020 09:48:55 +0300 Subject: [PATCH 371/970] Update config/locales/controllers/tuition_management/tuitions.en.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Begüm Topyıldız --- config/locales/controllers/tuition_management/tuitions.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/controllers/tuition_management/tuitions.en.yml b/config/locales/controllers/tuition_management/tuitions.en.yml index 71237f8e5..36b7f5e37 100644 --- a/config/locales/controllers/tuition_management/tuitions.en.yml +++ b/config/locales/controllers/tuition_management/tuitions.en.yml @@ -29,6 +29,6 @@ en: form_title: Add Tuition to Units search: academic_term: Academic Term - unit: Birimler + unit: Units update: success: Tuitions successfully updated. From bc650a5e7dc55d7bee133ddd2ae2b746b6846118 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 3 Mar 2020 10:01:44 +0300 Subject: [PATCH 372/970] List active and partially passive units --- app/views/tuition_management/tuitions/units.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/tuition_management/tuitions/units.json.jbuilder b/app/views/tuition_management/tuitions/units.json.jbuilder index aecf018d5..b91056de2 100644 --- a/app/views/tuition_management/tuitions/units.json.jbuilder +++ b/app/views/tuition_management/tuitions/units.json.jbuilder @@ -3,7 +3,7 @@ json.array!(@units) do |unit| json.id unit.id json.text unit.name - json.children(unit.subprograms) do |program| + json.children(unit.subprograms.active.or(unit.subprograms.partially_passive)) do |program| json.id program.id json.text program.name end From 4d22d0778da4b0eecb85aff099685f80eeff780e Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 3 Mar 2020 14:10:53 +0300 Subject: [PATCH 373/970] Refactor unit tuition validator --- app/validators/unit_tuition_validator.rb | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/validators/unit_tuition_validator.rb b/app/validators/unit_tuition_validator.rb index 21d278360..47a6cff73 100644 --- a/app/validators/unit_tuition_validator.rb +++ b/app/validators/unit_tuition_validator.rb @@ -2,18 +2,19 @@ class UnitTuitionValidator < ActiveModel::Validator def validate(record) - @unit_tuition = record - @unit = record.unit - @academic_term = record.academic_term - return error_message if tuition_exists? - end + @record = record + @tuition = record.tuition + return unless already_exists? - def tuition_exists? - UnitTuition.includes(tuition: :academic_term) - .where.not(id: @unit_tuition).where(unit: @unit).map(&:academic_term).include?(@academic_term) + @tuition.errors.add( + :base, + I18n.t('defined', name: @record&.unit&.name, scope: %i[validators unit_tuition]) + ) end - def error_message - @unit_tuition.tuition.errors.add(:base, I18n.t('defined', name: @unit.name, scope: %i[validators unit_tuition])) + def already_exists? + UnitTuition.includes(tuition: :academic_term) + .where.not(id: @record.id) + .where(unit: @record.unit_id, tuitions: { academic_term_id: @tuition&.academic_term_id }).exists? end end From e1a8972460c5f35d1ce53d1a6cf456460619dd57 Mon Sep 17 00:00:00 2001 From: Ecmel Albayrak Date: Tue, 3 Mar 2020 14:43:18 +0300 Subject: [PATCH 374/970] Update app/controllers/tuition_management/tuitions_controller.rb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: İrfan Subaş --- app/controllers/tuition_management/tuitions_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/tuition_management/tuitions_controller.rb b/app/controllers/tuition_management/tuitions_controller.rb index 6b1ae98ec..01858656d 100644 --- a/app/controllers/tuition_management/tuitions_controller.rb +++ b/app/controllers/tuition_management/tuitions_controller.rb @@ -8,8 +8,9 @@ class TuitionsController < ApplicationController before_action :authorized? def index - tuitions = Unit.find_by(id: params[:unit_id])&.tuitions&.includes(:units, :unit_tuitions, :academic_term) || - Tuition.includes(:units, :unit_tuitions, :academic_term) + tuitions = Tuition.includes(:units, :unit_tuitions, :academic_term).where( + params[:unit_id].present? ? { units: { id: params[:unit_id] } } : {} + ) @pagy, @tuitions = pagy(tuitions.dynamic_search(search_params(Tuition))) end From 79604488f006def7f40870c68221b90f29145956 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 3 Mar 2020 15:06:17 +0300 Subject: [PATCH 375/970] Change validation for tuition fees --- app/models/tuition.rb | 7 +------ .../locales/controllers/tuition_management/tuitions.en.yml | 6 ------ .../locales/controllers/tuition_management/tuitions.tr.yml | 6 ------ test/models/tuition_test.rb | 2 +- 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/app/models/tuition.rb b/app/models/tuition.rb index 263ac18b5..0187ce481 100644 --- a/app/models/tuition.rb +++ b/app/models/tuition.rb @@ -14,11 +14,6 @@ class Tuition < ApplicationRecord # validations validates :fee, numericality: { greater_than_or_equal_to: 0 } - validates :foreign_student_fee, numericality: { greater_than_or_equal_to: 0 } - validate :fee_must_be_specified + validates :foreign_student_fee, numericality: { greater_than: 0 } validates_associated :unit_tuitions - - def fee_must_be_specified - errors.add(:base, :not_specified_fees) if [fee, foreign_student_fee].map(&:zero?).all? - end end diff --git a/config/locales/controllers/tuition_management/tuitions.en.yml b/config/locales/controllers/tuition_management/tuitions.en.yml index 36b7f5e37..e62859d3d 100644 --- a/config/locales/controllers/tuition_management/tuitions.en.yml +++ b/config/locales/controllers/tuition_management/tuitions.en.yml @@ -6,12 +6,6 @@ en: fee: Tuition Fee foreign_student_fee: Foreign Student Tuition Fee unit_ids: Units - errors: - models: - tuition: - attributes: - base: - not_specified_fees: Both fees cannot be left empty. tuition_management: tuitions: create: diff --git a/config/locales/controllers/tuition_management/tuitions.tr.yml b/config/locales/controllers/tuition_management/tuitions.tr.yml index dcce02585..0f1082c35 100644 --- a/config/locales/controllers/tuition_management/tuitions.tr.yml +++ b/config/locales/controllers/tuition_management/tuitions.tr.yml @@ -6,12 +6,6 @@ tr: fee: Harç Ücreti foreign_student_fee: Yabancı Öğrenci Harç Ücreti unit_ids: Birimler - errors: - models: - tuition: - attributes: - base: - not_specified_fees: Harç ücretlerinin ikisi birden boş geçilemez. tuition_management: tuitions: create: diff --git a/test/models/tuition_test.rb b/test/models/tuition_test.rb index f9c55b08d..131e4f286 100644 --- a/test/models/tuition_test.rb +++ b/test/models/tuition_test.rb @@ -15,5 +15,5 @@ class TuitionTest < ActiveSupport::TestCase validates_numericality_of :fee validates_numericality_of :foreign_student_fee validates_numerical_range :fee, greater_than_or_equal_to: 0 - validates_numerical_range :foreign_student_fee, greater_than_or_equal_to: 0 + validates_numerical_range :foreign_student_fee, greater_than: 0 end From cddad1d94716afb524314a29150a2ac0afcecb06 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 3 Mar 2020 15:45:34 +0300 Subject: [PATCH 376/970] Filter units when multiple select --- app/controllers/tuition_management/tuitions_controller.rb | 2 +- app/views/tuition_management/tuitions/_select2.html.erb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/tuition_management/tuitions_controller.rb b/app/controllers/tuition_management/tuitions_controller.rb index 01858656d..360aeda90 100644 --- a/app/controllers/tuition_management/tuitions_controller.rb +++ b/app/controllers/tuition_management/tuitions_controller.rb @@ -37,7 +37,7 @@ def destroy end def units - @units = Unit.active.faculties + @units = params[:term].present? ? Unit.active.faculties.search(params[:term]) : Unit.active.faculties respond_to :json end diff --git a/app/views/tuition_management/tuitions/_select2.html.erb b/app/views/tuition_management/tuitions/_select2.html.erb index b133fae44..94677818c 100644 --- a/app/views/tuition_management/tuitions/_select2.html.erb +++ b/app/views/tuition_management/tuitions/_select2.html.erb @@ -7,10 +7,10 @@ dataType: "json", delay: 250, data: function (params) { - return { - q: params.term - }; - }, + return { + term: params.term + }; + }, processResults: function (data) { return { results: data }; }, From 6928bd47da6bab4b4ece8590114159f4e2424fd6 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 5 Mar 2020 09:57:06 +0300 Subject: [PATCH 377/970] Remove files & relations about question bank module --- app/controllers/quba/questions_controller.rb | 10 --- app/models/course.rb | 1 - app/models/open_ended_question.rb | 55 ---------------- app/models/question.rb | 63 ------------------- app/models/question_choice.rb | 11 ---- app/models/source_book.rb | 36 ----------- app/models/unit.rb | 4 -- app/models/user.rb | 7 --- db/migrate/20200112141809_create_targets.rb | 17 ----- db/migrate/20200124111848_create_questions.rb | 53 ---------------- .../20200124125908_create_source_books.rb | 40 ------------ .../20200124131038_create_question_choices.rb | 19 ------ ...00125120734_create_open_ended_questions.rb | 54 ---------------- 13 files changed, 370 deletions(-) delete mode 100644 app/controllers/quba/questions_controller.rb delete mode 100644 app/models/open_ended_question.rb delete mode 100644 app/models/question.rb delete mode 100644 app/models/question_choice.rb delete mode 100644 app/models/source_book.rb delete mode 100644 db/migrate/20200112141809_create_targets.rb delete mode 100644 db/migrate/20200124111848_create_questions.rb delete mode 100644 db/migrate/20200124125908_create_source_books.rb delete mode 100644 db/migrate/20200124131038_create_question_choices.rb delete mode 100644 db/migrate/20200125120734_create_open_ended_questions.rb diff --git a/app/controllers/quba/questions_controller.rb b/app/controllers/quba/questions_controller.rb deleted file mode 100644 index 4beb71c16..000000000 --- a/app/controllers/quba/questions_controller.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -module Quba - class QuestionsController < ApplicationController - include SearchableModule - - def index - end - end -end diff --git a/app/models/course.rb b/app/models/course.rb index ddf6ab227..3d260eee6 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -28,7 +28,6 @@ class Course < ApplicationRecord belongs_to :unit has_many :curriculum_courses, dependent: :destroy has_many :available_courses, through: :curriculum_courses - has_many :targets, dependent: :delete_all # validations validates :code, presence: true, uniqueness: true, length: { maximum: 255 } diff --git a/app/models/open_ended_question.rb b/app/models/open_ended_question.rb deleted file mode 100644 index d5f5bb401..000000000 --- a/app/models/open_ended_question.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -class OpenEndedQuestion < ApplicationRecord - enum status: [:draft, :editor, :master, :approve] - - belongs_to :icc - belongs_to :author, foreign_key: :author_id, class_name: 'User' - belongs_to :editor, foreign_key: :editor_id, class_name: 'User' - belongs_to :master, foreign_key: :master_id, class_name: 'User' - belongs_to :parent, foreign_key: :parent_id, class_name: 'OpenEndedQuestion' - belongs_to :unit - belongs_to :source_book - - validates :unit_id, presence: true - validates :icc_id, presence: true - validates :author_id, presence: true - validates :editor_id, numericality: { allow_nil: true } - validates :master_id, numericality: { allow_nil: true } - validates :parent_id, numericality: { allow_nil: true } - validates :source_book_id, presence: true - validates :use_count, numericality: { only_integer: true, greater_than_or_equal_to: 0 } - validates :bloom, inclusion: { in: (1..6) } - validates :degree, inclusion: { in: (1..5) } - validates :lang, inclusion: { in: [0, 1] } - validates :image, length: { maximum: 1.megabytes, message: 'Maximum 1MB', if: :image? } - validates :title, presence: true - validates :answer, presence: true - validates :explanation, length: { maximum: 400 } - - before_save lambda { - if title.presence - title_ = title.gsub(' ', '') - title_ = ActionController::Base.helpers.sanitize(title_, tags: %w[p u ul li]) - self.title = title_.squish - end - - if answer.presence - answer_ = answer.gsub(' ', '') - answer_ = ActionController::Base.helpers.sanitize(answer_, tags: %w[p u ul li]) - self.answer = answer_.squish - end - - self.explanation = explanation.squish if explanation.presence - } - - mount_uploader :image, QuestionImageUploader - - def self.degrees - (1..5) - end - - def self.blooms - (1..6) - end -end diff --git a/app/models/question.rb b/app/models/question.rb deleted file mode 100644 index 222961b7c..000000000 --- a/app/models/question.rb +++ /dev/null @@ -1,63 +0,0 @@ -# frozen_string_literal: true - -class Question < ApplicationRecord - enum status: [:draft, :editor, :master, :approve] - - belongs_to :icc - belongs_to :answer, foreign_key: :answer_id, class_name: 'QuestionChoice' - belongs_to :author, foreign_key: :author_id, class_name: 'User' - belongs_to :editor, foreign_key: :editor_id, class_name: 'User' - belongs_to :master, foreign_key: :master_id, class_name: 'User' - belongs_to :parent, foreign_key: :parent_id, class_name: 'Question' - belongs_to :unit - belongs_to :source_book - - has_many :question_choices, dependent: :delete_all - - validates :unit_id, presence: true - validates :icc_id, presence: true - validates :author_id, presence: true - validates :editor_id, numericality: { allow_nil: true } - validates :master_id, numericality: { allow_nil: true } - validates :parent_id, numericality: { allow_nil: true } - validates :source_book_id, presence: true - validates :use_count, numericality: { only_integer: true, greater_than_or_equal_to: 0 } - validates :bloom, inclusion: { in: (1..6) } - validates :degree, inclusion: { in: (1..5) } - validates :lang, inclusion: { in: [0, 1] } - validates :image, length: { maximum: 1.megabytes, message: 'Maximum 1MB', if: :image? } - validates :title, presence: true - validates :explanation, length: { maximum: 400 } - - accepts_nested_attributes_for :question_choices, - allow_destroy: true, - reject_if: proc { |a| a[:content].blank? } - - before_save lambda { - if title.presence - title_ = title.gsub(' ', '') - title_ = ActionController::Base.helpers.sanitize(title_, tags: %w[p u ul li]) - self.title = title_.squish - end - - self.explanation = explanation.squish if explanation.presence - } - - mount_uploader :image, QuestionImageUploader - - def build_choices(choice_count = 5) - choice_count.times { question_choices.build } - end - - def set_answer - update(answer_id: question_choices.first.id) - end - - def self.degrees - (1..5) - end - - def self.blooms - (1..6) - end -end diff --git a/app/models/question_choice.rb b/app/models/question_choice.rb deleted file mode 100644 index 2a34a5384..000000000 --- a/app/models/question_choice.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class QuestionChoice < ApplicationRecord - belongs_to :question - - validates :content, length: { maximum: 500 } - - before_save lambda { - self.content = content.squish if content.presence - } -end diff --git a/app/models/source_book.rb b/app/models/source_book.rb deleted file mode 100644 index 32a682cee..000000000 --- a/app/models/source_book.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -class SourceBook < ApplicationRecord - enum status: [:inactive, :active] - - belongs_to :unit - - has_many :questions - - validates :unit_id, presence: true - - validates :edition, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 1 } - validates :publish_year, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 } - validates :name, presence: true, length: { maximum: 100 } - validates :isbn, presence: true, length: { maximum: 50 } - validates :author, presence: true, length: { maximum: 150 } - validates :image, length: { maximum: 1.megabytes, message: 'Maximum 1MB', if: :image? } - validates :explanation, length: { maximum: 400 } - - mount_uploader :image, SourceBookImageUploader - - before_save lambda { - self.name = name.squish if name.presence - self.isbn = isbn.delete(' ') if isbn.presence - self.author = author.squish if author.presence - self.explanation = explanation.squish if explanation.presence - } - - def self.editions - (1..40) - end - - def self.years - (1900..Time.current.year).to_a.reverse - end -end diff --git a/app/models/unit.rb b/app/models/unit.rb index 0d2fb3842..42b226263 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -27,7 +27,6 @@ class Unit < ApplicationRecord belongs_to :unit_instruction_type, optional: true belongs_to :unit_instruction_language, optional: true belongs_to :university_type, optional: true - has_many :duties, dependent: :destroy has_many :employees, through: :duties has_many :students, dependent: :nullify @@ -49,9 +48,6 @@ class Unit < ApplicationRecord has_many :unit_calendars, dependent: :destroy has_many :calendars, through: :unit_calendars has_many :snccs, dependent: :destroy - has_many :source_books, dependent: :destroy - has_many :questions, dependent: :destroy - has_many :open_ended_questions, dependent: :destroy # validations validates :name, presence: true, diff --git a/app/models/user.rb b/app/models/user.rb index 85085f013..74a5a51d7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -34,7 +34,6 @@ class User < ApplicationRecord # relations has_one_attached :avatar - has_many :academic_credentials, dependent: :destroy has_many :addresses, dependent: :destroy has_many :articles, dependent: :destroy @@ -59,12 +58,6 @@ class User < ApplicationRecord foreign_key: :id_number, dependent: :nullify, inverse_of: :user - has_many :author_questions, dependent: :destroy, foreign_key: :author_id, class_name: 'Question' - has_many :editor_questions, dependent: :destroy, foreign_key: :editor_id, class_name: 'Question' - has_many :master_questions, dependent: :destroy, foreign_key: :master_id, class_name: 'Question' - has_many :author_open_ended_questions, dependent: :destroy, foreign_key: :author_id, class_name: 'OpenEndedQuestion' - has_many :editor_open_ended_questions, dependent: :destroy, foreign_key: :editor_id, class_name: 'OpenEndedQuestion' - has_many :master_open_ended_questions, dependent: :destroy, foreign_key: :master_id, class_name: 'OpenEndedQuestion' # validations validates :email, presence: true, uniqueness: true, length: { maximum: 255 }, 'valid_email_2/email': { diff --git a/db/migrate/20200112141809_create_targets.rb b/db/migrate/20200112141809_create_targets.rb deleted file mode 100644 index ee01cdeaa..000000000 --- a/db/migrate/20200112141809_create_targets.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CreateTargets < ActiveRecord::Migration[6.0] - def change - create_table :targets do |t| - t.integer :course_id - t.integer :icc_id - - t.timestamps - end - - add_length_constraint :targets, :course_id, greater_than_or_equal_to: 0 - add_length_constraint :targets, :icc_id, greater_than_or_equal_to: 0 - - add_unique_constraint :targets, [:course_id, :icc_id] - end -end diff --git a/db/migrate/20200124111848_create_questions.rb b/db/migrate/20200124111848_create_questions.rb deleted file mode 100644 index 71d0e039e..000000000 --- a/db/migrate/20200124111848_create_questions.rb +++ /dev/null @@ -1,53 +0,0 @@ -class CreateQuestions < ActiveRecord::Migration[6.0] - def change - create_table :questions do |t| - t.integer :unit_id - t.integer :icc_id - t.integer :answer_id, default: 0 - t.integer :author_id - t.integer :editor_id - t.integer :master_id - t.integer :parent_id - t.integer :source_book_id - t.integer :use_count, default: 0 - t.integer :bloom, default: 1 - t.integer :degree, default: 1 - t.integer :lang, default: 0 - t.string :image - t.text :title - t.string :explanation - t.integer :status, default: 0 - - t.timestamps - end - - add_index :questions, :unit_id - add_index :questions, :author_id - add_index :questions, :editor_id - add_index :questions, :master_id - - add_length_constraint :questions, :title, less_than_or_equal_to: 255 - add_length_constraint :questions, :explanation, less_than_or_equal_to: 400 - - add_numericality_constraint :questions, :unit_id, greater_than_or_equal_to: 0 - add_numericality_constraint :questions, :icc_id, greater_than_or_equal_to: 0 - add_numericality_constraint :questions, :answer_id, greater_than_or_equal_to: 0 - add_numericality_constraint :questions, :author_id, greater_than_or_equal_to: 0 - add_numericality_constraint :questions, :editor_id, greater_than_or_equal_to: 0 - add_numericality_constraint :questions, :master_id, greater_than_or_equal_to: 0 - add_numericality_constraint :questions, :parent_id, greater_than_or_equal_to: 0 - add_numericality_constraint :questions, :source_book_id, greater_than_or_equal_to: 0 - - add_presence_constraint :questions, :unit_id - add_presence_constraint :questions, :icc_id - add_presence_constraint :questions, :answer_id - add_presence_constraint :questions, :author_id - add_presence_constraint :questions, :source_book_id - add_presence_constraint :questions, :use_count - add_presence_constraint :questions, :bloom - add_presence_constraint :questions, :degree - add_presence_constraint :questions, :lang - add_presence_constraint :questions, :title - add_presence_constraint :questions, :status - end -end diff --git a/db/migrate/20200124125908_create_source_books.rb b/db/migrate/20200124125908_create_source_books.rb deleted file mode 100644 index 57b3bb270..000000000 --- a/db/migrate/20200124125908_create_source_books.rb +++ /dev/null @@ -1,40 +0,0 @@ -class CreateSourceBooks < ActiveRecord::Migration[6.0] - def change - create_table :source_books do |t| - t.integer :unit_id - t.integer :status, default: 0 - t.integer :editon - t.integer :publish_year - t.string :name - t.string :isbn - t.string :author - t.string :image - t.string :explanation - - t.timestamps - end - - add_index :source_books, :unit_id - add_index :source_books, :name - add_index :source_books, :isbn - add_index :source_books, :author - - add_length_constraint :source_books, :name, less_than_or_equal_to: 100 - add_length_constraint :source_books, :isbn, less_than_or_equal_to: 50 - add_length_constraint :source_books, :author, less_than_or_equal_to: 150 - add_length_constraint :source_books, :image, less_than_or_equal_to: 100 - add_length_constraint :source_books, :explanation, less_than_or_equal_to: 400 - - add_numericality_constraint :source_books, :unit_id, greater_than_or_equal_to: 0 - - add_presence_constraint :source_books, :unit_id - add_presence_constraint :source_books, :status - add_presence_constraint :source_books, :editon - add_presence_constraint :source_books, :publish_year - add_presence_constraint :source_books, :name - add_presence_constraint :source_books, :isbn - add_presence_constraint :source_books, :author - add_presence_constraint :source_books, :image - add_presence_constraint :source_books, :explanation - end -end diff --git a/db/migrate/20200124131038_create_question_choices.rb b/db/migrate/20200124131038_create_question_choices.rb deleted file mode 100644 index 1d930401c..000000000 --- a/db/migrate/20200124131038_create_question_choices.rb +++ /dev/null @@ -1,19 +0,0 @@ -class CreateQuestionChoices < ActiveRecord::Migration[6.0] - def change - create_table :question_choices do |t| - t.integer :question_id - t.string :content - - t.timestamps - end - - add_index :question_choices, :question_id - - add_length_constraint :question_choices, :content, less_than_or_equal_to: 500 - - add_numericality_constraint :question_choices, :question_id, greater_than_or_equal_to: 0 - - add_presence_constraint :question_choices, :question_id - add_presence_constraint :question_choices, :content - end -end diff --git a/db/migrate/20200125120734_create_open_ended_questions.rb b/db/migrate/20200125120734_create_open_ended_questions.rb deleted file mode 100644 index 2d662abea..000000000 --- a/db/migrate/20200125120734_create_open_ended_questions.rb +++ /dev/null @@ -1,54 +0,0 @@ -class CreateOpenEndedQuestions < ActiveRecord::Migration[6.0] - def change - create_table :open_ended_questions do |t| - t.integer :unit_id - t.integer :icc_id - t.integer :author_id - t.integer :editor_id - t.integer :master_id - t.integer :parent_id - t.integer :source_book_id - t.integer :use_count, default: 0 - t.integer :bloom, default: 1 - t.integer :degree, default: 1 - t.integer :lang, default: 0 - t.string :image - t.text :title - t.text :answer - t.string :explanation - t.integer :status, default: 0 - - t.timestamps - end - - add_index :open_ended_questions, :unit_id - add_index :open_ended_questions, :author_id - add_index :open_ended_questions, :editor_id - add_index :open_ended_questions, :master_id - - add_length_constraint :open_ended_questions, :title, greater_than: 0 - add_length_constraint :open_ended_questions, :answer, greater_than: 0 - add_length_constraint :open_ended_questions, :explanation, less_than_or_equal_to: 400 - - add_numericality_constraint :open_ended_questions, :unit_id, greater_than_or_equal_to: 0 - add_numericality_constraint :open_ended_questions, :icc_id, greater_than_or_equal_to: 0 - add_numericality_constraint :open_ended_questions, :answer_id, greater_than_or_equal_to: 0 - add_numericality_constraint :open_ended_questions, :author_id, greater_than_or_equal_to: 0 - add_numericality_constraint :open_ended_questions, :editor_id, greater_than_or_equal_to: 0 - add_numericality_constraint :open_ended_questions, :master_id, greater_than_or_equal_to: 0 - add_numericality_constraint :open_ended_questions, :parent_id, greater_than_or_equal_to: 0 - add_numericality_constraint :open_ended_questions, :source_book_id, greater_than_or_equal_to: 0 - - add_presence_constraint :open_ended_questions, :unit_id - add_presence_constraint :open_ended_questions, :icc_id - add_presence_constraint :open_ended_questions, :answer_id - add_presence_constraint :open_ended_questions, :author_id - add_presence_constraint :open_ended_questions, :source_book_id - add_presence_constraint :open_ended_questions, :use_count - add_presence_constraint :open_ended_questions, :bloom - add_presence_constraint :open_ended_questions, :degree - add_presence_constraint :open_ended_questions, :lang - add_presence_constraint :open_ended_questions, :title - add_presence_constraint :open_ended_questions, :status - end -end From 240d013ea75fea66b6d3cd07372998a28b4b8fde Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 5 Mar 2020 13:46:53 +0300 Subject: [PATCH 378/970] Remove test about question bank module --- test/fixtures/open_ended_questions.yml | 37 ------------------------- test/fixtures/question_choices.yml | 9 ------ test/fixtures/questions.yml | 37 ------------------------- test/fixtures/source_books.yml | 23 --------------- test/fixtures/targets.yml | 9 ------ test/models/open_ended_question_test.rb | 7 ----- test/models/question_choice_test.rb | 7 ----- test/models/question_test.rb | 7 ----- test/models/source_book_test.rb | 7 ----- test/models/target_test.rb | 7 ----- 10 files changed, 150 deletions(-) delete mode 100644 test/fixtures/open_ended_questions.yml delete mode 100644 test/fixtures/question_choices.yml delete mode 100644 test/fixtures/questions.yml delete mode 100644 test/fixtures/source_books.yml delete mode 100644 test/fixtures/targets.yml delete mode 100644 test/models/open_ended_question_test.rb delete mode 100644 test/models/question_choice_test.rb delete mode 100644 test/models/question_test.rb delete mode 100644 test/models/source_book_test.rb delete mode 100644 test/models/target_test.rb diff --git a/test/fixtures/open_ended_questions.yml b/test/fixtures/open_ended_questions.yml deleted file mode 100644 index 2d2fb91c4..000000000 --- a/test/fixtures/open_ended_questions.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - unit_id: 1 - icc_id: 1 - author_id: 1 - editor_id: 1 - master_id: 1 - parent_id: 1 - source_book_id: 1 - use_count: 1 - bloom: 1 - degree: 1 - lang: 1 - image: MyString - title: MyText - answer: MyText - explanation: MyString - status: 1 - -two: - unit_id: 1 - icc_id: 1 - author_id: 1 - editor_id: 1 - master_id: 1 - parent_id: 1 - source_book_id: 1 - use_count: 1 - bloom: 1 - degree: 1 - lang: 1 - image: MyString - title: MyText - answer: MyText - explanation: MyString - status: 1 diff --git a/test/fixtures/question_choices.yml b/test/fixtures/question_choices.yml deleted file mode 100644 index 37373cff0..000000000 --- a/test/fixtures/question_choices.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - question_id: 1 - content: MyString - -two: - question_id: 1 - content: MyString diff --git a/test/fixtures/questions.yml b/test/fixtures/questions.yml deleted file mode 100644 index cc2cd45c7..000000000 --- a/test/fixtures/questions.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - unit_id: 1 - icc_id: 1 - answer_id: 1 - author_id: 1 - editor_id: 1 - master_id: 1 - parent_id: 1 - source_book_id: 1 - use_count: 1 - bloom: 1 - degree: 1 - lang: 1 - image: MyString - title: MyText - explanation: MyString - status: 1 - -two: - unit_id: 1 - icc_id: 1 - answer_id: 1 - author_id: 1 - editor_id: 1 - master_id: 1 - parent_id: 1 - source_book_id: 1 - use_count: 1 - bloom: 1 - degree: 1 - lang: 1 - image: MyString - title: MyText - explanation: MyString - status: 1 diff --git a/test/fixtures/source_books.yml b/test/fixtures/source_books.yml deleted file mode 100644 index 256f3659e..000000000 --- a/test/fixtures/source_books.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - unit_id: 1 - status: 1 - editon: 1 - publish_year: 1 - name: MyString - isbn: MyString - author: MyString - image: MyString - explanation: MyString - -two: - unit_id: 1 - status: 1 - editon: 1 - publish_year: 1 - name: MyString - isbn: MyString - author: MyString - image: MyString - explanation: MyString diff --git a/test/fixtures/targets.yml b/test/fixtures/targets.yml deleted file mode 100644 index 14492c37c..000000000 --- a/test/fixtures/targets.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - course_id: 1 - icc_id: 1 - -two: - course_id: 1 - icc_id: 1 diff --git a/test/models/open_ended_question_test.rb b/test/models/open_ended_question_test.rb deleted file mode 100644 index d56167bf4..000000000 --- a/test/models/open_ended_question_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class OpenEndedQuestionTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/question_choice_test.rb b/test/models/question_choice_test.rb deleted file mode 100644 index 29456ee56..000000000 --- a/test/models/question_choice_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class QuestionChoiceTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/question_test.rb b/test/models/question_test.rb deleted file mode 100644 index 88f6ea7fa..000000000 --- a/test/models/question_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class QuestionTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/source_book_test.rb b/test/models/source_book_test.rb deleted file mode 100644 index 2c2f9a635..000000000 --- a/test/models/source_book_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class SourceBookTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/target_test.rb b/test/models/target_test.rb deleted file mode 100644 index fb4f2c3be..000000000 --- a/test/models/target_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class TargetTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end From ecf3e5f1e4d755a98e5086e28a06653601766e5d Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 5 Mar 2020 15:10:33 +0300 Subject: [PATCH 379/970] Refactor standard migration --- ...create_standards.rb => 20200305103056_create_standards.rb} | 4 ---- 1 file changed, 4 deletions(-) rename db/migrate/{20200112122101_create_standards.rb => 20200305103056_create_standards.rb} (87%) diff --git a/db/migrate/20200112122101_create_standards.rb b/db/migrate/20200305103056_create_standards.rb similarity index 87% rename from db/migrate/20200112122101_create_standards.rb rename to db/migrate/20200305103056_create_standards.rb index 125e47183..5098fc5ad 100644 --- a/db/migrate/20200112122101_create_standards.rb +++ b/db/migrate/20200305103056_create_standards.rb @@ -10,10 +10,6 @@ def change t.timestamps null: false end - add_index :standards, :version - add_index :standards, :name_tr - add_index :standards, :name_en - add_length_constraint :standards, :version, less_than_or_equal_to: 50 add_length_constraint :standards, :name_tr, less_than_or_equal_to: 255 add_length_constraint :standards, :name_en, less_than_or_equal_to: 255 From 3bea9ea92e9cdc8cedc66e91fa2a8ca62d20633f Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 5 Mar 2020 15:16:33 +0300 Subject: [PATCH 380/970] Replace icc & sncc models with outcome model --- app/models/icc.rb | 13 ------- app/models/outcome.rb | 11 ++++++ app/models/sncc.rb | 13 ------- db/migrate/20200112133316_create_snccs.rb | 27 -------------- db/migrate/20200112140816_create_iccs.rb | 38 -------------------- db/migrate/20200305120339_create_outcomes.rb | 23 ++++++++++++ 6 files changed, 34 insertions(+), 91 deletions(-) delete mode 100644 app/models/icc.rb create mode 100644 app/models/outcome.rb delete mode 100644 app/models/sncc.rb delete mode 100644 db/migrate/20200112133316_create_snccs.rb delete mode 100644 db/migrate/20200112140816_create_iccs.rb create mode 100644 db/migrate/20200305120339_create_outcomes.rb diff --git a/app/models/icc.rb b/app/models/icc.rb deleted file mode 100644 index e44bd4969..000000000 --- a/app/models/icc.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class Icc < ApplicationRecord - belongs_to :sncc - - has_many :targets, dependent: :delete_all - - validates :unit_id, presence: true - validates :sncc_id, presence: true - validates :code, presence: true, length: { maximum: 10 } - validates :name_tr, presence: true, length: { maximum: 255 } - validates :name_en, presence: true, length: { maximum: 255 } -end diff --git a/app/models/outcome.rb b/app/models/outcome.rb new file mode 100644 index 000000000..8fa6edd4b --- /dev/null +++ b/app/models/outcome.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class Outcome < ApplicationRecord + # relations + belongs_to :unit + + # validations + validates :code, presence: true, uniqueness: { scope: :unit_id }, length: { maximum: 10 } + validates :name_tr, presence: true, length: { maximum: 255 } + validates :name_en, presence: true, length: { maximum: 255 } +end diff --git a/app/models/sncc.rb b/app/models/sncc.rb deleted file mode 100644 index b513950e9..000000000 --- a/app/models/sncc.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class Sncc < ApplicationRecord - belongs_to :unit - belongs_to :standard - - has_many :iccs, dependent: :destroy - - validates :unit_id, presence: true - validates :code, presence: true, length: { maximum: 10 } - validates :name_tr, presence: true, length: { maximum: 255 } - validates :name_en, presence: true, length: { maximum: 255 } -end diff --git a/db/migrate/20200112133316_create_snccs.rb b/db/migrate/20200112133316_create_snccs.rb deleted file mode 100644 index 699ca2911..000000000 --- a/db/migrate/20200112133316_create_snccs.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class CreateSnccs < ActiveRecord::Migration[6.0] - def change - create_table :snccs do |t| - t.integer :unit_id - t.integer :standard_id - t.string :code - t.string :name_tr - t.string :name_en - - t.timestamps null: false - end - - add_length_constraint :snccs, :unit_id, greater_than_or_equal_to: 0 - add_length_constraint :snccs, :standard_id, greater_than_or_equal_to: 0 - add_length_constraint :snccs, :code, less_than_or_equal_to: 10 - add_length_constraint :snccs, :name_tr, less_than_or_equal_to: 255 - add_length_constraint :snccs, :name_en, less_than_or_equal_to: 255 - - add_presence_constraint :snccs, :code - add_presence_constraint :snccs, :name_tr - add_presence_constraint :snccs, :name_en - - add_unique_constraint :snccs, [:unit_id, :code] - end -end diff --git a/db/migrate/20200112140816_create_iccs.rb b/db/migrate/20200112140816_create_iccs.rb deleted file mode 100644 index b1ee48f5c..000000000 --- a/db/migrate/20200112140816_create_iccs.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -class CreateIccs < ActiveRecord::Migration[6.0] - def change - create_table :iccs do |t| - t.integer :unit_id - t.integer :sncc_id - t.string :code - t.string :name_tr - t.string :name_en - - t.timestamps - end - - add_index :iccs, :unit_id - add_index :iccs, :sncc_id - add_index :iccs, :code - - add_length_constraint :iccs, :unit_id, greater_than_or_equal_to: 0 - add_length_constraint :iccs, :sncc_id, greater_than_or_equal_to: 0 - add_length_constraint :iccs, :code, less_than_or_equal_to: 255 - add_length_constraint :iccs, :name_tr, less_than_or_equal_to: 255 - add_length_constraint :iccs, :name_en, less_than_or_equal_to: 255 - - add_numericality_constraint :iccs, :unit_id, - greater_than_or_equal_to: 0 - add_numericality_constraint :iccs, :sncc_id, - greater_than_or_equal_to: 0 - - add_presence_constraint :iccs, :unit_id - add_presence_constraint :iccs, :sncc_id - add_presence_constraint :iccs, :code - add_presence_constraint :iccs, :name_tr - add_presence_constraint :iccs, :name_en - - add_unique_constraint :iccs, [:unit_id, :sncc_id, :code] - end -end diff --git a/db/migrate/20200305120339_create_outcomes.rb b/db/migrate/20200305120339_create_outcomes.rb new file mode 100644 index 000000000..0662b148f --- /dev/null +++ b/db/migrate/20200305120339_create_outcomes.rb @@ -0,0 +1,23 @@ +class CreateOutcomes < ActiveRecord::Migration[6.0] + def change + create_table :outcomes do |t| + t.references :unit, null: false, foreign_key: true + t.references :parent, foreign_key: { to_table: :outcomes } + t.string :code + t.string :name_tr + t.string :name_en + + t.timestamps + end + + add_length_constraint :outcomes, :code, less_than_or_equal_to: 10 + add_length_constraint :outcomes, :name_tr, less_than_or_equal_to: 255 + add_length_constraint :outcomes, :name_en, less_than_or_equal_to: 255 + + add_presence_constraint :outcomes, :code + add_presence_constraint :outcomes, :name_tr + add_presence_constraint :outcomes, :name_en + + add_unique_constraint :outcomes, [:unit_id, :code] + end +end From c8a18939a45c25657e2b7c49d210a9609ae756bc Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 5 Mar 2020 15:17:32 +0300 Subject: [PATCH 381/970] Add uniqueness validations and remove relation --- app/models/standard.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/standard.rb b/app/models/standard.rb index cf48140a9..10eb7e74e 100644 --- a/app/models/standard.rb +++ b/app/models/standard.rb @@ -1,9 +1,8 @@ # frozen_string_literal: true class Standard < ApplicationRecord - has_many :snccs - + # validations validates :version, presence: true, length: { maximum: 50 } - validates :name_tr, presence: true, length: { maximum: 255 } - validates :name_en, presence: true, length: { maximum: 255 } + validates :name_tr, presence: true, uniqueness: { scope: :version }, length: { maximum: 255 } + validates :name_en, presence: true, uniqueness: { scope: :version }, length: { maximum: 255 } end From d9eff7d29ad884ad40f8b7ff40104ac9eb1f4f48 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 5 Mar 2020 15:18:23 +0300 Subject: [PATCH 382/970] Add structure.sql --- db/structure.sql | 168 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 167 insertions(+), 1 deletion(-) diff --git a/db/structure.sql b/db/structure.sql index c43740386..19825f9dd 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -2250,6 +2250,47 @@ CREATE SEQUENCE public.meeting_agendas_id_seq ALTER SEQUENCE public.meeting_agendas_id_seq OWNED BY public.meeting_agendas.id; +-- +-- Name: outcomes; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.outcomes ( + id bigint NOT NULL, + unit_id bigint NOT NULL, + parent_id bigint, + code character varying, + name_tr character varying, + name_en character varying, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL, + CONSTRAINT outcomes_code_length CHECK ((length((code)::text) <= 10)), + CONSTRAINT outcomes_code_presence CHECK (((code IS NOT NULL) AND ((code)::text !~ '^\s*$'::text))), + CONSTRAINT outcomes_name_en_length CHECK ((length((name_en)::text) <= 255)), + CONSTRAINT outcomes_name_en_presence CHECK (((name_en IS NOT NULL) AND ((name_en)::text !~ '^\s*$'::text))), + CONSTRAINT outcomes_name_tr_length CHECK ((length((name_tr)::text) <= 255)), + CONSTRAINT outcomes_name_tr_presence CHECK (((name_tr IS NOT NULL) AND ((name_tr)::text !~ '^\s*$'::text))) +); + + +-- +-- Name: outcomes_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.outcomes_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: outcomes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.outcomes_id_seq OWNED BY public.outcomes.id; + + -- -- Name: papers; Type: TABLE; Schema: public; Owner: - -- @@ -3008,6 +3049,45 @@ CREATE SEQUENCE public.semester_registrations_id_seq ALTER SEQUENCE public.semester_registrations_id_seq OWNED BY public.semester_registrations.id; +-- +-- Name: standards; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.standards ( + id bigint NOT NULL, + version character varying, + name_tr character varying, + name_en character varying, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL, + CONSTRAINT standards_name_en_length CHECK ((length((name_en)::text) <= 255)), + CONSTRAINT standards_name_en_presence CHECK (((name_en IS NOT NULL) AND ((name_en)::text !~ '^\s*$'::text))), + CONSTRAINT standards_name_tr_length CHECK ((length((name_tr)::text) <= 255)), + CONSTRAINT standards_name_tr_presence CHECK (((name_tr IS NOT NULL) AND ((name_tr)::text !~ '^\s*$'::text))), + CONSTRAINT standards_version_length CHECK ((length((version)::text) <= 50)), + CONSTRAINT standards_version_presence CHECK (((version IS NOT NULL) AND ((version)::text !~ '^\s*$'::text))) +); + + +-- +-- Name: standards_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.standards_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: standards_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.standards_id_seq OWNED BY public.standards.id; + + -- -- Name: student_disability_types; Type: TABLE; Schema: public; Owner: - -- @@ -4179,6 +4259,13 @@ ALTER TABLE ONLY public.ldap_sync_errors ALTER COLUMN id SET DEFAULT nextval('pu ALTER TABLE ONLY public.meeting_agendas ALTER COLUMN id SET DEFAULT nextval('public.meeting_agendas_id_seq'::regclass); +-- +-- Name: outcomes id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.outcomes ALTER COLUMN id SET DEFAULT nextval('public.outcomes_id_seq'::regclass); + + -- -- Name: papers id; Type: DEFAULT; Schema: public; Owner: - -- @@ -4291,6 +4378,13 @@ ALTER TABLE ONLY public.sdp_codes ALTER COLUMN id SET DEFAULT nextval('public.sd ALTER TABLE ONLY public.semester_registrations ALTER COLUMN id SET DEFAULT nextval('public.semester_registrations_id_seq'::regclass); +-- +-- Name: standards id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.standards ALTER COLUMN id SET DEFAULT nextval('public.standards_id_seq'::regclass); + + -- -- Name: student_disability_types id; Type: DEFAULT; Schema: public; Owner: - -- @@ -4982,6 +5076,22 @@ ALTER TABLE ONLY public.meeting_agendas ADD CONSTRAINT meeting_agendas_pkey PRIMARY KEY (id); +-- +-- Name: outcomes outcomes_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.outcomes + ADD CONSTRAINT outcomes_pkey PRIMARY KEY (id); + + +-- +-- Name: outcomes outcomes_unit_id_code_unique; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.outcomes + ADD CONSTRAINT outcomes_unit_id_code_unique UNIQUE (unit_id, code) DEFERRABLE; + + -- -- Name: papers papers_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -5134,6 +5244,30 @@ ALTER TABLE ONLY public.semester_registrations ADD CONSTRAINT semester_registrations_pkey PRIMARY KEY (id); +-- +-- Name: standards standards_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.standards + ADD CONSTRAINT standards_pkey PRIMARY KEY (id); + + +-- +-- Name: standards standards_version_name_en_unique; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.standards + ADD CONSTRAINT standards_version_name_en_unique UNIQUE (version, name_en) DEFERRABLE; + + +-- +-- Name: standards standards_version_name_tr_unique; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.standards + ADD CONSTRAINT standards_version_name_tr_unique UNIQUE (version, name_tr) DEFERRABLE; + + -- -- Name: student_disability_types student_disability_types_code_unique; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -6058,6 +6192,20 @@ CREATE INDEX index_meeting_agendas_on_agenda_id ON public.meeting_agendas USING CREATE INDEX index_meeting_agendas_on_committee_meeting_id ON public.meeting_agendas USING btree (committee_meeting_id); +-- +-- Name: index_outcomes_on_parent_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_outcomes_on_parent_id ON public.outcomes USING btree (parent_id); + + +-- +-- Name: index_outcomes_on_unit_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_outcomes_on_unit_id ON public.outcomes USING btree (unit_id); + + -- -- Name: index_papers_on_country_id; Type: INDEX; Schema: public; Owner: - -- @@ -6569,6 +6717,14 @@ ALTER TABLE ONLY public.articles ADD CONSTRAINT fk_rails_3d31dad1cc FOREIGN KEY (user_id) REFERENCES public.users(id); +-- +-- Name: outcomes fk_rails_3ea0ff4a78; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.outcomes + ADD CONSTRAINT fk_rails_3ea0ff4a78 FOREIGN KEY (parent_id) REFERENCES public.outcomes(id); + + -- -- Name: duties fk_rails_3f1a2d48dd; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -6729,6 +6885,14 @@ ALTER TABLE ONLY public.calendar_events ADD CONSTRAINT fk_rails_64d7b22524 FOREIGN KEY (calendar_event_type_id) REFERENCES public.calendar_event_types(id); +-- +-- Name: outcomes fk_rails_670b6764c7; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.outcomes + ADD CONSTRAINT fk_rails_670b6764c7 FOREIGN KEY (unit_id) REFERENCES public.units(id); + + -- -- Name: meeting_agendas fk_rails_694b3fc610; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7373,6 +7537,8 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200213110520'), ('20200213124638'), ('20200215132359'), -('20200217110305'); +('20200217110305'), +('20200305103056'), +('20200305120339'); From 552b90c15a229cf64a108a1ab9e21d6f69b47801 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 5 Mar 2020 15:42:02 +0300 Subject: [PATCH 383/970] Remove unneeded tests and fixtures --- app/models/target.rb | 9 --------- test/fixtures/iccs.yml | 15 --------------- test/fixtures/snccs.yml | 15 --------------- test/models/icc_test.rb | 7 ------- test/models/sncc_test.rb | 7 ------- 5 files changed, 53 deletions(-) delete mode 100644 app/models/target.rb delete mode 100644 test/fixtures/iccs.yml delete mode 100644 test/fixtures/snccs.yml delete mode 100644 test/models/icc_test.rb delete mode 100644 test/models/sncc_test.rb diff --git a/app/models/target.rb b/app/models/target.rb deleted file mode 100644 index 8d6478faf..000000000 --- a/app/models/target.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class Target < ApplicationRecord - belongs_to :course - belongs_to :icc - - validates :course_id, presence: true - validates :icc_id, presence: true, uniqueness: { scope: :course_id } -end diff --git a/test/fixtures/iccs.yml b/test/fixtures/iccs.yml deleted file mode 100644 index 43d347e1a..000000000 --- a/test/fixtures/iccs.yml +++ /dev/null @@ -1,15 +0,0 @@ -# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - institution_id: 1 - sncc_id: 1 - code: MyString - name_tr: MyString - name_en: MyString - -two: - institution_id: 1 - sncc_id: 1 - code: MyString - name_tr: MyString - name_en: MyString diff --git a/test/fixtures/snccs.yml b/test/fixtures/snccs.yml deleted file mode 100644 index 2015dcc70..000000000 --- a/test/fixtures/snccs.yml +++ /dev/null @@ -1,15 +0,0 @@ -# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - unit_id: 1 - standard_id: 1 - code: MyString - name_tr: MyString - name_en: MyString - -two: - unit_id: 1 - standard_id: 1 - code: MyString - name_tr: MyString - name_en: MyString diff --git a/test/models/icc_test.rb b/test/models/icc_test.rb deleted file mode 100644 index 9d6f3348d..000000000 --- a/test/models/icc_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class IccTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/sncc_test.rb b/test/models/sncc_test.rb deleted file mode 100644 index f84be4d60..000000000 --- a/test/models/sncc_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class SnccTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end From f71d1ea92f6eb425c5f54e7dbb4266f7180bc2f0 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 5 Mar 2020 15:42:47 +0300 Subject: [PATCH 384/970] Correct relation --- app/models/unit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/unit.rb b/app/models/unit.rb index 0c836d4b1..e6e4dd1f9 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -49,7 +49,7 @@ class Unit < ApplicationRecord has_many :calendars, through: :unit_calendars has_many :unit_tuitions, dependent: :destroy has_many :tuitions, through: :unit_tuitions - has_many :snccs, dependent: :destroy + has_many :outcomes, dependent: :destroy # validations validates :name, presence: true, From cb112a33b813808643445163230a3b0d67b4535e Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 5 Mar 2020 15:46:25 +0300 Subject: [PATCH 385/970] Fix test files --- test/fixtures/outcomes.yml | 5 +++++ test/fixtures/standards.yml | 17 ++++------------- test/models/outcome_test.rb | 6 ++++++ test/models/standard_test.rb | 5 ++--- 4 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 test/fixtures/outcomes.yml create mode 100644 test/models/outcome_test.rb diff --git a/test/fixtures/outcomes.yml b/test/fixtures/outcomes.yml new file mode 100644 index 000000000..553584310 --- /dev/null +++ b/test/fixtures/outcomes.yml @@ -0,0 +1,5 @@ +one: + unit: bilgisayar_muhendisligi_programi + code: PÇ-1 + name_tr: Uygulama becerisi + name_en: Application skill diff --git a/test/fixtures/standards.yml b/test/fixtures/standards.yml index 54fdbbc47..2932df18a 100644 --- a/test/fixtures/standards.yml +++ b/test/fixtures/standards.yml @@ -1,13 +1,4 @@ -# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - code: MyString - version: MyString - name_tr: MyString - name_en: MyString - -two: - code: MyString - version: MyString - name_tr: MyString - name_en: MyString +mudek: + version: Version + name_tr: MÜDEK + name_en: MÜDEK \ No newline at end of file diff --git a/test/models/outcome_test.rb b/test/models/outcome_test.rb new file mode 100644 index 000000000..ae54ee890 --- /dev/null +++ b/test/models/outcome_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require 'test_helper' + +class OutcomeTest < ActiveSupport::TestCase +end diff --git a/test/models/standard_test.rb b/test/models/standard_test.rb index d40467bab..06996a57e 100644 --- a/test/models/standard_test.rb +++ b/test/models/standard_test.rb @@ -1,7 +1,6 @@ +# frozen_string_literal: true + require 'test_helper' class StandardTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end end From 6dcc5f814344d450ebbf261ab0b8d49713848064 Mon Sep 17 00:00:00 2001 From: dilara Date: Thu, 5 Mar 2020 15:46:59 +0300 Subject: [PATCH 386/970] Fix route --- config/routes/standard.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/config/routes/standard.rb b/config/routes/standard.rb index 06c1dee3a..9608f5bf4 100644 --- a/config/routes/standard.rb +++ b/config/routes/standard.rb @@ -1,10 +1,5 @@ # frozen_string_literal: true namespace :standard do - get '/', to: 'dashboard#index' - - resources :sncc do - resources :iccs - end - + resources :outcomes end From 4ec37492d82dc3310c7d5fd38485945f634a2228 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:37:42 +0000 Subject: [PATCH 387/970] chore(deps): [security] bump omniauth from 1.9.0 to 1.9.1 Bumps [omniauth](https://github.com/omniauth/omniauth) from 1.9.0 to 1.9.1. **This update includes a security fix.** - [Release notes](https://github.com/omniauth/omniauth/releases) - [Commits](https://github.com/omniauth/omniauth/compare/v1.9.0...v1.9.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 11a90e1de..568c2fa25 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -189,7 +189,7 @@ GEM groupdate (5.0.0) activesupport (>= 5) hashdiff (1.0.1) - hashie (3.6.0) + hashie (4.1.0) html_tokenizer (0.0.7) httpclient (2.8.3) i18n (1.8.2) @@ -247,8 +247,8 @@ GEM nio4r (2.5.2) nokogiri (1.10.9) mini_portile2 (~> 2.4.0) - omniauth (1.9.0) - hashie (>= 3.4.6, < 3.7.0) + omniauth (1.9.1) + hashie (>= 3.4.6) rack (>= 1.6.2, < 3) omniauth_openid_connect (0.3.3) addressable (~> 2.5) From 68957db6ce7d444079dedf83bf13f26d5de61d66 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:38:14 +0000 Subject: [PATCH 388/970] chore(deps): bump zeitwerk from 2.2.2 to 2.3.0 Bumps [zeitwerk](https://github.com/fxn/zeitwerk) from 2.2.2 to 2.3.0. - [Release notes](https://github.com/fxn/zeitwerk/releases) - [Changelog](https://github.com/fxn/zeitwerk/blob/master/CHANGELOG.md) - [Commits](https://github.com/fxn/zeitwerk/compare/v2.2.2...v2.3.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 11a90e1de..ef265d6a9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -463,7 +463,7 @@ GEM activesupport xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.2.2) + zeitwerk (2.3.0) PLATFORMS ruby From fac9317596a418d7da554a53f3c3c7673090b89d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:39:16 +0000 Subject: [PATCH 389/970] chore(deps): bump launchy from 2.4.3 to 2.5.0 Bumps [launchy](https://github.com/copiousfreetime/launchy) from 2.4.3 to 2.5.0. - [Release notes](https://github.com/copiousfreetime/launchy/releases) - [Changelog](https://github.com/copiousfreetime/launchy/blob/master/README.md) - [Commits](https://github.com/copiousfreetime/launchy/compare/v2.4.3...v2.5.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 11a90e1de..fa5d551f1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -206,8 +206,8 @@ GEM aes_key_wrap bindata jwt (2.2.1) - launchy (2.4.3) - addressable (~> 2.3) + launchy (2.5.0) + addressable (~> 2.7) letter_opener (1.7.0) launchy (~> 2.2) listen (3.2.1) From 91a0a915b9f196ab8a73e3707036912419004064 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:39:51 +0000 Subject: [PATCH 390/970] chore(deps): bump twilio-ruby from 5.31.5 to 5.31.6 Bumps [twilio-ruby](https://github.com/twilio/twilio-ruby) from 5.31.5 to 5.31.6. - [Release notes](https://github.com/twilio/twilio-ruby/releases) - [Changelog](https://github.com/twilio/twilio-ruby/blob/master/CHANGES.md) - [Commits](https://github.com/twilio/twilio-ruby/compare/5.31.5...5.31.6) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 11a90e1de..0dc320988 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -415,7 +415,7 @@ GEM thor (0.20.3) thread_safe (0.3.6) tilt (2.0.10) - twilio-ruby (5.31.5) + twilio-ruby (5.31.6) faraday (~> 1.0.0) jwt (>= 1.5, <= 2.5) nokogiri (>= 1.6, < 2.0) From 5f86e10e70a1e6fb545633be8867ad4e5dc2b0a4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:40:24 +0000 Subject: [PATCH 391/970] chore(deps-dev): bump brakeman from 4.7.2 to 4.8.0 Bumps [brakeman](https://github.com/presidentbeef/brakeman) from 4.7.2 to 4.8.0. - [Release notes](https://github.com/presidentbeef/brakeman/releases) - [Changelog](https://github.com/presidentbeef/brakeman/blob/master/CHANGES.md) - [Commits](https://github.com/presidentbeef/brakeman/compare/v4.7.2...v4.8.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 11a90e1de..fbcabb25b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -122,7 +122,7 @@ GEM bindex (0.8.1) bootsnap (1.4.5) msgpack (~> 1.0) - brakeman (4.7.2) + brakeman (4.8.0) builder (3.2.4) bullet (6.1.0) activesupport (>= 3.0.0) From 2bb35eb9f1314912ff1c9c4478e4194bb66d47b6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:40:56 +0000 Subject: [PATCH 392/970] chore(deps): bump aws-partitions from 1.278.0 to 1.281.0 Bumps [aws-partitions](https://github.com/aws/aws-sdk-ruby) from 1.278.0 to 1.281.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-partitions/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 11a90e1de..824a17a9f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,7 +94,7 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.0.3) - aws-partitions (1.278.0) + aws-partitions (1.281.0) aws-sdk-core (3.90.1) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) From 13e37a5e69e32222ec66f30ca73b66dab59692da Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:41:32 +0000 Subject: [PATCH 393/970] chore(deps): bump parser from 2.7.0.3 to 2.7.0.4 Bumps [parser](https://github.com/whitequark/parser) from 2.7.0.3 to 2.7.0.4. - [Release notes](https://github.com/whitequark/parser/releases) - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v2.7.0.3...v2.7.0.4) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 11a90e1de..e84240f24 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -267,7 +267,7 @@ GEM orm_adapter (0.5.0) pagy (3.7.3) parallel (1.19.1) - parser (2.7.0.3) + parser (2.7.0.4) ast (~> 2.4.0) pg (1.2.2) pg_search (2.3.2) From e8fcedf6cb4930fc6642703032a67d368c6c3fb2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:42:12 +0000 Subject: [PATCH 394/970] chore(deps): bump sorbet-runtime from 0.5.5406 to 0.5.5427 Bumps [sorbet-runtime](https://github.com/sorbet/sorbet) from 0.5.5406 to 0.5.5427. - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 11a90e1de..b791a9a77 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -394,7 +394,7 @@ GEM slack-notifier (2.3.2) smart_properties (1.15.0) smstools (0.2.0) - sorbet-runtime (0.5.5406) + sorbet-runtime (0.5.5427) spring (2.1.0) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) From 7b381428cb2c436a0e2dffb10243ab0497f7f846 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:42:40 +0000 Subject: [PATCH 395/970] chore(deps): bump et-orbi from 1.2.2 to 1.2.3 Bumps [et-orbi](https://github.com/floraison/et-orbi) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/floraison/et-orbi/releases) - [Changelog](https://github.com/floraison/et-orbi/blob/master/CHANGELOG.md) - [Commits](https://github.com/floraison/et-orbi/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 11a90e1de..b27518b4b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -169,7 +169,7 @@ GEM rubocop (~> 0.79.0) smart_properties erubi (1.9.0) - et-orbi (1.2.2) + et-orbi (1.2.3) tzinfo execjs (2.7.0) faraday (1.0.0) From ae69bb255a9e4bdd4b440fa093199c13e4a907b1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:43:22 +0000 Subject: [PATCH 396/970] chore(deps): bump hashie from 3.6.0 to 4.1.0 Bumps [hashie](https://github.com/hashie/hashie) from 3.6.0 to 4.1.0. - [Release notes](https://github.com/hashie/hashie/releases) - [Changelog](https://github.com/hashie/hashie/blob/master/CHANGELOG.md) - [Commits](https://github.com/hashie/hashie/compare/v3.6.0...v4.1.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 11a90e1de..568c2fa25 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -189,7 +189,7 @@ GEM groupdate (5.0.0) activesupport (>= 5) hashdiff (1.0.1) - hashie (3.6.0) + hashie (4.1.0) html_tokenizer (0.0.7) httpclient (2.8.3) i18n (1.8.2) @@ -247,8 +247,8 @@ GEM nio4r (2.5.2) nokogiri (1.10.9) mini_portile2 (~> 2.4.0) - omniauth (1.9.0) - hashie (>= 3.4.6, < 3.7.0) + omniauth (1.9.1) + hashie (>= 3.4.6) rack (>= 1.6.2, < 3) omniauth_openid_connect (0.3.3) addressable (~> 2.5) From ba44379f96a6e4f1385b15bf5b0ad3786f77f091 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:44:53 +0000 Subject: [PATCH 397/970] chore(deps): bump flag-icon-css from 3.4.5 to 3.4.6 Bumps [flag-icon-css](https://github.com/lipis/flag-icon-css) from 3.4.5 to 3.4.6. - [Release notes](https://github.com/lipis/flag-icon-css/releases) - [Commits](https://github.com/lipis/flag-icon-css/compare/3.4.5...3.4.6) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/yarn.lock b/yarn.lock index 309ab349f..38e1c4e20 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3426,11 +3426,9 @@ findup-sync@3.0.0: resolve-dir "^1.0.1" flag-icon-css@^3.3.0: - version "3.4.5" - resolved "https://registry.yarnpkg.com/flag-icon-css/-/flag-icon-css-3.4.5.tgz#584d618563034e69cb9a5b7a7c8477ec8c029a49" - integrity sha512-COo/PuJY/JddBLkdi7jL3gWF0z/hcvBRA4kfMXUjLeLglFf5IsyAzKZuXaXfCubVrkraVizmEp7Bn05upTXofA== - dependencies: - opencollective-postinstall "2.0.2" + version "3.4.6" + resolved "https://registry.yarnpkg.com/flag-icon-css/-/flag-icon-css-3.4.6.tgz#7e51099c85648c65f86d9ebb9c0ec6f5d8826714" + integrity sha512-rF69rt19Hr63SRQTiPBzQABaYB20LAgZhDkr/AxqSdgmCIN+tC5PRMz56Y0gxehFXJmdRwv55+GMi7R1fCRTwg== flat-cache@^2.0.1: version "2.0.1" @@ -5578,11 +5576,6 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" -opencollective-postinstall@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz#5657f1bede69b6e33a45939b061eb53d3c6c3a89" - integrity sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw== - opn@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/opn/-/opn-5.5.0.tgz#fc7164fab56d235904c51c3b27da6758ca3b9bfc" From af48fab58d18de72dd9727267fd1bb9274f360cc Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:46:17 +0000 Subject: [PATCH 398/970] chore(deps): bump ajv from 6.11.0 to 6.12.0 Bumps [ajv](https://github.com/epoberezkin/ajv) from 6.11.0 to 6.12.0. - [Release notes](https://github.com/epoberezkin/ajv/releases) - [Commits](https://github.com/epoberezkin/ajv/compare/v6.11.0...v6.12.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 309ab349f..8db5a7d4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1159,9 +1159,9 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: - version "6.11.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.11.0.tgz#c3607cbc8ae392d8a5a536f25b21f8e5f3f87fe9" - integrity sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA== + version "6.12.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" + integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== dependencies: fast-deep-equal "^3.1.1" fast-json-stable-stringify "^2.0.0" From 3282e0368297c3a54023a9ed02738d92d639ccb2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:46:36 +0000 Subject: [PATCH 399/970] chore(deps): bump is-finite from 1.0.2 to 1.1.0 Bumps [is-finite](https://github.com/sindresorhus/is-finite) from 1.0.2 to 1.1.0. - [Release notes](https://github.com/sindresorhus/is-finite/releases) - [Commits](https://github.com/sindresorhus/is-finite/compare/v1.0.2...v1.1.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 309ab349f..2dbbb99be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4370,11 +4370,9 @@ is-extglob@^2.1.0, is-extglob@^2.1.1: integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-finite@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" - integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= - dependencies: - number-is-nan "^1.0.0" + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" + integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== is-fullwidth-code-point@^1.0.0: version "1.0.0" From 8244c968c8086c180b686bdcfa8e389bafdbaba0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:48:02 +0000 Subject: [PATCH 400/970] chore(deps): bump node-releases from 1.1.50 to 1.1.51 Bumps [node-releases](https://github.com/chicoxyzzy/node-releases) from 1.1.50 to 1.1.51. - [Release notes](https://github.com/chicoxyzzy/node-releases/releases) - [Commits](https://github.com/chicoxyzzy/node-releases/compare/v1.1.50...v1.1.51) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 309ab349f..6e5e428d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5359,9 +5359,9 @@ node-libs-browser@^2.2.1: vm-browserify "^1.0.1" node-releases@^1.1.49: - version "1.1.50" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.50.tgz#803c40d2c45db172d0410e4efec83aa8c6ad0592" - integrity sha512-lgAmPv9eYZ0bGwUYAKlr8MG6K4CvWliWqnkcT2P8mMAgVrH3lqfBPorFlxiG1pHQnqmavJZ9vbMXUTNyMLbrgQ== + version "1.1.51" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.51.tgz#70d0e054221343d2966006bfbd4d98622cc00bd0" + integrity sha512-1eQEs6HFYY1kMXQPOLzCf7HdjReErmvn85tZESMczdCNVWP3Y7URYLBAyYynuI7yef1zj4HN5q+oB2x67QU0lw== dependencies: semver "^6.3.0" From 5bf96fc5411a1d4621ff5f15ba8b13bd7add13ac Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 00:50:53 +0000 Subject: [PATCH 401/970] chore(deps): bump run-async from 2.3.0 to 2.4.0 Bumps [run-async](https://github.com/SBoudrias/run-async) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/SBoudrias/run-async/releases) - [Commits](https://github.com/SBoudrias/run-async/compare/v2.3.0...v2.4.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 309ab349f..c01f0b004 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7162,9 +7162,9 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: inherits "^2.0.1" run-async@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" - integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= + version "2.4.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.0.tgz#e59054a5b86876cfae07f431d18cbaddc594f1e8" + integrity sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg== dependencies: is-promise "^2.1.0" From 5b09c4c97956eeeab589262fc34911cc300ab322 Mon Sep 17 00:00:00 2001 From: dilara Date: Mon, 9 Mar 2020 13:15:41 +0300 Subject: [PATCH 402/970] Remove name_* fields and add name --- app/models/outcome.rb | 3 +- app/models/standard.rb | 3 +- db/migrate/20200305103056_create_standards.rb | 12 +++----- db/migrate/20200305120339_create_outcomes.rb | 9 ++---- db/structure.sql | 30 +++++-------------- 5 files changed, 17 insertions(+), 40 deletions(-) diff --git a/app/models/outcome.rb b/app/models/outcome.rb index 8fa6edd4b..57b9f0389 100644 --- a/app/models/outcome.rb +++ b/app/models/outcome.rb @@ -6,6 +6,5 @@ class Outcome < ApplicationRecord # validations validates :code, presence: true, uniqueness: { scope: :unit_id }, length: { maximum: 10 } - validates :name_tr, presence: true, length: { maximum: 255 } - validates :name_en, presence: true, length: { maximum: 255 } + validates :name, presence: true, length: { maximum: 255 } end diff --git a/app/models/standard.rb b/app/models/standard.rb index 10eb7e74e..ed0857985 100644 --- a/app/models/standard.rb +++ b/app/models/standard.rb @@ -3,6 +3,5 @@ class Standard < ApplicationRecord # validations validates :version, presence: true, length: { maximum: 50 } - validates :name_tr, presence: true, uniqueness: { scope: :version }, length: { maximum: 255 } - validates :name_en, presence: true, uniqueness: { scope: :version }, length: { maximum: 255 } + validates :name, presence: true, uniqueness: { scope: :version }, length: { maximum: 255 } end diff --git a/db/migrate/20200305103056_create_standards.rb b/db/migrate/20200305103056_create_standards.rb index 5098fc5ad..f1f5850ab 100644 --- a/db/migrate/20200305103056_create_standards.rb +++ b/db/migrate/20200305103056_create_standards.rb @@ -4,21 +4,17 @@ class CreateStandards < ActiveRecord::Migration[6.0] def change create_table :standards do |t| t.string :version - t.string :name_tr - t.string :name_en + t.string :name t.timestamps null: false end add_length_constraint :standards, :version, less_than_or_equal_to: 50 - add_length_constraint :standards, :name_tr, less_than_or_equal_to: 255 - add_length_constraint :standards, :name_en, less_than_or_equal_to: 255 + add_length_constraint :standards, :name, less_than_or_equal_to: 255 add_presence_constraint :standards, :version - add_presence_constraint :standards, :name_tr - add_presence_constraint :standards, :name_en + add_presence_constraint :standards, :name - add_unique_constraint :standards, [:version, :name_tr] - add_unique_constraint :standards, [:version, :name_en] + add_unique_constraint :standards, [:version, :name] end end diff --git a/db/migrate/20200305120339_create_outcomes.rb b/db/migrate/20200305120339_create_outcomes.rb index 0662b148f..fbbf69bf2 100644 --- a/db/migrate/20200305120339_create_outcomes.rb +++ b/db/migrate/20200305120339_create_outcomes.rb @@ -4,19 +4,16 @@ def change t.references :unit, null: false, foreign_key: true t.references :parent, foreign_key: { to_table: :outcomes } t.string :code - t.string :name_tr - t.string :name_en + t.string :name t.timestamps end add_length_constraint :outcomes, :code, less_than_or_equal_to: 10 - add_length_constraint :outcomes, :name_tr, less_than_or_equal_to: 255 - add_length_constraint :outcomes, :name_en, less_than_or_equal_to: 255 + add_length_constraint :outcomes, :name, less_than_or_equal_to: 255 add_presence_constraint :outcomes, :code - add_presence_constraint :outcomes, :name_tr - add_presence_constraint :outcomes, :name_en + add_presence_constraint :outcomes, :name add_unique_constraint :outcomes, [:unit_id, :code] end diff --git a/db/structure.sql b/db/structure.sql index 19825f9dd..15deb4be0 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -2259,16 +2259,13 @@ CREATE TABLE public.outcomes ( unit_id bigint NOT NULL, parent_id bigint, code character varying, - name_tr character varying, - name_en character varying, + name character varying, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, CONSTRAINT outcomes_code_length CHECK ((length((code)::text) <= 10)), CONSTRAINT outcomes_code_presence CHECK (((code IS NOT NULL) AND ((code)::text !~ '^\s*$'::text))), - CONSTRAINT outcomes_name_en_length CHECK ((length((name_en)::text) <= 255)), - CONSTRAINT outcomes_name_en_presence CHECK (((name_en IS NOT NULL) AND ((name_en)::text !~ '^\s*$'::text))), - CONSTRAINT outcomes_name_tr_length CHECK ((length((name_tr)::text) <= 255)), - CONSTRAINT outcomes_name_tr_presence CHECK (((name_tr IS NOT NULL) AND ((name_tr)::text !~ '^\s*$'::text))) + CONSTRAINT outcomes_name_length CHECK ((length((name)::text) <= 255)), + CONSTRAINT outcomes_name_presence CHECK (((name IS NOT NULL) AND ((name)::text !~ '^\s*$'::text))) ); @@ -3056,14 +3053,11 @@ ALTER SEQUENCE public.semester_registrations_id_seq OWNED BY public.semester_reg CREATE TABLE public.standards ( id bigint NOT NULL, version character varying, - name_tr character varying, - name_en character varying, + name character varying, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, - CONSTRAINT standards_name_en_length CHECK ((length((name_en)::text) <= 255)), - CONSTRAINT standards_name_en_presence CHECK (((name_en IS NOT NULL) AND ((name_en)::text !~ '^\s*$'::text))), - CONSTRAINT standards_name_tr_length CHECK ((length((name_tr)::text) <= 255)), - CONSTRAINT standards_name_tr_presence CHECK (((name_tr IS NOT NULL) AND ((name_tr)::text !~ '^\s*$'::text))), + CONSTRAINT standards_name_length CHECK ((length((name)::text) <= 255)), + CONSTRAINT standards_name_presence CHECK (((name IS NOT NULL) AND ((name)::text !~ '^\s*$'::text))), CONSTRAINT standards_version_length CHECK ((length((version)::text) <= 50)), CONSTRAINT standards_version_presence CHECK (((version IS NOT NULL) AND ((version)::text !~ '^\s*$'::text))) ); @@ -5253,19 +5247,11 @@ ALTER TABLE ONLY public.standards -- --- Name: standards standards_version_name_en_unique; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.standards - ADD CONSTRAINT standards_version_name_en_unique UNIQUE (version, name_en) DEFERRABLE; - - --- --- Name: standards standards_version_name_tr_unique; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: standards standards_version_name_unique; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.standards - ADD CONSTRAINT standards_version_name_tr_unique UNIQUE (version, name_tr) DEFERRABLE; + ADD CONSTRAINT standards_version_name_unique UNIQUE (version, name) DEFERRABLE; -- From c9d7ebe1892252ea6d9210a2da1b17a60d1242c8 Mon Sep 17 00:00:00 2001 From: dilara Date: Mon, 9 Mar 2020 13:36:02 +0300 Subject: [PATCH 403/970] Add standards routes under reference namespace --- config/routes/reference.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes/reference.rb b/config/routes/reference.rb index 89f55146b..f8c9f6969 100644 --- a/config/routes/reference.rb +++ b/config/routes/reference.rb @@ -11,5 +11,6 @@ resources :high_school_types, except: :show resources :languages, except: :show resources :scholarship_types, except: :show + resources :standards, except: :show resources :titles, except: :show end From 99b8451f917439cf3ba3e4ba649364a7d6a99265 Mon Sep 17 00:00:00 2001 From: dilara Date: Mon, 9 Mar 2020 13:38:10 +0300 Subject: [PATCH 404/970] Add standards link to references dashboard --- app/views/reference/dashboard/index.html.erb | 3 +++ config/locales/controllers/reference/dashboard.en.yml | 1 + config/locales/controllers/reference/dashboard.tr.yml | 1 + 3 files changed, 5 insertions(+) diff --git a/app/views/reference/dashboard/index.html.erb b/app/views/reference/dashboard/index.html.erb index e0d006481..eef306e98 100644 --- a/app/views/reference/dashboard/index.html.erb +++ b/app/views/reference/dashboard/index.html.erb @@ -58,6 +58,9 @@ <%= link_to %i[reference titles], class: item_class do %> <%= t('.titles') %> <% end %> + <%= link_to %i[reference standards], class: item_class do %> + <%= t('.standards') %> + <% end %> diff --git a/config/locales/controllers/reference/dashboard.en.yml b/config/locales/controllers/reference/dashboard.en.yml index 290db4444..242edb454 100644 --- a/config/locales/controllers/reference/dashboard.en.yml +++ b/config/locales/controllers/reference/dashboard.en.yml @@ -14,5 +14,6 @@ en: locations: Locations other_references: Other References scholarship_types: Scholarship Types + standards: Standards term_references: Term References titles: Titles diff --git a/config/locales/controllers/reference/dashboard.tr.yml b/config/locales/controllers/reference/dashboard.tr.yml index 4f2d30753..a8848d012 100644 --- a/config/locales/controllers/reference/dashboard.tr.yml +++ b/config/locales/controllers/reference/dashboard.tr.yml @@ -14,5 +14,6 @@ tr: locations: Konumlar other_references: Diğer Tanımlar scholarship_types: Burs Türleri + standards: Standartlar term_references: Dönem Tanımları titles: Unvanlar From b7ba80e92652f66c7f4c1d48c9a31e5bb781fd41 Mon Sep 17 00:00:00 2001 From: dilara Date: Mon, 9 Mar 2020 13:39:35 +0300 Subject: [PATCH 405/970] Add reference search --- app/models/standard.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/standard.rb b/app/models/standard.rb index ed0857985..76294e1cc 100644 --- a/app/models/standard.rb +++ b/app/models/standard.rb @@ -1,6 +1,9 @@ # frozen_string_literal: true class Standard < ApplicationRecord + # search + include ReferenceSearch + # validations validates :version, presence: true, length: { maximum: 50 } validates :name, presence: true, uniqueness: { scope: :version }, length: { maximum: 255 } From 2d044935158ab7917a96abaaeef25e316349b53f Mon Sep 17 00:00:00 2001 From: dilara Date: Mon, 9 Mar 2020 13:40:28 +0300 Subject: [PATCH 406/970] Add standards controller & standard policy --- app/controllers/reference/standards_controller.rb | 13 +++++++++++++ app/policies/reference/standard_policy.rb | 15 +++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 app/controllers/reference/standards_controller.rb create mode 100644 app/policies/reference/standard_policy.rb diff --git a/app/controllers/reference/standards_controller.rb b/app/controllers/reference/standards_controller.rb new file mode 100644 index 000000000..3223f0c80 --- /dev/null +++ b/app/controllers/reference/standards_controller.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Reference + class StandardsController < ApplicationController + include ReferenceResource + + private + + def secure_params + params.require(:standard).permit(:name, :version) + end + end +end diff --git a/app/policies/reference/standard_policy.rb b/app/policies/reference/standard_policy.rb new file mode 100644 index 000000000..930cf768b --- /dev/null +++ b/app/policies/reference/standard_policy.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Reference + class StandardPolicy < ApplicationPolicy + include CrudPolicyMethods + + undef :show? + + private + + def permitted?(*privileges) + user.privilege? :reference_management, privileges + end + end +end From dd855412ebea61197321e869d3d5e373a80e4926 Mon Sep 17 00:00:00 2001 From: dilara Date: Mon, 9 Mar 2020 13:44:49 +0300 Subject: [PATCH 407/970] Add standard views & locales --- app/views/reference/standards/_form.html.erb | 15 ++++++++++ app/views/reference/standards/edit.html.erb | 1 + app/views/reference/standards/index.html.erb | 8 ++++++ app/views/reference/standards/new.html.erb | 1 + .../controllers/reference/standards.en.yml | 28 +++++++++++++++++++ .../controllers/reference/standards.tr.yml | 28 +++++++++++++++++++ 6 files changed, 81 insertions(+) create mode 100644 app/views/reference/standards/_form.html.erb create mode 100644 app/views/reference/standards/edit.html.erb create mode 100644 app/views/reference/standards/index.html.erb create mode 100644 app/views/reference/standards/new.html.erb create mode 100644 config/locales/controllers/reference/standards.en.yml create mode 100644 config/locales/controllers/reference/standards.tr.yml diff --git a/app/views/reference/standards/_form.html.erb b/app/views/reference/standards/_form.html.erb new file mode 100644 index 000000000..c9e9b8c26 --- /dev/null +++ b/app/views/reference/standards/_form.html.erb @@ -0,0 +1,15 @@ +<%= render 'layouts/builders/form', + namespace: 'reference', + klass: @standard, + params: [ + { + field: 'version', + width: 6, + required: true + }, + { + field: 'name', + width: 6, + required: true + } + ] %> diff --git a/app/views/reference/standards/edit.html.erb b/app/views/reference/standards/edit.html.erb new file mode 100644 index 000000000..2d3436368 --- /dev/null +++ b/app/views/reference/standards/edit.html.erb @@ -0,0 +1 @@ +<%= render 'form' %> diff --git a/app/views/reference/standards/index.html.erb b/app/views/reference/standards/index.html.erb new file mode 100644 index 000000000..ac1be4a28 --- /dev/null +++ b/app/views/reference/standards/index.html.erb @@ -0,0 +1,8 @@ +<%= render 'layouts/builders/index', + namespace: 'reference', + klass: 'standard', + collection: @standards, + pagy: @pagy, + card_header: t('.card_header'), + params: %w[name], + actions: %w[edit destroy] %> \ No newline at end of file diff --git a/app/views/reference/standards/new.html.erb b/app/views/reference/standards/new.html.erb new file mode 100644 index 000000000..2d3436368 --- /dev/null +++ b/app/views/reference/standards/new.html.erb @@ -0,0 +1 @@ +<%= render 'form' %> diff --git a/config/locales/controllers/reference/standards.en.yml b/config/locales/controllers/reference/standards.en.yml new file mode 100644 index 000000000..f6194cc05 --- /dev/null +++ b/config/locales/controllers/reference/standards.en.yml @@ -0,0 +1,28 @@ +en: + activerecord: + attributes: + standard: &standard_attributes + version: Version + name: Name + helpers: + submit: + standard: + create: Create Standard + update: Update Standard + reference: + standards: + create: + success: Standard successfully created. + destroy: + success: Standard successfully deleted. + warning: Standard could not be deleted. + edit: + form_title: Update the Standard + index: + <<: *standard_attributes + card_header: Standards + new_standard_link: New Standard + new: + form_title: Create a New Standard + update: + success: Standard successfully updated. diff --git a/config/locales/controllers/reference/standards.tr.yml b/config/locales/controllers/reference/standards.tr.yml new file mode 100644 index 000000000..15900cc1b --- /dev/null +++ b/config/locales/controllers/reference/standards.tr.yml @@ -0,0 +1,28 @@ +tr: + activerecord: + attributes: + standard: &standard_attributes + version: Versiyon + name: Adı + helpers: + submit: + standard: + create: Standart Oluştur + update: Standart Güncelle + reference: + standards: + create: + success: Standart başarıyla oluşturuldu. + destroy: + success: Standart başarıyla silindi. + warning: Standart silinemedi! + edit: + form_title: Standartı Güncelle + index: + <<: *standard_attributes + card_header: Standartlar + new_standard_link: Yeni Standart + new: + form_title: Standart Oluştur + update: + success: Standart başarıyla güncellendi. From 7262fd588fde3d25839573202d98365bb1ec0eb5 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 10 Mar 2020 09:23:55 +0300 Subject: [PATCH 408/970] Add unit standard model & migration --- app/models/unit_standard.rb | 14 ++++ .../20200310044429_create_unit_standards.rb | 17 ++++ db/structure.sql | 83 ++++++++++++++++++- 3 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 app/models/unit_standard.rb create mode 100644 db/migrate/20200310044429_create_unit_standards.rb diff --git a/app/models/unit_standard.rb b/app/models/unit_standard.rb new file mode 100644 index 000000000..68cbe6df4 --- /dev/null +++ b/app/models/unit_standard.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class UnitStandard < ApplicationRecord + # enums + enum status: { passive: 0, active: 1 } + + # relations + belongs_to :standard + belongs_to :unit + + # validations + validates :standard, presence: true, uniqueness: { scope: :unit } + validates :status, inclusion: { in: statuses.keys } +end diff --git a/db/migrate/20200310044429_create_unit_standards.rb b/db/migrate/20200310044429_create_unit_standards.rb new file mode 100644 index 000000000..5ffbdaeca --- /dev/null +++ b/db/migrate/20200310044429_create_unit_standards.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CreateUnitStandards < ActiveRecord::Migration[6.0] + def change + create_table :unit_standards do |t| + t.references :standard, foreign_key: true, null: false + t.references :unit, foreign_key: true, null: false + t.integer :status + + t.timestamps + end + + add_null_constraint :unit_standards, :status + + add_numericality_constraint :unit_standards, :status, greater_than_or_equal_to: 0 + end +end diff --git a/db/structure.sql b/db/structure.sql index 15deb4be0..93e80185f 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -3604,6 +3604,41 @@ CREATE SEQUENCE public.unit_instruction_types_id_seq ALTER SEQUENCE public.unit_instruction_types_id_seq OWNED BY public.unit_instruction_types.id; +-- +-- Name: unit_standards; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.unit_standards ( + id bigint NOT NULL, + standard_id bigint NOT NULL, + unit_id bigint NOT NULL, + status integer, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL, + CONSTRAINT unit_standards_status_null CHECK ((status IS NOT NULL)), + CONSTRAINT unit_standards_status_numericality CHECK ((status >= 0)) +); + + +-- +-- Name: unit_standards_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.unit_standards_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: unit_standards_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.unit_standards_id_seq OWNED BY public.unit_standards.id; + + -- -- Name: unit_statuses; Type: TABLE; Schema: public; Owner: - -- @@ -4484,6 +4519,13 @@ ALTER TABLE ONLY public.unit_instruction_languages ALTER COLUMN id SET DEFAULT n ALTER TABLE ONLY public.unit_instruction_types ALTER COLUMN id SET DEFAULT nextval('public.unit_instruction_types_id_seq'::regclass); +-- +-- Name: unit_standards id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.unit_standards ALTER COLUMN id SET DEFAULT nextval('public.unit_standards_id_seq'::regclass); + + -- -- Name: unit_statuses id; Type: DEFAULT; Schema: public; Owner: - -- @@ -5550,6 +5592,14 @@ ALTER TABLE ONLY public.unit_instruction_types ADD CONSTRAINT unit_instruction_types_pkey PRIMARY KEY (id); +-- +-- Name: unit_standards unit_standards_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.unit_standards + ADD CONSTRAINT unit_standards_pkey PRIMARY KEY (id); + + -- -- Name: unit_statuses unit_statuses_code_unique; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -6444,6 +6494,20 @@ CREATE INDEX index_unit_calendars_on_calendar_id ON public.unit_calendars USING CREATE INDEX index_unit_calendars_on_unit_id ON public.unit_calendars USING btree (unit_id); +-- +-- Name: index_unit_standards_on_standard_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_unit_standards_on_standard_id ON public.unit_standards USING btree (standard_id); + + +-- +-- Name: index_unit_standards_on_unit_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_unit_standards_on_unit_id ON public.unit_standards USING btree (unit_id); + + -- -- Name: index_unit_tuitions_on_tuition_id; Type: INDEX; Schema: public; Owner: - -- @@ -6807,6 +6871,14 @@ ALTER TABLE ONLY public.calendar_committee_decisions ADD CONSTRAINT fk_rails_4f3eb3da94 FOREIGN KEY (calendar_id) REFERENCES public.calendars(id); +-- +-- Name: unit_standards fk_rails_505755c23e; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.unit_standards + ADD CONSTRAINT fk_rails_505755c23e FOREIGN KEY (unit_id) REFERENCES public.units(id); + + -- -- Name: identities fk_rails_5373344100; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7191,6 +7263,14 @@ ALTER TABLE ONLY public.books ADD CONSTRAINT fk_rails_bc582ddd02 FOREIGN KEY (user_id) REFERENCES public.users(id); +-- +-- Name: unit_standards fk_rails_bd51470089; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.unit_standards + ADD CONSTRAINT fk_rails_bd51470089 FOREIGN KEY (standard_id) REFERENCES public.standards(id); + + -- -- Name: ldap_sync_errors fk_rails_c34f07ddd2; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7525,6 +7605,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200215132359'), ('20200217110305'), ('20200305103056'), -('20200305120339'); +('20200305120339'), +('20200310044429'); From e0660f9e3f984a7fcfdd1a35f87f6007557ac1c0 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 10 Mar 2020 10:22:17 +0300 Subject: [PATCH 409/970] Remove standard & add outcome management routes --- config/routes.rb | 2 +- config/routes/outcome_management.rb | 5 +++++ config/routes/standard.rb | 5 ----- 3 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 config/routes/outcome_management.rb delete mode 100644 config/routes/standard.rb diff --git a/config/routes.rb b/config/routes.rb index 10c069020..5e8f5332c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -24,6 +24,7 @@ draw :location draw :manager draw :meksis + draw :outcome_management draw :patron draw :reference draw :studentship @@ -31,7 +32,6 @@ draw :user_management draw :yoksis draw :meksis - draw :standard resources :students, only: %i[edit update] diff --git a/config/routes/outcome_management.rb b/config/routes/outcome_management.rb new file mode 100644 index 000000000..3c90cbaae --- /dev/null +++ b/config/routes/outcome_management.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +scope module: :outcome_management do + resources :unit_standards +end diff --git a/config/routes/standard.rb b/config/routes/standard.rb deleted file mode 100644 index 9608f5bf4..000000000 --- a/config/routes/standard.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -namespace :standard do - resources :outcomes -end From 6a0890de1c39c9487ac741e6bd92557ce478f166 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 10 Mar 2020 14:10:21 +0300 Subject: [PATCH 410/970] Add unit standards link to sidebar --- app/views/layouts/shared/menus/_admin.html.erb | 13 +++++++++++++ config/locales/layouts/shared/sidebar.en.yml | 2 ++ config/locales/layouts/shared/sidebar.tr.yml | 2 ++ 3 files changed, 17 insertions(+) diff --git a/app/views/layouts/shared/menus/_admin.html.erb b/app/views/layouts/shared/menus/_admin.html.erb index 2da713f5b..e2874ba27 100644 --- a/app/views/layouts/shared/menus/_admin.html.erb +++ b/app/views/layouts/shared/menus/_admin.html.erb @@ -60,6 +60,19 @@ + +
<%= tuition.units.map(&:name).join(', ') %><%= tuition.units.map(&:names_depth_cache).join(', ') %> <%= full_name(tuition.academic_term) %> <%= number_to_currency(tuition.fee) %> <%= number_to_currency(tuition.foreign_student_fee) %>
-
\ No newline at end of file +
diff --git a/app/views/tuition_management/tuitions/_form.html.erb b/app/views/tuition_management/tuitions/_form.html.erb index f4bf9a41e..6333fc725 100644 --- a/app/views/tuition_management/tuitions/_form.html.erb +++ b/app/views/tuition_management/tuitions/_form.html.erb @@ -13,7 +13,7 @@ <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
- <%= f.input :unit_ids, collection: f.object.units, value_method: :id, label_method: :name, input_html: { multiple: 'multiple' }, required: true %> + <%= f.input :unit_ids, collection: f.object.units, value_method: :id, label_method: :name, input_html: { multiple: 'multiple' }, required: true %>
<%= f.association :academic_term, label_method: lambda { |academic_term| full_name(academic_term) } %> diff --git a/app/views/tuition_management/tuitions/_search.html.erb b/app/views/tuition_management/tuitions/_search.html.erb index 273de284c..509562260 100644 --- a/app/views/tuition_management/tuitions/_search.html.erb +++ b/app/views/tuition_management/tuitions/_search.html.erb @@ -26,10 +26,10 @@
<%= label_tag(:unit_id, t('.unit')) %> <%= select_tag(:unit_id, - options_from_collection_for_select(Unit.active.programs.order(:name), :id, :names_depth_cache, params[:unit_id]), - include_blank: true, - class: 'form-control', - style: 'width: 100%') %> + options_from_collection_for_select(Unit.active.programs.order(:name), :id, :names_depth_cache, params[:unit_id]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %>
<%= label_tag(:academic_term_id, t('.academic_term')) %> diff --git a/app/views/tuition_management/tuitions/edit.html.erb b/app/views/tuition_management/tuitions/edit.html.erb index 863f9da4e..7477575a0 100644 --- a/app/views/tuition_management/tuitions/edit.html.erb +++ b/app/views/tuition_management/tuitions/edit.html.erb @@ -1 +1 @@ -<%= render 'form', tuition: @tuition, form_title: t('.form_title') %> +<%= render 'form', tuition: @tuition, form_title: t('.form_title') %> diff --git a/app/views/tuition_management/tuitions/new.html.erb b/app/views/tuition_management/tuitions/new.html.erb index 863f9da4e..7477575a0 100644 --- a/app/views/tuition_management/tuitions/new.html.erb +++ b/app/views/tuition_management/tuitions/new.html.erb @@ -1 +1 @@ -<%= render 'form', tuition: @tuition, form_title: t('.form_title') %> +<%= render 'form', tuition: @tuition, form_title: t('.form_title') %> From 755d93d9e628ecd3566baeae1b1ed78db333f548 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 10 Mar 2020 15:08:27 +0300 Subject: [PATCH 416/970] Add unit standards controller & views --- .../unit_standards_controller.rb | 52 +++++++++++++++++++ .../unit_standards/_form.html.erb | 33 ++++++++++++ .../unit_standards/edit.html.erb | 1 + .../unit_standards/index.html.erb | 41 +++++++++++++++ .../unit_standards/new.html.erb | 1 + .../unit_standards/show.html.erb | 39 ++++++++++++++ .../outcome_management/unit_standards.en.yml | 36 +++++++++++++ .../outcome_management/unit_standards.tr.yml | 36 +++++++++++++ 8 files changed, 239 insertions(+) create mode 100644 app/controllers/outcome_management/unit_standards_controller.rb create mode 100644 app/views/outcome_management/unit_standards/_form.html.erb create mode 100644 app/views/outcome_management/unit_standards/edit.html.erb create mode 100644 app/views/outcome_management/unit_standards/index.html.erb create mode 100644 app/views/outcome_management/unit_standards/new.html.erb create mode 100644 app/views/outcome_management/unit_standards/show.html.erb create mode 100644 config/locales/controllers/outcome_management/unit_standards.en.yml create mode 100644 config/locales/controllers/outcome_management/unit_standards.tr.yml diff --git a/app/controllers/outcome_management/unit_standards_controller.rb b/app/controllers/outcome_management/unit_standards_controller.rb new file mode 100644 index 000000000..8227488ef --- /dev/null +++ b/app/controllers/outcome_management/unit_standards_controller.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module OutcomeManagement + class UnitStandardsController < ApplicationController + include SearchableModule + + before_action :set_unit_standard, only: %i[show edit update destroy] + + def index + unit_standards = UnitStandard.includes(:standard, :unit) + @pagy, @unit_standards = pagy(unit_standards) + end + + def show + @unit = @unit_standard.unit + end + + def new + @unit_standard = UnitStandard.new + end + + def edit; end + + def create + @unit_standard = UnitStandard.new(unit_standard_params) + @unit_standard.save ? redirect_with('success') : render(:new) + end + + def update + @unit_standard.update(unit_standard_params) ? redirect_with('success') : render(:edit) + end + + def destroy + message = @unit_standard.destroy ? 'success' : 'error' + redirect_with(message) + end + + private + + def redirect_with(message) + redirect_to unit_standards_path, flash: { notice: t(".#{message}") } + end + + def set_unit_standard + @unit_standard = UnitStandard.find(params[:id]) + end + + def unit_standard_params + params.require(:unit_standard).permit(:unit_id, :standard_id, :status) + end + end +end diff --git a/app/views/outcome_management/unit_standards/_form.html.erb b/app/views/outcome_management/unit_standards/_form.html.erb new file mode 100644 index 000000000..4fa83644f --- /dev/null +++ b/app/views/outcome_management/unit_standards/_form.html.erb @@ -0,0 +1,33 @@ +
+
+
+
+ <%= fa_icon 'university' %> + <%= form_title %> +
+
+ <%= simple_form_for(@unit_standard) do |f| %> +
+
+ <%= f.error_notification %> +
+
+ <%= f.association :unit, collection: Unit.programs %> +
+
+ <%= f.association :standard %> +
+
+ <%= f.input :status, collection: enum_options_for_select(f.object.class, :status) %> +
+ +
+ <%= f.button :submit, class: 'btn btn-outline-success btn-sm' %> + <%= link_to_back(:back) %> +
+
+ <% end %> +
+
+
+
diff --git a/app/views/outcome_management/unit_standards/edit.html.erb b/app/views/outcome_management/unit_standards/edit.html.erb new file mode 100644 index 000000000..072a77789 --- /dev/null +++ b/app/views/outcome_management/unit_standards/edit.html.erb @@ -0,0 +1 @@ +<%= render 'form', unit: @unit_standard, form_title: t('.form_title') %> diff --git a/app/views/outcome_management/unit_standards/index.html.erb b/app/views/outcome_management/unit_standards/index.html.erb new file mode 100644 index 000000000..8d649287a --- /dev/null +++ b/app/views/outcome_management/unit_standards/index.html.erb @@ -0,0 +1,41 @@ +
+
+
+
+ <%= fa_icon 'align-justify', text: t('.card_header') %> +
+ <%= link_to_new(t('.new_unit_link'), new_unit_standard_path) %> +
+
+
+ + + + + + + + + + + <% @unit_standards.each do |unit_standard| %> + <% unit = unit_standard.unit %> + + + + + + + + <% end %> + +
<%= t('.standard') %><%= t('.unit') %><%= t('.status') %><%= t('actions') %>
<%= unit_standard.standard.name %><%= link_to(unit.names_depth_cache, unit_path(unit)) %><%= enum_t(unit_standard, :status) %><%= link_to_actions(unit_standard) %>
+
+
+ +
+
diff --git a/app/views/outcome_management/unit_standards/new.html.erb b/app/views/outcome_management/unit_standards/new.html.erb new file mode 100644 index 000000000..072a77789 --- /dev/null +++ b/app/views/outcome_management/unit_standards/new.html.erb @@ -0,0 +1 @@ +<%= render 'form', unit: @unit_standard, form_title: t('.form_title') %> diff --git a/app/views/outcome_management/unit_standards/show.html.erb b/app/views/outcome_management/unit_standards/show.html.erb new file mode 100644 index 000000000..e4ffd5432 --- /dev/null +++ b/app/views/outcome_management/unit_standards/show.html.erb @@ -0,0 +1,39 @@ +
+
+
+
+ <%= fa_icon 'university' %><%= @unit.name %> +
+ <%= link_to_actions(@unit_standard, except: :show) %> +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
<%= t('.unit') %><%= link_to(@unit.name, @unit) %>
<%= t('.standard') %><%= @unit_standard.standard.name %>
<%= t('.status') %><%= enum_t(@unit_standard, :status) %>
<%= t('created_at') %><%= @unit_standard.created_at %>
<%= t('updated_at') %><%= @unit_standard.updated_at %>
+
+
+
+
diff --git a/config/locales/controllers/outcome_management/unit_standards.en.yml b/config/locales/controllers/outcome_management/unit_standards.en.yml new file mode 100644 index 000000000..80f0c22f2 --- /dev/null +++ b/config/locales/controllers/outcome_management/unit_standards.en.yml @@ -0,0 +1,36 @@ +en: + activerecord: + attributes: + unit_standard: &unit_standard_attributes + standard: Standard + status: Status + unit: Program + enums: + unit_standard: + statuses: + active: Active + passive: Passive + helpers: + submit: + unit_standard: + create: Create Unit Standard + update: Update Unit Standard + outcome_management: + unit_standards: + create: + success: Unit standard successfully created. + destroy: + success: Unit standard successfully deleted. + warning: Unit standard can not be deleted. + edit: + form_title: Update Unit Standard + index: + <<: *unit_standard_attributes + card_header: Unit Standards + new_unit_link: Create a New Unit Standard + new: + form_title: Create a Unit Standard + show: + <<: *unit_standard_attributes + update: + success: Unit standard successfully updated. diff --git a/config/locales/controllers/outcome_management/unit_standards.tr.yml b/config/locales/controllers/outcome_management/unit_standards.tr.yml new file mode 100644 index 000000000..bca86b421 --- /dev/null +++ b/config/locales/controllers/outcome_management/unit_standards.tr.yml @@ -0,0 +1,36 @@ +tr: + activerecord: + attributes: + unit_standard: &unit_standard_attributes + standard: Standart + status: Durum + unit: Program + enums: + unit_standard: + statuses: + active: Aktif + passive: Pasif + helpers: + submit: + unit_standard: + create: Birim Standardı Oluştur + update: Birim Standardını Güncelle + outcome_management: + unit_standards: + create: + success: Birim standardı başarıyla oluşturuldu. + destroy: + success: Birim standardı başarıyla silindi! + warning: Birim standardı silinemedi! + edit: + form_title: Birim Standardını Güncelle + index: + <<: *unit_standard_attributes + card_header: Birim Standartları + new_unit_link: Yeni Birim Standardı Oluştur + new: + form_title: Birim Standardı Oluştur + show: + <<: *unit_standard_attributes + update: + success: Birim standardı başarıyla güncellendi. From 3b7aa7b23bf7173947d118c8d85ebcb333abdd6a Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 10 Mar 2020 15:09:01 +0300 Subject: [PATCH 417/970] Fix fixtures --- test/fixtures/outcomes.yml | 3 +-- test/fixtures/standards.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/test/fixtures/outcomes.yml b/test/fixtures/outcomes.yml index 553584310..fba985842 100644 --- a/test/fixtures/outcomes.yml +++ b/test/fixtures/outcomes.yml @@ -1,5 +1,4 @@ one: unit: bilgisayar_muhendisligi_programi code: PÇ-1 - name_tr: Uygulama becerisi - name_en: Application skill + name: Uygulama becerisi diff --git a/test/fixtures/standards.yml b/test/fixtures/standards.yml index 2932df18a..312dfecfd 100644 --- a/test/fixtures/standards.yml +++ b/test/fixtures/standards.yml @@ -1,4 +1,3 @@ mudek: version: Version - name_tr: MÜDEK - name_en: MÜDEK \ No newline at end of file + name: MÜDEK From 8fc9a8cd7ee41c4509a34c9b1e7b5ba17b4e94cc Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 10 Mar 2020 15:32:20 +0300 Subject: [PATCH 418/970] Add status uniqueness validation --- app/models/unit_standard.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/unit_standard.rb b/app/models/unit_standard.rb index 68cbe6df4..ae8a2b880 100644 --- a/app/models/unit_standard.rb +++ b/app/models/unit_standard.rb @@ -10,5 +10,5 @@ class UnitStandard < ApplicationRecord # validations validates :standard, presence: true, uniqueness: { scope: :unit } - validates :status, inclusion: { in: statuses.keys } + validates :status, inclusion: { in: statuses.keys }, uniqueness: { scope: :unit } end From 314949bb9ef2edcc0cee8eaff7e709d5855b4d24 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 10 Mar 2020 15:40:18 +0300 Subject: [PATCH 419/970] Use select2 in form --- app/views/outcome_management/unit_standards/_form.html.erb | 6 ++++-- .../outcome_management/unit_standards/_select2.html.erb | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 app/views/outcome_management/unit_standards/_select2.html.erb diff --git a/app/views/outcome_management/unit_standards/_form.html.erb b/app/views/outcome_management/unit_standards/_form.html.erb index 4fa83644f..4e6a6fd5b 100644 --- a/app/views/outcome_management/unit_standards/_form.html.erb +++ b/app/views/outcome_management/unit_standards/_form.html.erb @@ -12,13 +12,13 @@ <%= f.error_notification %>
- <%= f.association :unit, collection: Unit.programs %> + <%= f.association :unit, collection: Unit.active.programs.order(:name), label_method: :names_depth_cache %>
<%= f.association :standard %>
- <%= f.input :status, collection: enum_options_for_select(f.object.class, :status) %> + <%= f.input :status, collection: enum_options_for_select(f.object.class, :status), selected: :active %>
@@ -31,3 +31,5 @@
+ +<%= render 'select2' %> diff --git a/app/views/outcome_management/unit_standards/_select2.html.erb b/app/views/outcome_management/unit_standards/_select2.html.erb new file mode 100644 index 000000000..506bee4db --- /dev/null +++ b/app/views/outcome_management/unit_standards/_select2.html.erb @@ -0,0 +1,5 @@ + From 3ce26d3b5bec6533d263215763143f4039012bc7 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 10 Mar 2020 16:06:36 +0300 Subject: [PATCH 420/970] Use status field instead permanently registered field --- app/models/prospective_student.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/prospective_student.rb b/app/models/prospective_student.rb index 010689d1f..3e761ecb4 100644 --- a/app/models/prospective_student.rb +++ b/app/models/prospective_student.rb @@ -84,12 +84,12 @@ def can_temporarily_register? def registered_user(user) Student.new( - user: user, - unit: unit, - permanently_registered: can_permanently_register?, - student_number: id_number, # TODO: must be generated - year: 1, # TODO: can have a different value depending on the characteristics of the program - semester: 1 + user: user, + unit: unit, + status: can_permanently_register? ? :active : :passive, + student_number: id_number, # TODO: must be generated + year: 1, # TODO: can have a different value depending on the characteristics of the program + semester: 1 ) end From 6a021b98a291c983bc2e02273e62720e96ed9de3 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 11 Mar 2020 10:01:00 +0300 Subject: [PATCH 421/970] Change order of last migrations --- ..._unit_standards.rb => 20200305120339_create_unit_standards.rb} | 0 ...20339_create_outcomes.rb => 20200310044429_create_outcomes.rb} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename db/migrate/{20200310044429_create_unit_standards.rb => 20200305120339_create_unit_standards.rb} (100%) rename db/migrate/{20200305120339_create_outcomes.rb => 20200310044429_create_outcomes.rb} (100%) diff --git a/db/migrate/20200310044429_create_unit_standards.rb b/db/migrate/20200305120339_create_unit_standards.rb similarity index 100% rename from db/migrate/20200310044429_create_unit_standards.rb rename to db/migrate/20200305120339_create_unit_standards.rb diff --git a/db/migrate/20200305120339_create_outcomes.rb b/db/migrate/20200310044429_create_outcomes.rb similarity index 100% rename from db/migrate/20200305120339_create_outcomes.rb rename to db/migrate/20200310044429_create_outcomes.rb From 9088c0661f5ffcb07957dc043daa4c0de9874e33 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 11 Mar 2020 10:02:07 +0300 Subject: [PATCH 422/970] Change unit reference to unit_standard --- db/migrate/20200310044429_create_outcomes.rb | 4 +-- db/structure.sql | 26 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/db/migrate/20200310044429_create_outcomes.rb b/db/migrate/20200310044429_create_outcomes.rb index fbbf69bf2..5235af096 100644 --- a/db/migrate/20200310044429_create_outcomes.rb +++ b/db/migrate/20200310044429_create_outcomes.rb @@ -1,7 +1,7 @@ class CreateOutcomes < ActiveRecord::Migration[6.0] def change create_table :outcomes do |t| - t.references :unit, null: false, foreign_key: true + t.references :unit_standard, null: false, foreign_key: true t.references :parent, foreign_key: { to_table: :outcomes } t.string :code t.string :name @@ -15,6 +15,6 @@ def change add_presence_constraint :outcomes, :code add_presence_constraint :outcomes, :name - add_unique_constraint :outcomes, [:unit_id, :code] + add_unique_constraint :outcomes, [:unit_standard_id, :code] end end diff --git a/db/structure.sql b/db/structure.sql index 93e80185f..ba9a4414b 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -2256,7 +2256,7 @@ ALTER SEQUENCE public.meeting_agendas_id_seq OWNED BY public.meeting_agendas.id; CREATE TABLE public.outcomes ( id bigint NOT NULL, - unit_id bigint NOT NULL, + unit_standard_id bigint NOT NULL, parent_id bigint, code character varying, name character varying, @@ -5121,11 +5121,11 @@ ALTER TABLE ONLY public.outcomes -- --- Name: outcomes outcomes_unit_id_code_unique; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: outcomes outcomes_unit_standard_id_code_unique; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.outcomes - ADD CONSTRAINT outcomes_unit_id_code_unique UNIQUE (unit_id, code) DEFERRABLE; + ADD CONSTRAINT outcomes_unit_standard_id_code_unique UNIQUE (unit_standard_id, code) DEFERRABLE; -- @@ -6236,10 +6236,10 @@ CREATE INDEX index_outcomes_on_parent_id ON public.outcomes USING btree (parent_ -- --- Name: index_outcomes_on_unit_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_outcomes_on_unit_standard_id; Type: INDEX; Schema: public; Owner: - -- -CREATE INDEX index_outcomes_on_unit_id ON public.outcomes USING btree (unit_id); +CREATE INDEX index_outcomes_on_unit_standard_id ON public.outcomes USING btree (unit_standard_id); -- @@ -6743,6 +6743,14 @@ ALTER TABLE ONLY public.available_courses ADD CONSTRAINT fk_rails_356137da91 FOREIGN KEY (academic_term_id) REFERENCES public.academic_terms(id); +-- +-- Name: outcomes fk_rails_3634b68120; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.outcomes + ADD CONSTRAINT fk_rails_3634b68120 FOREIGN KEY (unit_standard_id) REFERENCES public.unit_standards(id); + + -- -- Name: group_courses fk_rails_3b3edaa11b; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -6943,14 +6951,6 @@ ALTER TABLE ONLY public.calendar_events ADD CONSTRAINT fk_rails_64d7b22524 FOREIGN KEY (calendar_event_type_id) REFERENCES public.calendar_event_types(id); --- --- Name: outcomes fk_rails_670b6764c7; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.outcomes - ADD CONSTRAINT fk_rails_670b6764c7 FOREIGN KEY (unit_id) REFERENCES public.units(id); - - -- -- Name: meeting_agendas fk_rails_694b3fc610; Type: FK CONSTRAINT; Schema: public; Owner: - -- From aeb22045b59a431ca923f19721186e6fe9f26baf Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 11 Mar 2020 10:03:11 +0300 Subject: [PATCH 423/970] Change unit relation to unit_standard --- app/models/outcome.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/models/outcome.rb b/app/models/outcome.rb index 57b9f0389..a17449b92 100644 --- a/app/models/outcome.rb +++ b/app/models/outcome.rb @@ -2,9 +2,12 @@ class Outcome < ApplicationRecord # relations - belongs_to :unit + belongs_to :unit_standard # validations - validates :code, presence: true, uniqueness: { scope: :unit_id }, length: { maximum: 10 } + validates :code, presence: true, uniqueness: { scope: :unit_standard_id }, length: { maximum: 10 } validates :name, presence: true, length: { maximum: 255 } + + # delegates + delegate :unit, to: :unit_standard end From 59e81656fcea98dc5a8a5ad52039632c9fa3113e Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 11 Mar 2020 10:03:51 +0300 Subject: [PATCH 424/970] Add outcomes relation --- app/models/unit_standard.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/unit_standard.rb b/app/models/unit_standard.rb index ae8a2b880..2e4a7368d 100644 --- a/app/models/unit_standard.rb +++ b/app/models/unit_standard.rb @@ -7,6 +7,7 @@ class UnitStandard < ApplicationRecord # relations belongs_to :standard belongs_to :unit + has_many :outcomes, dependent: :destroy # validations validates :standard, presence: true, uniqueness: { scope: :unit } From 75979358a51ec394f1861ab04a5f4d6b6e453e75 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 11 Mar 2020 10:54:50 +0300 Subject: [PATCH 425/970] Configure controller and view for new student fields --- app/controllers/students_controller.rb | 4 +++- app/views/students/edit.html.erb | 8 +++++++- app/views/user_management/users/_students.html.erb | 4 ++++ config/locales/models/user/en.yml | 10 ++++++++++ config/locales/models/user/tr.yml | 10 ++++++++++ 5 files changed, 34 insertions(+), 2 deletions(-) diff --git a/app/controllers/students_controller.rb b/app/controllers/students_controller.rb index b6d088ebb..e2f68aae9 100644 --- a/app/controllers/students_controller.rb +++ b/app/controllers/students_controller.rb @@ -21,6 +21,8 @@ def authorized? end def student_params - params.require(:student).permit(:student_number, :unit_id, :year, :semester, :scholarship_type_id) + params.require(:student).permit( + :student_number, :unit_id, :year, :semester, :scholarship_type_id, :status, :exceeded_education_period + ) end end diff --git a/app/views/students/edit.html.erb b/app/views/students/edit.html.erb index 097f12dd6..773436967 100644 --- a/app/views/students/edit.html.erb +++ b/app/views/students/edit.html.erb @@ -26,9 +26,15 @@
<%= f.input :semester, label: t('semester') %>
-
+
+ <%= f.input :status, collection: enum_options_for_select(f.object.class, :status), required: true %> +
+
<%= f.association :scholarship_type %>
+
+ <%= f.input :exceeded_education_period %> +
<%= f.button :submit, class: 'btn btn-outline-success btn-sm' %> <%= link_to_back user_path(@student.user) %> diff --git a/app/views/user_management/users/_students.html.erb b/app/views/user_management/users/_students.html.erb index f413d2f1d..f1c389067 100644 --- a/app/views/user_management/users/_students.html.erb +++ b/app/views/user_management/users/_students.html.erb @@ -12,17 +12,21 @@ <%= t('.student_number') %> + <%= t('.status') %> <%= t('year') %> <%= t('semester') %> <%= t('.scholarship_type') %> + <%= t('.exceeded_education_period') %> <%= student.student_number %> + <%= enum_t(student, :status) %> <%= student.year %> <%= student.semester %> <%= student.scholarship_type_name %> + <%= icon_for_check(student.exceeded_education_period) %> diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index 795132959..8467393f0 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -20,6 +20,8 @@ en: end_date: End Date start_date: Start Date student: &student_attributes + exceeded_education_period: Couldn't graduate during education period + status: Student Status student_number: Student Number scholarship_type: Scholarship Type unit: Unit @@ -44,6 +46,14 @@ en: public_studies: Show academic studies on my profile roles: Roles query_stores: Scope Queries + enums: + student: + statuses: + active: Active + disengaged: Disangaged + graduated: Graduated + not_enrolled: Not Enrolled + passive: Passive helpers: submit: user: diff --git a/config/locales/models/user/tr.yml b/config/locales/models/user/tr.yml index e774127e9..d3c775723 100644 --- a/config/locales/models/user/tr.yml +++ b/config/locales/models/user/tr.yml @@ -20,6 +20,8 @@ tr: end_date: Bitiş Tarihi start_date: Başlangıç Tarihi student: &student_attributes + exceeded_education_period: Eğitim süresi içerisinde mezun olamadı + status: Öğrenci Durumu student_number: Öğrenci Numarası scholarship_type: Burs Türü unit: Birim @@ -44,6 +46,14 @@ tr: public_studies: Profilimde Akademik Çalışmalarımı Göster roles: Roller query_stores: Kapsam Sorguları + enums: + student: + statuses: + active: Aktif + disengaged: İlişiği Kesik + graduated: Mezun + not_enrolled: Kayıtlanmamış + passive: Pasif helpers: submit: user: From 7382d273db858d813f439b157d39818263732e6a Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 11 Mar 2020 11:05:16 +0300 Subject: [PATCH 426/970] Create scope for exceeded education period students --- app/models/student.rb | 1 + test/fixtures/students.yml | 1 + test/models/student_test.rb | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/app/models/student.rb b/app/models/student.rb index 4db3d164a..8db30a616 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -25,6 +25,7 @@ class Student < ApplicationRecord has_many :course_enrollments, through: :semester_registrations # scopes + scope :exceeded, -> { where(exceeded_education_period: true) } scope :not_scholarships, -> { where(scholarship_type_id: nil) } scope :scholarships, -> { where.not(scholarship_type_id: nil) } diff --git a/test/fixtures/students.yml b/test/fixtures/students.yml index ca031a13d..b03360c13 100644 --- a/test/fixtures/students.yml +++ b/test/fixtures/students.yml @@ -21,3 +21,4 @@ john: status: active year: 2 semester: 3 + exceeded_education_period: true diff --git a/test/models/student_test.rb b/test/models/student_test.rb index 33f940ff8..5b84fccde 100644 --- a/test/models/student_test.rb +++ b/test/models/student_test.rb @@ -50,6 +50,10 @@ class StudentTest < ActiveSupport::TestCase end # scopes + test 'exceeded scope returns students with exceeded education period' do + assert_includes(Student.exceeded, students(:john)) + end + test 'not_scholarships scope returns students without scholarship' do assert_includes(Student.not_scholarships, students(:john)) end From 6e24c3e313982df7a866a4f6bac5652c84b28048 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 11 Mar 2020 11:14:59 +0300 Subject: [PATCH 427/970] Fix locale key --- app/views/outcome_management/unit_standards/index.html.erb | 2 +- .../controllers/outcome_management/unit_standards.en.yml | 2 +- .../controllers/outcome_management/unit_standards.tr.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/outcome_management/unit_standards/index.html.erb b/app/views/outcome_management/unit_standards/index.html.erb index 8d649287a..a6d89364a 100644 --- a/app/views/outcome_management/unit_standards/index.html.erb +++ b/app/views/outcome_management/unit_standards/index.html.erb @@ -4,7 +4,7 @@
<%= fa_icon 'align-justify', text: t('.card_header') %>
- <%= link_to_new(t('.new_unit_link'), new_unit_standard_path) %> + <%= link_to_new(t('.new_unit_standard_link'), new_unit_standard_path) %>
diff --git a/config/locales/controllers/outcome_management/unit_standards.en.yml b/config/locales/controllers/outcome_management/unit_standards.en.yml index 80f0c22f2..290032030 100644 --- a/config/locales/controllers/outcome_management/unit_standards.en.yml +++ b/config/locales/controllers/outcome_management/unit_standards.en.yml @@ -27,7 +27,7 @@ en: index: <<: *unit_standard_attributes card_header: Unit Standards - new_unit_link: Create a New Unit Standard + new_unit_standard_link: Create a New Unit Standard new: form_title: Create a Unit Standard show: diff --git a/config/locales/controllers/outcome_management/unit_standards.tr.yml b/config/locales/controllers/outcome_management/unit_standards.tr.yml index bca86b421..5d3a651c7 100644 --- a/config/locales/controllers/outcome_management/unit_standards.tr.yml +++ b/config/locales/controllers/outcome_management/unit_standards.tr.yml @@ -27,7 +27,7 @@ tr: index: <<: *unit_standard_attributes card_header: Birim Standartları - new_unit_link: Yeni Birim Standardı Oluştur + new_unit_standard_link: Yeni Birim Standardı Oluştur new: form_title: Birim Standardı Oluştur show: From e507b836f52b7d36a6ffbaac98160b1d10ccf826 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 11 Mar 2020 14:27:11 +0300 Subject: [PATCH 428/970] Add macro outcomes relation --- app/models/unit_standard.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/unit_standard.rb b/app/models/unit_standard.rb index 2e4a7368d..4b75c000c 100644 --- a/app/models/unit_standard.rb +++ b/app/models/unit_standard.rb @@ -8,6 +8,7 @@ class UnitStandard < ApplicationRecord belongs_to :standard belongs_to :unit has_many :outcomes, dependent: :destroy + has_many :macro_outcomes, -> { where(parent_id: nil) }, class_name: 'Outcome', inverse_of: :unit_standard # validations validates :standard, presence: true, uniqueness: { scope: :unit } From b76ae70205d7d69643fcf7d2ac3ee15802f65617 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 11 Mar 2020 14:32:59 +0300 Subject: [PATCH 429/970] Fix paramaters in render --- app/views/outcome_management/unit_standards/edit.html.erb | 2 +- app/views/outcome_management/unit_standards/new.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/outcome_management/unit_standards/edit.html.erb b/app/views/outcome_management/unit_standards/edit.html.erb index 072a77789..66a539974 100644 --- a/app/views/outcome_management/unit_standards/edit.html.erb +++ b/app/views/outcome_management/unit_standards/edit.html.erb @@ -1 +1 @@ -<%= render 'form', unit: @unit_standard, form_title: t('.form_title') %> +<%= render 'form', unit_standard: @unit_standard, form_title: t('.form_title') %> diff --git a/app/views/outcome_management/unit_standards/new.html.erb b/app/views/outcome_management/unit_standards/new.html.erb index 072a77789..66a539974 100644 --- a/app/views/outcome_management/unit_standards/new.html.erb +++ b/app/views/outcome_management/unit_standards/new.html.erb @@ -1 +1 @@ -<%= render 'form', unit: @unit_standard, form_title: t('.form_title') %> +<%= render 'form', unit_standard: @unit_standard, form_title: t('.form_title') %> From e6828fd462f2f8b9f7a3dd503704eb73936ac85b Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 11 Mar 2020 14:33:36 +0300 Subject: [PATCH 430/970] Add ordered scope --- app/models/outcome.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/outcome.rb b/app/models/outcome.rb index a17449b92..f5dd567d2 100644 --- a/app/models/outcome.rb +++ b/app/models/outcome.rb @@ -10,4 +10,7 @@ class Outcome < ApplicationRecord # delegates delegate :unit, to: :unit_standard + + # scopes + scope :ordered, -> { order(:code) } end From ea5883dc149b57a78af0d2d0c3c519aaeb39564c Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 11 Mar 2020 14:34:03 +0300 Subject: [PATCH 431/970] Add unit_standard fixture --- test/fixtures/outcomes.yml | 2 +- test/fixtures/unit_standards.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/unit_standards.yml diff --git a/test/fixtures/outcomes.yml b/test/fixtures/outcomes.yml index fba985842..acc472a3e 100644 --- a/test/fixtures/outcomes.yml +++ b/test/fixtures/outcomes.yml @@ -1,4 +1,4 @@ one: - unit: bilgisayar_muhendisligi_programi + unit_standard: one code: PÇ-1 name: Uygulama becerisi diff --git a/test/fixtures/unit_standards.yml b/test/fixtures/unit_standards.yml new file mode 100644 index 000000000..0c95fd8cf --- /dev/null +++ b/test/fixtures/unit_standards.yml @@ -0,0 +1,4 @@ +one: + unit: bilgisayar_muhendisligi_programi + standard: mudek + status: active From 84ce64e47311c127ca2de9182aa441133d141b5f Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 11 Mar 2020 14:35:27 +0300 Subject: [PATCH 432/970] Show macro outcomes in unit standard view --- .../unit_standards_controller.rb | 1 + .../unit_standards/show.html.erb | 33 +++++++++++++++++++ .../outcome_management/unit_standards.en.yml | 4 +++ .../outcome_management/unit_standards.tr.yml | 4 +++ 4 files changed, 42 insertions(+) diff --git a/app/controllers/outcome_management/unit_standards_controller.rb b/app/controllers/outcome_management/unit_standards_controller.rb index 8227488ef..a55ca91b3 100644 --- a/app/controllers/outcome_management/unit_standards_controller.rb +++ b/app/controllers/outcome_management/unit_standards_controller.rb @@ -13,6 +13,7 @@ def index def show @unit = @unit_standard.unit + @outcomes = @unit_standard.macro_outcomes.ordered end def new diff --git a/app/views/outcome_management/unit_standards/show.html.erb b/app/views/outcome_management/unit_standards/show.html.erb index e4ffd5432..ad7efb08a 100644 --- a/app/views/outcome_management/unit_standards/show.html.erb +++ b/app/views/outcome_management/unit_standards/show.html.erb @@ -37,3 +37,36 @@
+ +
+
+
+
+ <%= fa_icon 'dot-circle-o', text: t('.card_header') %> +
+ <%= link_to_new(t('.new_outcome_link'), new_unit_standard_outcome_path(@unit_standard)) %> +
+
+
+ + + + + + + + + + <% @outcomes.each do |outcome| %> + + + + + + <% end %> + +
<%= t('.outcome_code') %><%= t('.outcome_name') %><%= t('actions') %>
<%= outcome.code %><%= outcome.name %><%= link_to_show([@unit_standard, outcome]) %>
+
+
+
+
diff --git a/config/locales/controllers/outcome_management/unit_standards.en.yml b/config/locales/controllers/outcome_management/unit_standards.en.yml index 290032030..f142aff6f 100644 --- a/config/locales/controllers/outcome_management/unit_standards.en.yml +++ b/config/locales/controllers/outcome_management/unit_standards.en.yml @@ -32,5 +32,9 @@ en: form_title: Create a Unit Standard show: <<: *unit_standard_attributes + card_header: Learning Outcomes + new_outcome_link: Create a New Learning Outcome + outcome_code: Code + outcome_name: Name update: success: Unit standard successfully updated. diff --git a/config/locales/controllers/outcome_management/unit_standards.tr.yml b/config/locales/controllers/outcome_management/unit_standards.tr.yml index 5d3a651c7..b3ac3e2ea 100644 --- a/config/locales/controllers/outcome_management/unit_standards.tr.yml +++ b/config/locales/controllers/outcome_management/unit_standards.tr.yml @@ -32,5 +32,9 @@ tr: form_title: Birim Standardı Oluştur show: <<: *unit_standard_attributes + card_header: Öğrenim Çıktıları + new_outcome_link: Yeni Öğrenim Çıktısı Oluştur + outcome_code: Kodu + outcome_name: Adı update: success: Birim standardı başarıyla güncellendi. From 496d402fc0542f39299b81e70e7a3ffae25b27e3 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 11 Mar 2020 14:35:58 +0300 Subject: [PATCH 433/970] Add outcomes routes --- config/routes/outcome_management.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/routes/outcome_management.rb b/config/routes/outcome_management.rb index 3c90cbaae..a5fb2d8f2 100644 --- a/config/routes/outcome_management.rb +++ b/config/routes/outcome_management.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true scope module: :outcome_management do - resources :unit_standards + resources :unit_standards do + resources :outcomes, except: :index + end end From 9b8fac1cb442852a138980c97d1c06f94cc60995 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 11 Mar 2020 16:24:42 +0300 Subject: [PATCH 434/970] Add outcomes controller & views --- .../outcome_management/outcomes_controller.rb | 50 +++++++++++++++++++ .../outcomes/_form.html.erb | 30 +++++++++++ .../outcome_management/outcomes/edit.html.erb | 1 + .../outcomes/index.html.erb | 37 ++++++++++++++ .../outcome_management/outcomes/new.html.erb | 1 + .../outcome_management/outcomes/show.html.erb | 27 ++++++++++ .../outcome_management/outcomes.en.yml | 26 ++++++++++ .../outcome_management/outcomes.tr.yml | 26 ++++++++++ 8 files changed, 198 insertions(+) create mode 100644 app/controllers/outcome_management/outcomes_controller.rb create mode 100644 app/views/outcome_management/outcomes/_form.html.erb create mode 100644 app/views/outcome_management/outcomes/edit.html.erb create mode 100644 app/views/outcome_management/outcomes/index.html.erb create mode 100644 app/views/outcome_management/outcomes/new.html.erb create mode 100644 app/views/outcome_management/outcomes/show.html.erb create mode 100644 config/locales/controllers/outcome_management/outcomes.en.yml create mode 100644 config/locales/controllers/outcome_management/outcomes.tr.yml diff --git a/app/controllers/outcome_management/outcomes_controller.rb b/app/controllers/outcome_management/outcomes_controller.rb new file mode 100644 index 000000000..6f962a664 --- /dev/null +++ b/app/controllers/outcome_management/outcomes_controller.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module OutcomeManagement + class OutcomesController < ApplicationController + include SearchableModule + + before_action :set_unit_standard + before_action :set_outcome, except: %i[new create] + + def show; end + + def new + @outcome = @unit_standard.outcomes.new + end + + def edit; end + + def create + @outcome = @unit_standard.outcomes.new(outcome_params) + @outcome.save ? redirect_with('success') : render(:new) + end + + def update + @outcome.update(outcome_params) ? redirect_with('success') : render(:edit) + end + + def destroy + message = @outcome.destroy ? 'success' : 'error' + redirect_with(message) + end + + private + + def redirect_with(message) + redirect_to unit_standard_path(@unit_standard), flash: { notice: t(".#{message}") } + end + + def set_unit_standard + @unit_standard = UnitStandard.find(params[:unit_standard_id]) + end + + def set_outcome + @outcome = @unit_standard.outcomes.find(params[:id]) + end + + def outcome_params + params.require(:outcome).permit(:code, :name, :parent_id, :unit_standard_id) + end + end +end diff --git a/app/views/outcome_management/outcomes/_form.html.erb b/app/views/outcome_management/outcomes/_form.html.erb new file mode 100644 index 000000000..45b0b2809 --- /dev/null +++ b/app/views/outcome_management/outcomes/_form.html.erb @@ -0,0 +1,30 @@ +
+
+
+
+ <%= fa_icon 'dot-circle-o' %> + <%= form_title %> +
+
+ <%= simple_form_for([@unit_standard, @outcome]) do |f| %> +
+
+ <%= f.error_notification %> +
+
+ <%= f.input :code %> +
+
+ <%= f.input :name, as: :text, input_html: { rows: 5 } %> +
+ +
+ <%= f.button :submit, class: 'btn btn-outline-success btn-sm' %> + <%= link_to_back(:back) %> +
+
+ <% end %> +
+
+
+
diff --git a/app/views/outcome_management/outcomes/edit.html.erb b/app/views/outcome_management/outcomes/edit.html.erb new file mode 100644 index 000000000..47600f272 --- /dev/null +++ b/app/views/outcome_management/outcomes/edit.html.erb @@ -0,0 +1 @@ +<%= render 'form', outcome: @outcome, form_title: t('.form_title') %> diff --git a/app/views/outcome_management/outcomes/index.html.erb b/app/views/outcome_management/outcomes/index.html.erb new file mode 100644 index 000000000..b65b1deab --- /dev/null +++ b/app/views/outcome_management/outcomes/index.html.erb @@ -0,0 +1,37 @@ +
+
+
+
+ <%= fa_icon 'align-justify', text: t('.card_header') %> +
+ <%= link_to_new(t('.new_outcome_link'), new_unit_standard_outcome_path(@unit_standard)) %> +
+
+
+ + + + + + + + + + <% @outcomes.each do |outcome| %> + + + + + + <% end %> + +
<%= t('.code') %><%= t('.name') %><%= t('actions') %>
<%= outcome.code %><%= outcome.name %><%= link_to_actions[@unit_standard, outcome]) %>
+
+
+ +
+
diff --git a/app/views/outcome_management/outcomes/new.html.erb b/app/views/outcome_management/outcomes/new.html.erb new file mode 100644 index 000000000..47600f272 --- /dev/null +++ b/app/views/outcome_management/outcomes/new.html.erb @@ -0,0 +1 @@ +<%= render 'form', outcome: @outcome, form_title: t('.form_title') %> diff --git a/app/views/outcome_management/outcomes/show.html.erb b/app/views/outcome_management/outcomes/show.html.erb new file mode 100644 index 000000000..c39791eda --- /dev/null +++ b/app/views/outcome_management/outcomes/show.html.erb @@ -0,0 +1,27 @@ +
+
+
+
+ <%= fa_icon 'dot-circle-o' %><%= @outcome.code %> +
+ <%= link_to_actions([@unit_standard, @outcome], except: :show) %> +
+
+ +
+ + + + + + + + + + + +
<%= t('.code') %><%= @outcome.code %>
<%= t('.name') %><%= @outcome.name %>
+
+
+
+
diff --git a/config/locales/controllers/outcome_management/outcomes.en.yml b/config/locales/controllers/outcome_management/outcomes.en.yml new file mode 100644 index 000000000..e609c0b78 --- /dev/null +++ b/config/locales/controllers/outcome_management/outcomes.en.yml @@ -0,0 +1,26 @@ +tr: + activerecord: + attributes: + outcome: &outcome_attributes + code: Code + name: Name + helpers: + submit: + outcome: + create: Create Learning Outcome + update: Update Learning Outcome + outcome_management: + outcomes: + create: + success: Learning outcome successfully created. + destroy: + success: Learning outcome successfully deleted. + warning: Learning outcome can not be deleted. + edit: + form_title: Create a Learning Outcome + new: + form_title: Create a New Learning Outcome + show: + <<: *outcome_attributes + update: + success: Learning outcome successfully updated. diff --git a/config/locales/controllers/outcome_management/outcomes.tr.yml b/config/locales/controllers/outcome_management/outcomes.tr.yml new file mode 100644 index 000000000..0ad69162e --- /dev/null +++ b/config/locales/controllers/outcome_management/outcomes.tr.yml @@ -0,0 +1,26 @@ +tr: + activerecord: + attributes: + outcome: &outcome_attributes + code: Kod + name: Adı + helpers: + submit: + outcome: + create: Öğrenim Çıktısı Oluştur + update: Öğrenim Çıktısını Güncelle + outcome_management: + outcomes: + create: + success: Öğrenim çıktısı başarıyla oluşturuldu. + destroy: + success: Öğrenim çıktısı başarıyla silindi. + warning: Öğrenim çıktısı silinemedi. + edit: + form_title: Öğrenim Çıktısını Güncelle + new: + form_title: Öğrenim Çıktısı Oluştur + show: + <<: *outcome_attributes + update: + success: Öğrenim çıktısı başarıyla güncellendi. From 3da341b0a4ec1a2f79f1bf39e170792d732828ee Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 11 Mar 2020 19:15:32 +0300 Subject: [PATCH 435/970] Remove outcomes relation --- app/models/unit.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/models/unit.rb b/app/models/unit.rb index e6e4dd1f9..061410d7a 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -49,7 +49,6 @@ class Unit < ApplicationRecord has_many :calendars, through: :unit_calendars has_many :unit_tuitions, dependent: :destroy has_many :tuitions, through: :unit_tuitions - has_many :outcomes, dependent: :destroy # validations validates :name, presence: true, From d31d3f73a0d8831e895f186c0b080a3a2a25618a Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 12 Mar 2020 11:54:24 +0300 Subject: [PATCH 436/970] Don't use 'not' prefix in enum --- app/models/student.rb | 10 +++++----- config/locales/models/user/en.yml | 2 +- config/locales/models/user/tr.yml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/student.rb b/app/models/student.rb index 8db30a616..b9e7da1b5 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -7,11 +7,11 @@ class Student < ApplicationRecord # enums enum status: { - active: 1, - passive: 2, - disengaged: 3, - not_enrolled: 4, - graduated: 5 + active: 1, + passive: 2, + disengaged: 3, + unenrolled: 4, + graduated: 5 } # relations diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index 8467393f0..7d9e6149a 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -52,7 +52,7 @@ en: active: Active disengaged: Disangaged graduated: Graduated - not_enrolled: Not Enrolled + unenrolled: Not Enrolled passive: Passive helpers: submit: diff --git a/config/locales/models/user/tr.yml b/config/locales/models/user/tr.yml index d3c775723..95e2eb7c8 100644 --- a/config/locales/models/user/tr.yml +++ b/config/locales/models/user/tr.yml @@ -52,7 +52,7 @@ tr: active: Aktif disengaged: İlişiği Kesik graduated: Mezun - not_enrolled: Kayıtlanmamış + unenrolled: Kayıtlanmamış passive: Pasif helpers: submit: From 013487ddc074bd98d1090e40efe03aee3c6a95db Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 12 Mar 2020 11:56:40 +0300 Subject: [PATCH 437/970] Fix typo --- config/locales/models/user/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index 7d9e6149a..77dda1c52 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -50,7 +50,7 @@ en: student: statuses: active: Active - disengaged: Disangaged + disengaged: Disengaged graduated: Graduated unenrolled: Not Enrolled passive: Passive From cde937ab5be7e04a8af6fa158bd7866079270c81 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 12 Mar 2020 13:27:21 +0300 Subject: [PATCH 438/970] Fix student test --- test/models/student_test.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/models/student_test.rb b/test/models/student_test.rb index 5b84fccde..409fd8238 100644 --- a/test/models/student_test.rb +++ b/test/models/student_test.rb @@ -11,11 +11,11 @@ class StudentTest < ActiveSupport::TestCase # enums enum status: { - active: 1, - passive: 2, - disengaged: 3, - not_enrolled: 4, - graduated: 5 + active: 1, + passive: 2, + disengaged: 3, + unenrolled: 4, + graduated: 5 } # relations From d6fa5235beefe7e972160f48a11494c459214f99 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 13 Mar 2020 11:03:28 +0300 Subject: [PATCH 439/970] Fix prospective student controller test --- .../prospective_students_controller_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/controllers/first_registration/prospective_students_controller_test.rb b/test/controllers/first_registration/prospective_students_controller_test.rb index 5d076e2da..7575abf0d 100644 --- a/test/controllers/first_registration/prospective_students_controller_test.rb +++ b/test/controllers/first_registration/prospective_students_controller_test.rb @@ -92,7 +92,7 @@ class ProspectiveStudentsControllerTest < ActionDispatch::IntegrationTest assert_equal 'register', @controller.action_name assert_equal @prospective_student.email, user.email assert_equal user, student.user - assert(student.permanently_registered) + assert student.active? assert_redirected_to :prospective_students assert_equal translate('.register.success'), flash[:notice] end @@ -114,7 +114,7 @@ class ProspectiveStudentsControllerTest < ActionDispatch::IntegrationTest assert_equal 'register', @controller.action_name assert_equal john.email, user.email assert_equal user, student.user - assert_not(student.permanently_registered) + assert_not student.active? assert_redirected_to :prospective_students assert_equal translate('.register.success'), flash[:notice] end From c2afec08dfb6809ee24f79263bf4347ccf1bfd1e Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 13 Mar 2020 12:10:02 +0300 Subject: [PATCH 440/970] Don't remove permanently_registered field --- app/models/prospective_student.rb | 13 +++++++------ app/models/student.rb | 1 + ...tatusand_exceeded_education_period_to_student.rb | 3 --- db/structure.sql | 2 ++ .../prospective_students_controller_test.rb | 4 ++-- test/fixtures/students.yml | 3 +++ test/models/student_test.rb | 1 + 7 files changed, 16 insertions(+), 11 deletions(-) diff --git a/app/models/prospective_student.rb b/app/models/prospective_student.rb index 3e761ecb4..788e751e2 100644 --- a/app/models/prospective_student.rb +++ b/app/models/prospective_student.rb @@ -84,12 +84,13 @@ def can_temporarily_register? def registered_user(user) Student.new( - user: user, - unit: unit, - status: can_permanently_register? ? :active : :passive, - student_number: id_number, # TODO: must be generated - year: 1, # TODO: can have a different value depending on the characteristics of the program - semester: 1 + user: user, + unit: unit, + permanently_registered: can_permanently_register?, + status: can_permanently_register? ? :active : :passive, + student_number: id_number, # TODO: must be generated + year: 1, # TODO: can have a different value depending on the characteristics of the program + semester: 1 ) end diff --git a/app/models/student.rb b/app/models/student.rb index b9e7da1b5..3ee248688 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -32,6 +32,7 @@ class Student < ApplicationRecord # validations validates :exceeded_education_period, inclusion: { in: [true, false] } validates :unit_id, uniqueness: { scope: %i[user] } + validates :permanently_registered, inclusion: { in: [true, false] } # TODO: Will set equal_to: N, when we decide about student numbers validates :student_number, presence: true, uniqueness: true, length: { maximum: 255 } validates :semester, numericality: { greater_than: 0 } diff --git a/db/migrate/20200310101357_add_statusand_exceeded_education_period_to_student.rb b/db/migrate/20200310101357_add_statusand_exceeded_education_period_to_student.rb index 624005653..3a76b2d91 100644 --- a/db/migrate/20200310101357_add_statusand_exceeded_education_period_to_student.rb +++ b/db/migrate/20200310101357_add_statusand_exceeded_education_period_to_student.rb @@ -7,8 +7,5 @@ def change add_null_constraint :students, :status add_numericality_constraint :students, :status, greater_than_or_equal_to: 0 - - remove_null_constraint :students, :permanently_registered - remove_column :students, :permanently_registered, :boolean, default: false end end diff --git a/db/structure.sql b/db/structure.sql index 45656a02c..05b739889 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -3328,8 +3328,10 @@ CREATE TABLE public.students ( semester integer, year integer, scholarship_type_id bigint, + permanently_registered boolean DEFAULT false, status integer DEFAULT 1, exceeded_education_period boolean DEFAULT false, + CONSTRAINT students_permanently_registered_null CHECK ((permanently_registered IS NOT NULL)), CONSTRAINT students_semester_null CHECK ((semester IS NOT NULL)), CONSTRAINT students_semester_numericality CHECK ((semester > 0)), CONSTRAINT students_status_null CHECK ((status IS NOT NULL)), diff --git a/test/controllers/first_registration/prospective_students_controller_test.rb b/test/controllers/first_registration/prospective_students_controller_test.rb index 7575abf0d..5d076e2da 100644 --- a/test/controllers/first_registration/prospective_students_controller_test.rb +++ b/test/controllers/first_registration/prospective_students_controller_test.rb @@ -92,7 +92,7 @@ class ProspectiveStudentsControllerTest < ActionDispatch::IntegrationTest assert_equal 'register', @controller.action_name assert_equal @prospective_student.email, user.email assert_equal user, student.user - assert student.active? + assert(student.permanently_registered) assert_redirected_to :prospective_students assert_equal translate('.register.success'), flash[:notice] end @@ -114,7 +114,7 @@ class ProspectiveStudentsControllerTest < ActionDispatch::IntegrationTest assert_equal 'register', @controller.action_name assert_equal john.email, user.email assert_equal user, student.user - assert_not student.active? + assert_not(student.permanently_registered) assert_redirected_to :prospective_students assert_equal translate('.register.success'), flash[:notice] end diff --git a/test/fixtures/students.yml b/test/fixtures/students.yml index b03360c13..2e01ffb69 100644 --- a/test/fixtures/students.yml +++ b/test/fixtures/students.yml @@ -2,6 +2,7 @@ serhat: student_number: 12345 user: serhat unit: bilgisayar_muhendisligi_programi + permanently_registered: true year: 2 semester: 3 status: active @@ -11,6 +12,7 @@ serhat_omu: student_number: 98765 user: serhat unit: matematik_ogretmenligi_programi + permanently_registered: true status: active year: 1 semester: 1 @@ -18,6 +20,7 @@ john: student_number: 45612 user: john unit: bilgisayar_muhendisligi_programi + permanently_registered: true status: active year: 2 semester: 3 diff --git a/test/models/student_test.rb b/test/models/student_test.rb index 409fd8238..371b9e7d2 100644 --- a/test/models/student_test.rb +++ b/test/models/student_test.rb @@ -30,6 +30,7 @@ class StudentTest < ActiveSupport::TestCase # validations: presence validates_presence_of :student_number + validates_presence_of :permanently_registered validates_presence_of :semester validates_presence_of :year From 19cd9da3c3c175b4ff6020b70a3437cefe5164bd Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2020 22:10:08 +0000 Subject: [PATCH 441/970] chore(deps): [security] bump acorn from 6.4.0 to 6.4.1 Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. **This update includes a security fix.** - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index d1081bbc0..a561587cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1131,9 +1131,9 @@ acorn-jsx@^5.1.0: integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw== acorn@^6.2.1: - version "6.4.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784" - integrity sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw== + version "6.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" + integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== acorn@^7.1.0: version "7.1.0" From bde9c83d63836fbcb450da1d2a2e9ef54f593682 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 00:34:38 +0000 Subject: [PATCH 442/970] chore(deps-dev): bump rubocop-minitest from 0.6.2 to 0.7.0 Bumps [rubocop-minitest](https://github.com/rubocop-hq/rubocop-minitest) from 0.6.2 to 0.7.0. - [Release notes](https://github.com/rubocop-hq/rubocop-minitest/releases) - [Changelog](https://github.com/rubocop-hq/rubocop-minitest/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop-hq/rubocop-minitest/compare/v0.6.2...v0.7.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b6b45f18d..52dda1ad8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -353,7 +353,7 @@ GEM rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.7) - rubocop-minitest (0.6.2) + rubocop-minitest (0.7.0) rubocop (>= 0.74) rubocop-performance (1.5.2) rubocop (>= 0.71.0) From c162c2ddecabd073e9d66ed7e38cf70fe46b8a08 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 00:35:08 +0000 Subject: [PATCH 443/970] chore(deps-dev): bump webmock from 3.8.2 to 3.8.3 Bumps [webmock](https://github.com/bblimke/webmock) from 3.8.2 to 3.8.3. - [Release notes](https://github.com/bblimke/webmock/releases) - [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md) - [Commits](https://github.com/bblimke/webmock/compare/v3.8.2...v3.8.3) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b6b45f18d..a4337abff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -448,7 +448,7 @@ GEM webfinger (1.1.0) activesupport httpclient (>= 2.4) - webmock (3.8.2) + webmock (3.8.3) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) From a7c36a1e07168a38666c50a531eddbf7e1606b58 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 00:35:38 +0000 Subject: [PATCH 444/970] chore(deps-dev): bump rack-mini-profiler from 1.1.6 to 2.0.0 Bumps [rack-mini-profiler](https://github.com/MiniProfiler/rack-mini-profiler) from 1.1.6 to 2.0.0. - [Release notes](https://github.com/MiniProfiler/rack-mini-profiler/releases) - [Changelog](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/CHANGELOG.md) - [Commits](https://github.com/MiniProfiler/rack-mini-profiler/compare/v1.1.6...v2.0.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b6b45f18d..72a69dde1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -290,7 +290,7 @@ GEM rack (2.2.2) rack-attack (6.2.2) rack (>= 1.0, < 3) - rack-mini-profiler (1.1.6) + rack-mini-profiler (2.0.0) rack (>= 1.2.0) rack-oauth2 (1.10.1) activesupport From 05295ac8d31a03a30c9efb0e1692e8a6a56012af Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 00:36:15 +0000 Subject: [PATCH 445/970] chore(deps): bump aws-sdk-core from 3.90.1 to 3.91.0 Bumps [aws-sdk-core](https://github.com/aws/aws-sdk-ruby) from 3.90.1 to 3.91.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-core/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b6b45f18d..068693f83 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -95,7 +95,7 @@ GEM httpclient (>= 2.5.3.3) aws-eventstream (1.0.3) aws-partitions (1.281.0) - aws-sdk-core (3.90.1) + aws-sdk-core (3.91.0) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) From 3a2a189be5ae675207d27d26231b984e32b6e78a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 00:36:50 +0000 Subject: [PATCH 446/970] chore(deps): bump aws-sdk-s3 from 1.60.2 to 1.61.0 Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.60.2 to 1.61.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/compare/v1.60.2...v1.61.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b6b45f18d..f75c705f4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -95,15 +95,15 @@ GEM httpclient (>= 2.5.3.3) aws-eventstream (1.0.3) aws-partitions (1.281.0) - aws-sdk-core (3.90.1) + aws-sdk-core (3.91.0) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.29.0) + aws-sdk-kms (1.30.0) aws-sdk-core (~> 3, >= 3.71.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.60.2) + aws-sdk-s3 (1.61.0) aws-sdk-core (~> 3, >= 3.83.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) From cc0b99db2c967adaec00ec293bb802bf772ec168 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 00:37:43 +0000 Subject: [PATCH 447/970] chore(deps): bump aws-sdk-kms from 1.29.0 to 1.30.0 Bumps [aws-sdk-kms](https://github.com/aws/aws-sdk-ruby) from 1.29.0 to 1.30.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-kms/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/compare/1.29.0...1.30.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b6b45f18d..aedf34acd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -95,12 +95,12 @@ GEM httpclient (>= 2.5.3.3) aws-eventstream (1.0.3) aws-partitions (1.281.0) - aws-sdk-core (3.90.1) + aws-sdk-core (3.91.0) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.29.0) + aws-sdk-kms (1.30.0) aws-sdk-core (~> 3, >= 3.71.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.60.2) From 456d685e2dc120c3df32a03b72b2b0f0881a89e5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 00:38:24 +0000 Subject: [PATCH 448/970] chore(deps): bump bootsnap from 1.4.5 to 1.4.6 Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.4.5 to 1.4.6. - [Release notes](https://github.com/Shopify/bootsnap/releases) - [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md) - [Commits](https://github.com/Shopify/bootsnap/compare/v1.4.5...v1.4.6) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b6b45f18d..cde1b7244 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -120,7 +120,7 @@ GEM smart_properties bindata (2.4.6) bindex (0.8.1) - bootsnap (1.4.5) + bootsnap (1.4.6) msgpack (~> 1.0) brakeman (4.8.0) builder (3.2.4) From 2342b40eb6fd2de415549b03ee12008438b6de9f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 00:39:06 +0000 Subject: [PATCH 449/970] chore(deps): bump sorbet-runtime from 0.5.5427 to 0.5.5439 Bumps [sorbet-runtime](https://github.com/sorbet/sorbet) from 0.5.5427 to 0.5.5439. - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b6b45f18d..d177643b0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -394,7 +394,7 @@ GEM slack-notifier (2.3.2) smart_properties (1.15.0) smstools (0.2.0) - sorbet-runtime (0.5.5427) + sorbet-runtime (0.5.5439) spring (2.1.0) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) From ba022bcfdc13564f13e75684041fdcd1461e426d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 00:39:32 +0000 Subject: [PATCH 450/970] chore(deps): bump rubyzip from 2.2.0 to 2.3.0 Bumps [rubyzip](https://github.com/rubyzip/rubyzip) from 2.2.0 to 2.3.0. - [Release notes](https://github.com/rubyzip/rubyzip/releases) - [Changelog](https://github.com/rubyzip/rubyzip/blob/master/Changelog.md) - [Commits](https://github.com/rubyzip/rubyzip/compare/v2.2.0...v2.3.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b6b45f18d..596fcae0f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -363,7 +363,7 @@ GEM ruby-progressbar (1.10.1) ruby-vips (2.0.17) ffi (~> 1.9) - rubyzip (2.2.0) + rubyzip (2.3.0) safe_yaml (1.0.5) sassc (2.2.1) ffi (~> 1.9) From 81a2bb0cdaf7e89214f4771da04b048b79ecd561 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 00:59:52 +0000 Subject: [PATCH 451/970] chore(deps): bump regenerator-transform from 0.14.1 to 0.14.3 Bumps [regenerator-transform](https://github.com/facebook/regenerator) from 0.14.1 to 0.14.3. - [Release notes](https://github.com/facebook/regenerator/releases) - [Commits](https://github.com/facebook/regenerator/compare/regenerator-transform@0.14.1...regenerator-transform@0.14.3) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/yarn.lock b/yarn.lock index a561587cb..e7c80da46 100644 --- a/yarn.lock +++ b/yarn.lock @@ -701,12 +701,12 @@ js-levenshtein "^1.1.3" semver "^5.5.0" -"@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2": - version "7.7.7" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.7.7.tgz#194769ca8d6d7790ec23605af9ee3e42a0aa79cf" - integrity sha512-uCnC2JEVAu8AKB5do1WRIsvrdJ0flYx/A/9f/6chdacnEZ7LmavjdsDXr5ksYBegxtuTPR5Va9/+13QF/kFkCA== +"@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4": + version "7.8.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.8.7.tgz#8fefce9802db54881ba59f90bb28719b4996324d" + integrity sha512-+AATMUFppJDw6aiR5NVPHqIQBlV/Pj8wY/EZH+lmvRdUo9xBaz/rF3alAwFJQavvKfeOlPE7oaaDHVbcySbCsg== dependencies: - regenerator-runtime "^0.13.2" + regenerator-runtime "^0.13.4" "@babel/template@^7.7.4": version "7.7.4" @@ -6642,7 +6642,7 @@ prepend-http@^1.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= -private@^0.1.6: +private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== @@ -6940,12 +6940,18 @@ regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.3: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5" integrity sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw== +regenerator-runtime@^0.13.4: + version "0.13.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697" + integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA== + regenerator-transform@^0.14.0: - version "0.14.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.1.tgz#3b2fce4e1ab7732c08f665dfdb314749c7ddd2fb" - integrity sha512-flVuee02C3FKRISbxhXl9mGzdbWUVHubl1SMaknjxkFB1/iqpJhArQUvRxOOPEc/9tAiX0BaQ28FJH10E4isSQ== + version "0.14.3" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.3.tgz#54aebff2ef58c0ae61e695ad1b9a9d65995fff78" + integrity sha512-zXHNKJspmONxBViAb3ZUmFoFPnTBs3zFhCEZJiwp/gkNzxVbTqNJVjYKx6Qk1tQ1P4XLf4TbH9+KBB7wGoAaUw== dependencies: - private "^0.1.6" + "@babel/runtime" "^7.8.4" + private "^0.1.8" regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" From 73828dd917f5f29c8f9432cefed9f5f35989660c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 01:00:41 +0000 Subject: [PATCH 452/970] chore(deps): bump unicode-property-aliases-ecmascript Bumps [unicode-property-aliases-ecmascript](https://github.com/mathiasbynens/unicode-property-aliases-ecmascript) from 1.0.5 to 1.1.0. - [Release notes](https://github.com/mathiasbynens/unicode-property-aliases-ecmascript/releases) - [Commits](https://github.com/mathiasbynens/unicode-property-aliases-ecmascript/compare/v1.0.5...v1.1.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index a561587cb..0a730fcbb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8143,9 +8143,9 @@ unicode-match-property-value-ecmascript@^1.1.0: integrity sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g== unicode-property-aliases-ecmascript@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57" - integrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== + version "1.1.0" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz#dd57a99f6207bedff4628abefb94c50db941c8f4" + integrity sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg== union-value@^1.0.0: version "1.0.1" From d0f711fadc99ca40755387102df47abd08843015 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 01:02:31 +0000 Subject: [PATCH 453/970] chore(deps): bump espree from 6.1.2 to 6.2.1 Bumps [espree](https://github.com/eslint/espree) from 6.1.2 to 6.2.1. - [Release notes](https://github.com/eslint/espree/releases) - [Changelog](https://github.com/eslint/espree/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/espree/compare/v6.1.2...v6.2.1) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/yarn.lock b/yarn.lock index a561587cb..abc6bc446 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1125,20 +1125,20 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" -acorn-jsx@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384" - integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw== +acorn-jsx@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe" + integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ== acorn@^6.2.1: version "6.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== -acorn@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" - integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== +acorn@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf" + integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg== aggregate-error@^3.0.0: version "3.0.1" @@ -3089,12 +3089,12 @@ eslint@^6.7.2: v8-compile-cache "^2.0.3" espree@^6.1.2: - version "6.1.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.2.tgz#6c272650932b4f91c3714e5e7b5f5e2ecf47262d" - integrity sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA== + version "6.2.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.2.1.tgz#77fc72e1fd744a2052c20f38a5b575832e82734a" + integrity sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw== dependencies: - acorn "^7.1.0" - acorn-jsx "^5.1.0" + acorn "^7.1.1" + acorn-jsx "^5.2.0" eslint-visitor-keys "^1.1.0" esprima@^4.0.0: From 4aed1398c2c737bd2b344353aa2639849bad54e2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 01:03:12 +0000 Subject: [PATCH 454/970] chore(deps): bump spark-md5 from 3.0.0 to 3.0.1 Bumps [spark-md5](https://github.com/satazor/js-spark-md5) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/satazor/js-spark-md5/releases) - [Commits](https://github.com/satazor/js-spark-md5/commits) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index a561587cb..761d79bfa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7522,9 +7522,9 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== spark-md5@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spark-md5/-/spark-md5-3.0.0.tgz#3722227c54e2faf24b1dc6d933cc144e6f71bfef" - integrity sha1-NyIifFTi+vJLHcbZM8wUTm9xv+8= + version "3.0.1" + resolved "https://registry.yarnpkg.com/spark-md5/-/spark-md5-3.0.1.tgz#83a0e255734f2ab4e5c466e5a2cfc9ba2aa2124d" + integrity sha512-0tF3AGSD1ppQeuffsLDIOWlKUd3lS92tFxcsrh5Pe3ZphhnoK+oXIBTzOAThZCiuINZLvpiLH/1VS1/ANEJVig== spdx-correct@^3.0.0: version "3.1.0" From 06f7f8fed9ef64e9a55753fb968d504b1d89143d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 01:05:35 +0000 Subject: [PATCH 455/970] chore(deps): bump node-releases from 1.1.51 to 1.1.52 Bumps [node-releases](https://github.com/chicoxyzzy/node-releases) from 1.1.51 to 1.1.52. - [Release notes](https://github.com/chicoxyzzy/node-releases/releases) - [Commits](https://github.com/chicoxyzzy/node-releases/compare/v1.1.51...v1.1.52) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index a561587cb..81c94b770 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5355,9 +5355,9 @@ node-libs-browser@^2.2.1: vm-browserify "^1.0.1" node-releases@^1.1.49: - version "1.1.51" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.51.tgz#70d0e054221343d2966006bfbd4d98622cc00bd0" - integrity sha512-1eQEs6HFYY1kMXQPOLzCf7HdjReErmvn85tZESMczdCNVWP3Y7URYLBAyYynuI7yef1zj4HN5q+oB2x67QU0lw== + version "1.1.52" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.52.tgz#bcffee3e0a758e92e44ecfaecd0a47554b0bcba9" + integrity sha512-snSiT1UypkgGt2wxPqS6ImEUICbNCMb31yaxWrOLXjhlt2z2/IBpaOxzONExqSm4y5oLnAqjjRWu+wsDzK5yNQ== dependencies: semver "^6.3.0" From ad722f03f478a4fe39cc8406aef70f100f19b85e Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 17 Mar 2020 11:16:55 +0300 Subject: [PATCH 456/970] Add parent/child relations to outcome --- app/models/outcome.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/outcome.rb b/app/models/outcome.rb index f5dd567d2..3ede9d642 100644 --- a/app/models/outcome.rb +++ b/app/models/outcome.rb @@ -3,6 +3,10 @@ class Outcome < ApplicationRecord # relations belongs_to :unit_standard + belongs_to :macro_outcome, class_name: 'Outcome', foreign_key: :parent_id, + inverse_of: :micro_outcomes, optional: true + has_many :micro_outcomes, class_name: 'Outcome', foreign_key: :parent_id, + inverse_of: :macro_outcome, dependent: :destroy # validations validates :code, presence: true, uniqueness: { scope: :unit_standard_id }, length: { maximum: 10 } From cff4a2beb0af2a94a5b809049f0674bde1361de9 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 17 Mar 2020 11:17:34 +0300 Subject: [PATCH 457/970] Accept atrributes for child outcome --- app/models/outcome.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/outcome.rb b/app/models/outcome.rb index 3ede9d642..16f94b7aa 100644 --- a/app/models/outcome.rb +++ b/app/models/outcome.rb @@ -7,6 +7,7 @@ class Outcome < ApplicationRecord inverse_of: :micro_outcomes, optional: true has_many :micro_outcomes, class_name: 'Outcome', foreign_key: :parent_id, inverse_of: :macro_outcome, dependent: :destroy + accepts_nested_attributes_for :micro_outcomes # validations validates :code, presence: true, uniqueness: { scope: :unit_standard_id }, length: { maximum: 10 } From 776b497ac0bf032a6f8c7679e847523ee2d386cd Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 17 Mar 2020 11:21:01 +0300 Subject: [PATCH 458/970] Set outcome only if outcome is macro --- app/controllers/outcome_management/outcomes_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/outcome_management/outcomes_controller.rb b/app/controllers/outcome_management/outcomes_controller.rb index 6f962a664..24a7d3c72 100644 --- a/app/controllers/outcome_management/outcomes_controller.rb +++ b/app/controllers/outcome_management/outcomes_controller.rb @@ -40,7 +40,7 @@ def set_unit_standard end def set_outcome - @outcome = @unit_standard.outcomes.find(params[:id]) + @outcome = @unit_standard.macro_outcomes.find(params[:id]) end def outcome_params From 0e49d263f0338489fe3e76f05f8fcaecc57043bc Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 17 Mar 2020 11:23:19 +0300 Subject: [PATCH 459/970] Add micro outcome attributes to outcome params --- app/controllers/outcome_management/outcomes_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/outcome_management/outcomes_controller.rb b/app/controllers/outcome_management/outcomes_controller.rb index 24a7d3c72..e5fc65dfd 100644 --- a/app/controllers/outcome_management/outcomes_controller.rb +++ b/app/controllers/outcome_management/outcomes_controller.rb @@ -44,7 +44,10 @@ def set_outcome end def outcome_params - params.require(:outcome).permit(:code, :name, :parent_id, :unit_standard_id) + params.require(:outcome).permit( + :code, :name, :unit_standard_id, + micro_outcomes_attributes: %i[id code name unit_standard_id _destroy] + ) end end end From 155b68245c19e98073e3ba4bd5bd06625ffd21fb Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 17 Mar 2020 12:23:21 +0300 Subject: [PATCH 460/970] Add permission for outcome management --- config/initializers/role_management.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/initializers/role_management.rb b/config/initializers/role_management.rb index 2fdb3ead2..66fcd718c 100644 --- a/config/initializers/role_management.rb +++ b/config/initializers/role_management.rb @@ -106,6 +106,10 @@ class RoleManagement name: 'Harç Yönetimi', description: 'Harç Yönetim Yetkisi', privileges: %i[read write destroy] + permission :outcome_management, + name: 'Çıktı Yönetimi', + description: 'Öğrenim Çıktısı Yönetim Yetkisi', + privileges: %i[read write destroy] # roles role :authorization_manager, @@ -140,7 +144,8 @@ class RoleManagement unit_management: %i[read write destroy report], user_management: %i[read write destroy report], yoksis_management: %i[read write destroy], - tuition_management: %i[read write destroy] + tuition_management: %i[read write destroy], + outcome_management: %i[read write destroy] } role :manager, name: 'Yönetici', permissions: {} end From eac6cd52ff137990c87b7cd4fee8d5fc8539111c Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 17 Mar 2020 12:24:24 +0300 Subject: [PATCH 461/970] Add outcome management policies --- .../outcome_management/outcome_policy.rb | 16 ++++++++++++++++ .../outcome_management/unit_standard_policy.rb | 13 +++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 app/policies/outcome_management/outcome_policy.rb create mode 100644 app/policies/outcome_management/unit_standard_policy.rb diff --git a/app/policies/outcome_management/outcome_policy.rb b/app/policies/outcome_management/outcome_policy.rb new file mode 100644 index 000000000..43eb78a2d --- /dev/null +++ b/app/policies/outcome_management/outcome_policy.rb @@ -0,0 +1,16 @@ + +# frozen_string_literal: true + +module OutcomeManagement + class OutcomePolicy < ApplicationPolicy + include CrudPolicyMethods + + undef :index? + + private + + def permitted?(*privileges) + user.privilege? :outcome_management, privileges + end + end +end diff --git a/app/policies/outcome_management/unit_standard_policy.rb b/app/policies/outcome_management/unit_standard_policy.rb new file mode 100644 index 000000000..5fd4abfcc --- /dev/null +++ b/app/policies/outcome_management/unit_standard_policy.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module OutcomeManagement + class UnitStandardPolicy < ApplicationPolicy + include CrudPolicyMethods + + private + + def permitted?(*privileges) + user.privilege? :outcome_management, privileges + end + end +end From 8dfd0730c1aaeb66112f4bc51ecab6c1fa8b8d88 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 17 Mar 2020 12:25:09 +0300 Subject: [PATCH 462/970] Add authorized? check --- app/controllers/outcome_management/outcomes_controller.rb | 5 +++++ .../outcome_management/unit_standards_controller.rb | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/app/controllers/outcome_management/outcomes_controller.rb b/app/controllers/outcome_management/outcomes_controller.rb index e5fc65dfd..6c24423fa 100644 --- a/app/controllers/outcome_management/outcomes_controller.rb +++ b/app/controllers/outcome_management/outcomes_controller.rb @@ -6,6 +6,7 @@ class OutcomesController < ApplicationController before_action :set_unit_standard before_action :set_outcome, except: %i[new create] + before_action :authorized? def show; end @@ -43,6 +44,10 @@ def set_outcome @outcome = @unit_standard.macro_outcomes.find(params[:id]) end + def authorized? + authorize([:outcome_management, @outcome || Outcome]) + end + def outcome_params params.require(:outcome).permit( :code, :name, :unit_standard_id, diff --git a/app/controllers/outcome_management/unit_standards_controller.rb b/app/controllers/outcome_management/unit_standards_controller.rb index a55ca91b3..94fdddb41 100644 --- a/app/controllers/outcome_management/unit_standards_controller.rb +++ b/app/controllers/outcome_management/unit_standards_controller.rb @@ -5,6 +5,7 @@ class UnitStandardsController < ApplicationController include SearchableModule before_action :set_unit_standard, only: %i[show edit update destroy] + before_action :authorized? def index unit_standards = UnitStandard.includes(:standard, :unit) @@ -46,6 +47,10 @@ def set_unit_standard @unit_standard = UnitStandard.find(params[:id]) end + def authorized? + authorize([:outcome_management, @unit_standard || UnitStandard]) + end + def unit_standard_params params.require(:unit_standard).permit(:unit_id, :standard_id, :status) end From 36263c9e4662fb101265fa4c4fd207a3d4e098e4 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 17 Mar 2020 14:48:42 +0300 Subject: [PATCH 463/970] Add stage relation to student --- .../20200317094504_add_stage_to_student.rb | 7 +++++++ db/structure.sql | 21 +++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20200317094504_add_stage_to_student.rb diff --git a/db/migrate/20200317094504_add_stage_to_student.rb b/db/migrate/20200317094504_add_stage_to_student.rb new file mode 100644 index 000000000..4feb70917 --- /dev/null +++ b/db/migrate/20200317094504_add_stage_to_student.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddStageToStudent < ActiveRecord::Migration[6.0] + def change + add_reference :students, :stage, foreign_key: { to_table: :student_grades } + end +end diff --git a/db/structure.sql b/db/structure.sql index 05b739889..0f2d32cab 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -3321,6 +3321,7 @@ ALTER SEQUENCE public.student_studentship_statuses_id_seq OWNED BY public.studen CREATE TABLE public.students ( id bigint NOT NULL, student_number character varying, + permanently_registered boolean DEFAULT false, user_id bigint NOT NULL, unit_id bigint NOT NULL, created_at timestamp without time zone NOT NULL, @@ -3328,9 +3329,9 @@ CREATE TABLE public.students ( semester integer, year integer, scholarship_type_id bigint, - permanently_registered boolean DEFAULT false, status integer DEFAULT 1, exceeded_education_period boolean DEFAULT false, + stage_id bigint, CONSTRAINT students_permanently_registered_null CHECK ((permanently_registered IS NOT NULL)), CONSTRAINT students_semester_null CHECK ((semester IS NOT NULL)), CONSTRAINT students_semester_numericality CHECK ((semester > 0)), @@ -6279,6 +6280,13 @@ CREATE INDEX index_semester_registrations_on_student_id ON public.semester_regis CREATE INDEX index_students_on_scholarship_type_id ON public.students USING btree (scholarship_type_id); +-- +-- Name: index_students_on_stage_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_students_on_stage_id ON public.students USING btree (stage_id); + + -- -- Name: index_students_on_unit_id; Type: INDEX; Schema: public; Owner: - -- @@ -6461,6 +6469,14 @@ ALTER TABLE ONLY public.students ADD CONSTRAINT fk_rails_148c9e88f4 FOREIGN KEY (user_id) REFERENCES public.users(id); +-- +-- Name: students fk_rails_155a016013; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.students + ADD CONSTRAINT fk_rails_155a016013 FOREIGN KEY (stage_id) REFERENCES public.student_grades(id); + + -- -- Name: duties fk_rails_1b35a03564; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7378,6 +7394,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200213124638'), ('20200215132359'), ('20200217110305'), -('20200310101357'); +('20200310101357'), +('20200317094504'); From bd0dd5a236dec9ac6b2b9a54e0fe26a73d58e96f Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 17 Mar 2020 14:50:20 +0300 Subject: [PATCH 464/970] Allow to delete nested model --- app/models/outcome.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/outcome.rb b/app/models/outcome.rb index 16f94b7aa..51f9e1c34 100644 --- a/app/models/outcome.rb +++ b/app/models/outcome.rb @@ -7,7 +7,7 @@ class Outcome < ApplicationRecord inverse_of: :micro_outcomes, optional: true has_many :micro_outcomes, class_name: 'Outcome', foreign_key: :parent_id, inverse_of: :macro_outcome, dependent: :destroy - accepts_nested_attributes_for :micro_outcomes + accepts_nested_attributes_for :micro_outcomes, allow_destroy: true # validations validates :code, presence: true, uniqueness: { scope: :unit_standard_id }, length: { maximum: 10 } From 0485577b91682ec75a6652137897d46940c8c5d5 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 17 Mar 2020 14:51:56 +0300 Subject: [PATCH 465/970] Add new relations to student and grade models --- app/models/student.rb | 7 +++++++ app/models/student_grade.rb | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/app/models/student.rb b/app/models/student.rb index 3ee248688..0bdab9a47 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -18,6 +18,7 @@ class Student < ApplicationRecord belongs_to :scholarship_type, optional: true belongs_to :user belongs_to :unit + belongs_to :stage, class_name: 'StudentGrade' has_one :identity, dependent: :destroy has_many :calendars, -> { Calendar.active }, through: :unit has_many :curriculums, through: :unit @@ -28,6 +29,7 @@ class Student < ApplicationRecord scope :exceeded, -> { where(exceeded_education_period: true) } scope :not_scholarships, -> { where(scholarship_type_id: nil) } scope :scholarships, -> { where.not(scholarship_type_id: nil) } + scope :preparatory, -> { where(stage: StudentGrade.preparatory) } # validations validates :exceeded_education_period, inclusion: { in: [true, false] } @@ -41,6 +43,7 @@ class Student < ApplicationRecord # delegations delegate :addresses, to: :user + delegate :name, to: :stage, prefix: true, allow_nil: true delegate :name, to: :unit, prefix: true delegate :name, to: :scholarship_type, prefix: true, allow_nil: true @@ -59,6 +62,10 @@ def current_registration semester_registrations.find_by(semester: semester) || semester_registrations.create end + def preparatory? + Student.preparatory.ids.include?(id) + end + def scholarship? scholarship_type_id? end diff --git a/app/models/student_grade.rb b/app/models/student_grade.rb index c65dc43f6..8ce071455 100644 --- a/app/models/student_grade.rb +++ b/app/models/student_grade.rb @@ -4,4 +4,14 @@ class StudentGrade < ApplicationRecord include ReferenceCallbacks include ReferenceSearch include ReferenceValidations + + # relations + has_many :students, dependent: :nullify + + # scopes + scope :course, -> { where(code: 9) } + scope :preparatory, -> { where(code: [1, 15]) } + scope :phd_qualify, -> { where(code: 11) } + scope :project, -> { where(code: 14) } + scope :thesis, -> { where(code: 10) } end From ed38da2a8e29216fac04b4d82e4c46740341d98b Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 17 Mar 2020 14:56:37 +0300 Subject: [PATCH 466/970] Configure views and controller for added new field --- app/controllers/students_controller.rb | 3 ++- app/views/students/edit.html.erb | 3 +++ app/views/user_management/users/_students.html.erb | 2 ++ config/locales/models/user/en.yml | 1 + config/locales/models/user/tr.yml | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/students_controller.rb b/app/controllers/students_controller.rb index e2f68aae9..13bae97cd 100644 --- a/app/controllers/students_controller.rb +++ b/app/controllers/students_controller.rb @@ -22,7 +22,8 @@ def authorized? def student_params params.require(:student).permit( - :student_number, :unit_id, :year, :semester, :scholarship_type_id, :status, :exceeded_education_period + :student_number, :unit_id, :year, :semester, :scholarship_type_id, :status, + :exceeded_education_period, :stage_id ) end end diff --git a/app/views/students/edit.html.erb b/app/views/students/edit.html.erb index 773436967..3923f354f 100644 --- a/app/views/students/edit.html.erb +++ b/app/views/students/edit.html.erb @@ -32,6 +32,9 @@
<%= f.association :scholarship_type %>
+
+ <%= f.association :stage %> +
<%= f.input :exceeded_education_period %>
diff --git a/app/views/user_management/users/_students.html.erb b/app/views/user_management/users/_students.html.erb index f1c389067..f2a72def5 100644 --- a/app/views/user_management/users/_students.html.erb +++ b/app/views/user_management/users/_students.html.erb @@ -16,6 +16,7 @@ <%= t('year') %> <%= t('semester') %> <%= t('.scholarship_type') %> + <%= t('.stage') %> <%= t('.exceeded_education_period') %> @@ -26,6 +27,7 @@ <%= student.year %> <%= student.semester %> <%= student.scholarship_type_name %> + <%= student.stage_name %> <%= icon_for_check(student.exceeded_education_period) %> diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index 77dda1c52..4603a9c46 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -21,6 +21,7 @@ en: start_date: Start Date student: &student_attributes exceeded_education_period: Couldn't graduate during education period + stage: Stage status: Student Status student_number: Student Number scholarship_type: Scholarship Type diff --git a/config/locales/models/user/tr.yml b/config/locales/models/user/tr.yml index 95e2eb7c8..4f5d57b23 100644 --- a/config/locales/models/user/tr.yml +++ b/config/locales/models/user/tr.yml @@ -21,6 +21,7 @@ tr: start_date: Başlangıç Tarihi student: &student_attributes exceeded_education_period: Eğitim süresi içerisinde mezun olamadı + stage: Aşama status: Öğrenci Durumu student_number: Öğrenci Numarası scholarship_type: Burs Türü From 44efa5e872503a1bb4bce24d1312050d159457f3 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 17 Mar 2020 15:09:12 +0300 Subject: [PATCH 467/970] Edit views for micro outcomes --- .../outcomes/_form.html.erb | 42 +++++++++++++++++-- .../outcomes/_micro_outcome_fields.html.erb | 18 ++++++++ .../outcome_management/outcomes/show.html.erb | 28 +++++++++++++ .../outcome_management/outcomes.en.yml | 1 + .../outcome_management/outcomes.tr.yml | 1 + 5 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb diff --git a/app/views/outcome_management/outcomes/_form.html.erb b/app/views/outcome_management/outcomes/_form.html.erb index 45b0b2809..328816600 100644 --- a/app/views/outcome_management/outcomes/_form.html.erb +++ b/app/views/outcome_management/outcomes/_form.html.erb @@ -10,12 +10,46 @@
<%= f.error_notification %> + <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> + <% if f.object.errors.any? %> +
    + <% f.object.errors.full_messages.each do |message| %> +
  • + <%= message %> +
  • + <% end %> +
+ <% end %>
-
- <%= f.input :code %> +
+ <%= f.input :code, as: :text, input_html: { rows: 3 } %> +
+
+ <%= f.input :name, as: :text, input_html: { rows: 3 } %>
+
- <%= f.input :name, as: :text, input_html: { rows: 5 } %> +
+
+ <%= fa_icon 'dot-circle-o' %> + <%= t('outcomes', scope: %i[activerecord attributes outcome]) %> +
+
+
+
+ <%= f.simple_fields_for :micro_outcomes do |outcome| %> + <%= render 'micro_outcome_fields', f: outcome %> + <% end %> +
+ +
+ +
+
+
+
@@ -28,3 +62,5 @@
+ +<%= javascript_include_tag 'shared/cocoon' %> diff --git a/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb b/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb new file mode 100644 index 000000000..b7d80a4b8 --- /dev/null +++ b/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb @@ -0,0 +1,18 @@ +
+
+
+
+ <%= f.input(:unit_standard_id, as: :hidden, wrapper: false, input_html: { value: 1 }) %> +
+ <%= f.input :code, as: :text, input_html: { rows: 3 } %> +
+
+ <%= f.input :name, as: :text, input_html: { rows: 3 } %> +
+
+
+ +
+
diff --git a/app/views/outcome_management/outcomes/show.html.erb b/app/views/outcome_management/outcomes/show.html.erb index c39791eda..3f64e8b41 100644 --- a/app/views/outcome_management/outcomes/show.html.erb +++ b/app/views/outcome_management/outcomes/show.html.erb @@ -25,3 +25,31 @@ + +
+
+
+
+ <%= fa_icon 'dot-circle-o', text: t('.outcomes') %> +
+
+ + + + + + + + + <% @outcome.micro_outcomes.each do |outcome| %> + + + + + <% end %> + +
<%= t('.code') %><%= t('.name') %>
<%= outcome.code %><%= outcome.name %>
+
+
+
+
diff --git a/config/locales/controllers/outcome_management/outcomes.en.yml b/config/locales/controllers/outcome_management/outcomes.en.yml index e609c0b78..c2e4c919e 100644 --- a/config/locales/controllers/outcome_management/outcomes.en.yml +++ b/config/locales/controllers/outcome_management/outcomes.en.yml @@ -4,6 +4,7 @@ tr: outcome: &outcome_attributes code: Code name: Name + outcomes: Sub Outcomes helpers: submit: outcome: diff --git a/config/locales/controllers/outcome_management/outcomes.tr.yml b/config/locales/controllers/outcome_management/outcomes.tr.yml index 0ad69162e..655ef52a0 100644 --- a/config/locales/controllers/outcome_management/outcomes.tr.yml +++ b/config/locales/controllers/outcome_management/outcomes.tr.yml @@ -4,6 +4,7 @@ tr: outcome: &outcome_attributes code: Kod name: Adı + outcomes: Alt Çıktılar helpers: submit: outcome: From 567cd2136dc8c5f0c963ed11cbca7de7bb839d79 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 17 Mar 2020 15:10:59 +0300 Subject: [PATCH 468/970] Use optional parameter --- app/models/student.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/student.rb b/app/models/student.rb index 0bdab9a47..df12481b8 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -18,7 +18,7 @@ class Student < ApplicationRecord belongs_to :scholarship_type, optional: true belongs_to :user belongs_to :unit - belongs_to :stage, class_name: 'StudentGrade' + belongs_to :stage, class_name: 'StudentGrade', optional: true has_one :identity, dependent: :destroy has_many :calendars, -> { Calendar.active }, through: :unit has_many :curriculums, through: :unit From d5f6375dace29e87aa08a8ce20b1ab829ac28c19 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 17 Mar 2020 15:28:52 +0300 Subject: [PATCH 469/970] Fix tests for added new field --- app/models/student.rb | 2 +- app/models/student_grade.rb | 2 +- test/fixtures/student_grades.yml | 3 +++ test/fixtures/students.yml | 1 + test/models/student_grade_test.rb | 4 ++++ test/models/student_test.rb | 5 +++++ 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/models/student.rb b/app/models/student.rb index df12481b8..75b8a6002 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -29,7 +29,7 @@ class Student < ApplicationRecord scope :exceeded, -> { where(exceeded_education_period: true) } scope :not_scholarships, -> { where(scholarship_type_id: nil) } scope :scholarships, -> { where.not(scholarship_type_id: nil) } - scope :preparatory, -> { where(stage: StudentGrade.preparatory) } + scope :preparations, -> { where(stage: StudentGrade.preparation) } # validations validates :exceeded_education_period, inclusion: { in: [true, false] } diff --git a/app/models/student_grade.rb b/app/models/student_grade.rb index 8ce071455..0a65d173f 100644 --- a/app/models/student_grade.rb +++ b/app/models/student_grade.rb @@ -10,7 +10,7 @@ class StudentGrade < ApplicationRecord # scopes scope :course, -> { where(code: 9) } - scope :preparatory, -> { where(code: [1, 15]) } + scope :preparation, -> { where(code: 1) } scope :phd_qualify, -> { where(code: 11) } scope :project, -> { where(code: 14) } scope :thesis, -> { where(code: 10) } diff --git a/test/fixtures/student_grades.yml b/test/fixtures/student_grades.yml index 86d306cb2..4319185cf 100644 --- a/test/fixtures/student_grades.yml +++ b/test/fixtures/student_grades.yml @@ -7,6 +7,9 @@ first_grade: second_grade: name: 2. Sinif code: 3 +foreign_preparation: + name: Yabancı Dil Hazırlık + code: 1 student_grade_to_delete: name: Will be Deleted code: 99 diff --git a/test/fixtures/students.yml b/test/fixtures/students.yml index 2e01ffb69..e0251359f 100644 --- a/test/fixtures/students.yml +++ b/test/fixtures/students.yml @@ -16,6 +16,7 @@ serhat_omu: status: active year: 1 semester: 1 + stage: foreign_preparation john: student_number: 45612 user: john diff --git a/test/models/student_grade_test.rb b/test/models/student_grade_test.rb index e4cdb2290..1c12344d3 100644 --- a/test/models/student_grade_test.rb +++ b/test/models/student_grade_test.rb @@ -3,5 +3,9 @@ require 'test_helper' class StudentGradeTest < ActiveSupport::TestCase + extend Support::Minitest::AssociationHelper include ReferenceTestModule + + # relations + has_many :students, dependent: :nullify end diff --git a/test/models/student_test.rb b/test/models/student_test.rb index 371b9e7d2..17d6e09a5 100644 --- a/test/models/student_test.rb +++ b/test/models/student_test.rb @@ -20,6 +20,7 @@ class StudentTest < ActiveSupport::TestCase # relations belongs_to :scholarship_type, optional: true + belongs_to :stage, optional: true belongs_to :user belongs_to :unit has_one :identity, dependent: :destroy @@ -63,6 +64,10 @@ class StudentTest < ActiveSupport::TestCase assert_includes(Student.scholarships, students(:serhat)) end + test 'preparations scope returns students with preparations' do + assert_includes(Student.preparations, students(:serhat_omu)) + end + # custom methods test 'gpa method' do assert_equal students(:serhat).gpa, 1.8 From 8b3e6c7c3c78e6053c4393f036b760372cad6c55 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 17 Mar 2020 15:35:09 +0300 Subject: [PATCH 470/970] Fix preparation custom method --- app/models/student.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/student.rb b/app/models/student.rb index 75b8a6002..6729013a7 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -62,8 +62,8 @@ def current_registration semester_registrations.find_by(semester: semester) || semester_registrations.create end - def preparatory? - Student.preparatory.ids.include?(id) + def preparation? + Student.preparations.ids.include?(id) end def scholarship? From 44d96683d7c2677689698c1282b00a5dd3165604 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 17 Mar 2020 15:49:46 +0300 Subject: [PATCH 471/970] Fix student test --- test/models/student_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/models/student_test.rb b/test/models/student_test.rb index 17d6e09a5..e50d592cc 100644 --- a/test/models/student_test.rb +++ b/test/models/student_test.rb @@ -20,7 +20,7 @@ class StudentTest < ActiveSupport::TestCase # relations belongs_to :scholarship_type, optional: true - belongs_to :stage, optional: true + belongs_to :stage, class_name: 'StudentGrade', optional: true belongs_to :user belongs_to :unit has_one :identity, dependent: :destroy From cc297cc17860cfd7b50e247eeab0eb72a4c2106e Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 17 Mar 2020 16:26:34 +0300 Subject: [PATCH 472/970] Add new outcome fixtures --- test/fixtures/outcomes.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/fixtures/outcomes.yml b/test/fixtures/outcomes.yml index acc472a3e..5f1542d55 100644 --- a/test/fixtures/outcomes.yml +++ b/test/fixtures/outcomes.yml @@ -1,4 +1,16 @@ one: unit_standard: one code: PÇ-1 + name: Seçme ve uygulama becerisi +two: + unit_standard: one + code: PÇ-1-1 + name: Seçme becerisi +three: + unit_standard: one + code: PÇ-1-2 name: Uygulama becerisi +four: + unit_standard: one + code: PÇ-2 + name: Yorumlama becerisi From defaf9686dbf04a35485266dd93ee56ef8bc1c53 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 17 Mar 2020 16:26:51 +0300 Subject: [PATCH 473/970] Add model test for new models --- test/models/outcome_test.rb | 37 +++++++++++++++++++++++++++++++ test/models/unit_standard_test.rb | 28 +++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 test/models/unit_standard_test.rb diff --git a/test/models/outcome_test.rb b/test/models/outcome_test.rb index ae54ee890..a7af1634c 100644 --- a/test/models/outcome_test.rb +++ b/test/models/outcome_test.rb @@ -3,4 +3,41 @@ require 'test_helper' class OutcomeTest < ActiveSupport::TestCase + extend Support::Minitest::AssociationHelper + extend Support::Minitest::ValidationHelper + + # relations + belongs_to :unit_standard + belongs_to :macro_outcome, class_name: 'Outcome', foreign_key: :parent_id, + inverse_of: :micro_outcomes, optional: true + has_many :micro_outcomes, class_name: 'Outcome', foreign_key: :parent_id, + inverse_of: :macro_outcome, dependent: :destroy + accepts_nested_attributes_for :micro_outcomes, allow_destroy: true + + # validations: presence + validates_presence_of :code + validates_presence_of :name + + # validations: length + validates_length_of :code, maximum: 10 + validates_length_of :name, maximum: 255 + + # validations: uniqueness + test 'uniqueness validations for code of a outcome' do + fake = outcomes(:one).dup + assert_not fake.valid? + assert_not_empty fake.errors[:code] + end + + # delegates + test "a outcome reach unit parameter" do + assert outcomes(:one).unit + end + + # scopes + test 'ordered returns outcomes ordered by code' do + outcomes = unit_standards(:one).macro_outcomes.ordered + assert_equal outcomes(:one), outcomes.first + assert_equal outcomes(:four), outcomes.last + end end diff --git a/test/models/unit_standard_test.rb b/test/models/unit_standard_test.rb new file mode 100644 index 000000000..8fd2f97bf --- /dev/null +++ b/test/models/unit_standard_test.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require 'test_helper' + +class UnitStandardTest < ActiveSupport::TestCase + extend Support::Minitest::AssociationHelper + extend Support::Minitest::EnumerationHelper + extend Support::Minitest::ValidationHelper + + # enums + enum status: { passive: 0, active: 1 } + + # relations + belongs_to :standard + belongs_to :unit + has_many :outcomes, dependent: :destroy + has_many :macro_outcomes, class_name: 'Outcome', inverse_of: :unit_standard + + # validations: presence + validates_presence_of :standard + + # validations: uniqueness + test 'uniqueness validations for status of a unit standard' do + fake = unit_standards(:one).dup + assert_not fake.valid? + assert_not_empty fake.errors[:status] + end +end From 7486c4faf972d55cb4a6e9f2b9d226290fd54030 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 18 Mar 2020 09:41:32 +0300 Subject: [PATCH 474/970] Fix test --- app/models/student_grade.rb | 2 +- test/models/student_grade_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/student_grade.rb b/app/models/student_grade.rb index 0a65d173f..6215bbfe6 100644 --- a/app/models/student_grade.rb +++ b/app/models/student_grade.rb @@ -6,7 +6,7 @@ class StudentGrade < ApplicationRecord include ReferenceValidations # relations - has_many :students, dependent: :nullify + has_many :students, foreign_key: :stage_id, inverse_of: :stage, dependent: :nullify # scopes scope :course, -> { where(code: 9) } diff --git a/test/models/student_grade_test.rb b/test/models/student_grade_test.rb index 1c12344d3..6780021b6 100644 --- a/test/models/student_grade_test.rb +++ b/test/models/student_grade_test.rb @@ -7,5 +7,5 @@ class StudentGradeTest < ActiveSupport::TestCase include ReferenceTestModule # relations - has_many :students, dependent: :nullify + has_many :students, foreign_key: :stage_id, inverse_of: :stage, dependent: :nullify end From 380868a35a24a8623f22edb3b9f51b52b732c359 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 18 Mar 2020 10:31:44 +0300 Subject: [PATCH 475/970] Add policy check for unit standard in menu --- app/views/layouts/shared/menus/_admin.html.erb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/views/layouts/shared/menus/_admin.html.erb b/app/views/layouts/shared/menus/_admin.html.erb index e2874ba27..0f6a4c74a 100644 --- a/app/views/layouts/shared/menus/_admin.html.erb +++ b/app/views/layouts/shared/menus/_admin.html.erb @@ -65,11 +65,13 @@ <%= fa_icon('dot-circle-o', class: 'nav-icon') %><%= t('.outcome_management') %>
From 8d2243896e39c98a0737bb0bcbe791a5ffdc443f Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 18 Mar 2020 10:54:09 +0300 Subject: [PATCH 476/970] Change flash type --- app/controllers/outcome_management/outcomes_controller.rb | 2 +- app/controllers/outcome_management/unit_standards_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/outcome_management/outcomes_controller.rb b/app/controllers/outcome_management/outcomes_controller.rb index 6c24423fa..91f0d1d40 100644 --- a/app/controllers/outcome_management/outcomes_controller.rb +++ b/app/controllers/outcome_management/outcomes_controller.rb @@ -33,7 +33,7 @@ def destroy private def redirect_with(message) - redirect_to unit_standard_path(@unit_standard), flash: { notice: t(".#{message}") } + redirect_to unit_standard_path(@unit_standard), flash: { info: t(".#{message}") } end def set_unit_standard diff --git a/app/controllers/outcome_management/unit_standards_controller.rb b/app/controllers/outcome_management/unit_standards_controller.rb index 94fdddb41..fcca7d239 100644 --- a/app/controllers/outcome_management/unit_standards_controller.rb +++ b/app/controllers/outcome_management/unit_standards_controller.rb @@ -40,7 +40,7 @@ def destroy private def redirect_with(message) - redirect_to unit_standards_path, flash: { notice: t(".#{message}") } + redirect_to unit_standards_path, flash: { info: t(".#{message}") } end def set_unit_standard From 18eb8d76051ada02c1d473ff2ff34fca0cdeae21 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 18 Mar 2020 10:54:19 +0300 Subject: [PATCH 477/970] Add new fixtures --- test/fixtures/patron/permissions.yml | 4 ++++ test/fixtures/patron/role_permissions.yml | 4 ++++ test/fixtures/standards.yml | 3 +++ 3 files changed, 11 insertions(+) diff --git a/test/fixtures/patron/permissions.yml b/test/fixtures/patron/permissions.yml index 779109fb8..0b1215d75 100644 --- a/test/fixtures/patron/permissions.yml +++ b/test/fixtures/patron/permissions.yml @@ -101,3 +101,7 @@ tuition_management: name: Harç Yönetimi identifier: tuition_management description: Harç Yönetim Yetkisi +outcome_management: + name: Çıktı Yönetimi + identifier: outcome_management + description: Öğrenim Çıktısı Yönetim Yetkisi diff --git a/test/fixtures/patron/role_permissions.yml b/test/fixtures/patron/role_permissions.yml index 6913c5cf0..a46e12bf6 100644 --- a/test/fixtures/patron/role_permissions.yml +++ b/test/fixtures/patron/role_permissions.yml @@ -98,3 +98,7 @@ twenty_five: role: admin permission: tuition_management privileges: <%= Patron::RolePermission.privileges.to_i([:read, :write, :destroy]) %> +twenty_six: + role: admin + permission: outcome_management + privileges: <%= Patron::RolePermission.privileges.to_i([:read, :write, :destroy]) %> diff --git a/test/fixtures/standards.yml b/test/fixtures/standards.yml index 312dfecfd..42fedd1ea 100644 --- a/test/fixtures/standards.yml +++ b/test/fixtures/standards.yml @@ -1,3 +1,6 @@ +fedek: + version: Version + name: FEDEK mudek: version: Version name: MÜDEK From 3a2a962f424ab8b0b406ad55abf701a737719320 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 18 Mar 2020 10:54:39 +0300 Subject: [PATCH 478/970] Add standard model test --- test/models/standard_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/models/standard_test.rb b/test/models/standard_test.rb index 06996a57e..f6092208e 100644 --- a/test/models/standard_test.rb +++ b/test/models/standard_test.rb @@ -3,4 +3,20 @@ require 'test_helper' class StandardTest < ActiveSupport::TestCase + extend Support::Minitest::ValidationHelper + + # validations: presence + validates_presence_of :version + validates_presence_of :name + + # validations: length + validates_length_of :version, maximum: 50 + validates_length_of :name, maximum: 255 + + # validations: uniqueness + test 'uniqueness validations for name of a standard' do + fake = standards(:fedek).dup + assert_not fake.valid? + assert_not_empty fake.errors[:name] + end end From 61bdbac8217b7ebe249f87699d75e8ca93dbfc32 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 18 Mar 2020 10:58:13 +0300 Subject: [PATCH 479/970] Add missing controller tests --- .../outcomes_controller_test.rb | 84 ++++++++++++++++++ .../unit_standards_controller_test.rb | 86 +++++++++++++++++++ .../reference/standards_controller_test.rb | 14 +++ 3 files changed, 184 insertions(+) create mode 100644 test/controllers/outcome_management/outcomes_controller_test.rb create mode 100644 test/controllers/outcome_management/unit_standards_controller_test.rb create mode 100644 test/controllers/reference/standards_controller_test.rb diff --git a/test/controllers/outcome_management/outcomes_controller_test.rb b/test/controllers/outcome_management/outcomes_controller_test.rb new file mode 100644 index 000000000..02d9c3848 --- /dev/null +++ b/test/controllers/outcome_management/outcomes_controller_test.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +require 'test_helper' + +module OutcomeManagement + class OutcomesControllerTest < ActionDispatch::IntegrationTest + setup do + sign_in users(:serhat) + @unit_standard = unit_standards(:one) + @outcome = outcomes(:one) + end + + test 'should get show' do + get unit_standard_outcome_path(@unit_standard, @outcome) + assert_response :success + end + + test 'should get new' do + get new_unit_standard_outcome_path(@unit_standard) + assert_response :success + end + + test 'should create outcome' do + assert_difference('Outcome.count', 2) do + post unit_standard_outcomes_path(@unit_standard), params: { + outcome: { + code: 'PÇ-3', name: 'Çözme ve uygulayabilme becerisi', + micro_outcomes_attributes: { + '0' => { unit_standard_id: @unit_standard.id, code: 'PÇ3-1', name: 'Çözme becerisi' } + } + } + } + end + + outcome = @unit_standard.macro_outcomes.last + + assert_equal 'PÇ-3', outcome.code + assert_equal 'Çözme ve uygulayabilme becerisi', outcome.name + assert_equal 1, outcome.micro_outcomes.count + assert_redirected_to unit_standard_path(@unit_standard) + end + + test 'should get edit' do + get edit_unit_standard_outcome_path(@unit_standard, @outcome) + assert_response :success + assert_select '.card-header strong', translate('.edit.form_title') + end + + test 'should update outcome' do + outcome = Outcome.first + patch unit_standard_outcome_path(@unit_standard, @outcome), params: { + outcome: { + code: 'PÇ1', name: 'Seçme ve uygulama becerisi.', + micro_outcomes_attributes: { + '0' => { unit_standard_id: @unit_standard.id, code: 'PÇ1-1', name: 'Seçme becerisi.' } + } + } + } + + @outcome.reload + + assert_equal 'PÇ1', @outcome.code + assert_equal 'Seçme ve uygulama becerisi.', @outcome.name + assert_equal 'PÇ1-1', @outcome.micro_outcomes.ordered.first.code + assert_redirected_to unit_standard_path(@unit_standard) + assert_equal translate('.update.success'), flash[:info] + end + + test 'should destroy outcome' do + assert_difference('Outcome.count', -1) do + delete unit_standard_outcome_path(@unit_standard, @outcome) + end + + assert_redirected_to unit_standard_path(@unit_standard) + assert_equal translate('.destroy.success'), flash[:info] + end + + private + + def translate(key) + t("outcome_management.outcomes#{key}") + end + end +end diff --git a/test/controllers/outcome_management/unit_standards_controller_test.rb b/test/controllers/outcome_management/unit_standards_controller_test.rb new file mode 100644 index 000000000..79e08bee3 --- /dev/null +++ b/test/controllers/outcome_management/unit_standards_controller_test.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +require 'test_helper' + +module OutcomeManagement + class UnitStandardsControllerTest < ActionDispatch::IntegrationTest + setup do + sign_in users(:serhat) + @unit_standard = unit_standards(:one) + end + + test 'should get index' do + get unit_standards_path + assert_response :success + end + + test 'should get show' do + get unit_standards_path(@unit_standard) + assert_response :success + end + + test 'should get new' do + get new_unit_standard_path + assert_response :success + end + + test 'should create unit standard' do + assert_difference('UnitStandard.count') do + post unit_standards_path, params: { + unit_standard: { + unit_id: units(:fen_bilgisi_ogretmenligi_programi).id, + standard_id: standards(:fedek).id, + status: :active + } + } + end + + unit_standard = UnitStandard.last + + assert_equal units(:fen_bilgisi_ogretmenligi_programi), unit_standard.unit + assert_equal standards(:fedek), unit_standard.standard + assert unit_standard.active? + assert_redirected_to unit_standards_path + end + + test 'should get edit' do + get edit_unit_standard_path(@unit_standard) + assert_response :success + assert_select '.card-header strong', translate('.edit.form_title') + end + + test 'should update unit standard' do + unit_standard = UnitStandard.last + patch unit_standard_path(@unit_standard), params: { + unit_standard: { + unit_id: units(:fen_bilgisi_ogretmenligi_programi).id, + standard_id: standards(:fedek).id, + status: :passive + } + } + + unit_standard.reload + + assert_equal units(:fen_bilgisi_ogretmenligi_programi), unit_standard.unit + assert_equal standards(:fedek), unit_standard.standard + assert unit_standard.passive? + assert_redirected_to unit_standards_path + assert_equal translate('.update.success'), flash[:info] + end + + test 'should destroy unit standard' do + assert_difference('UnitStandard.count', -1) do + delete unit_standard_path(@unit_standard) + end + + assert_redirected_to unit_standards_path + assert_equal translate('.destroy.success'), flash[:info] + end + + private + + def translate(key) + t("outcome_management.unit_standards#{key}") + end + end +end diff --git a/test/controllers/reference/standards_controller_test.rb b/test/controllers/reference/standards_controller_test.rb new file mode 100644 index 000000000..84078316d --- /dev/null +++ b/test/controllers/reference/standards_controller_test.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +require 'test_helper' +require_relative '../concerns/reference_resource_test' + +class StandardsControllerTest < ActionDispatch::IntegrationTest + include ReferenceResourceTest + + setup do + @target_path = 'reference' + @create_params = { name: 'MİAK', version: '1' } + @update_params = { name: 'EPDAD', version: '1' } + end +end From 1d1cc16c07bf22a14a006a90615b9adb51c107a1 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 18 Mar 2020 10:58:53 +0300 Subject: [PATCH 480/970] Add missing policy tests --- .../outcome_management/outcome_policy_test.rb | 21 ++++++++++++++++++ .../unit_standard_policy_test.rb | 22 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 test/policies/outcome_management/outcome_policy_test.rb create mode 100644 test/policies/outcome_management/unit_standard_policy_test.rb diff --git a/test/policies/outcome_management/outcome_policy_test.rb b/test/policies/outcome_management/outcome_policy_test.rb new file mode 100644 index 000000000..83cd752ee --- /dev/null +++ b/test/policies/outcome_management/outcome_policy_test.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'pundit_test_case' + +module OutcomeManagement + class OutcomePolicyTest < PunditTestCase + %w[ + create? + destroy? + edit? + new? + show? + update? + ].each do |method| + test method do + assert_permit users(:serhat) + assert_not_permit users(:mine) + end + end + end +end diff --git a/test/policies/outcome_management/unit_standard_policy_test.rb b/test/policies/outcome_management/unit_standard_policy_test.rb new file mode 100644 index 000000000..0f5fae08a --- /dev/null +++ b/test/policies/outcome_management/unit_standard_policy_test.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require 'pundit_test_case' + +module OutcomeManagement + class UnitStandardPolicyTest < PunditTestCase + %w[ + create? + destroy? + edit? + index? + new? + show? + update? + ].each do |method| + test method do + assert_permit users(:serhat) + assert_not_permit users(:mine) + end + end + end +end From d572edd76beda9d2a6a438f0a9eb12cf6cfad660 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 18 Mar 2020 14:26:46 +0300 Subject: [PATCH 481/970] Fix unit_standard_id default value in outcome form --- .../outcome_management/outcomes/_micro_outcome_fields.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb b/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb index b7d80a4b8..2fa0e4145 100644 --- a/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb +++ b/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb @@ -2,7 +2,7 @@
- <%= f.input(:unit_standard_id, as: :hidden, wrapper: false, input_html: { value: 1 }) %> + <%= f.input(:unit_standard_id, as: :hidden, wrapper: false, input_html: { value: @unit_standard.id }) %>
<%= f.input :code, as: :text, input_html: { rows: 3 } %>
From 37309cb7e58ecdceb4ed31afa1103a87e39005f8 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 18 Mar 2020 14:52:55 +0300 Subject: [PATCH 482/970] Fix rubocop offenses --- app/policies/outcome_management/outcome_policy.rb | 7 +++---- .../outcome_management/outcomes_controller_test.rb | 1 - .../outcome_management/unit_standards_controller_test.rb | 8 ++++---- test/models/outcome_test.rb | 2 +- test/models/unit_standard_test.rb | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/policies/outcome_management/outcome_policy.rb b/app/policies/outcome_management/outcome_policy.rb index 43eb78a2d..b75f4795d 100644 --- a/app/policies/outcome_management/outcome_policy.rb +++ b/app/policies/outcome_management/outcome_policy.rb @@ -1,4 +1,3 @@ - # frozen_string_literal: true module OutcomeManagement @@ -6,11 +5,11 @@ class OutcomePolicy < ApplicationPolicy include CrudPolicyMethods undef :index? - + private - + def permitted?(*privileges) user.privilege? :outcome_management, privileges end end -end +end diff --git a/test/controllers/outcome_management/outcomes_controller_test.rb b/test/controllers/outcome_management/outcomes_controller_test.rb index 02d9c3848..6efe57237 100644 --- a/test/controllers/outcome_management/outcomes_controller_test.rb +++ b/test/controllers/outcome_management/outcomes_controller_test.rb @@ -47,7 +47,6 @@ class OutcomesControllerTest < ActionDispatch::IntegrationTest end test 'should update outcome' do - outcome = Outcome.first patch unit_standard_outcome_path(@unit_standard, @outcome), params: { outcome: { code: 'PÇ1', name: 'Seçme ve uygulama becerisi.', diff --git a/test/controllers/outcome_management/unit_standards_controller_test.rb b/test/controllers/outcome_management/unit_standards_controller_test.rb index 79e08bee3..bcfd91b9c 100644 --- a/test/controllers/outcome_management/unit_standards_controller_test.rb +++ b/test/controllers/outcome_management/unit_standards_controller_test.rb @@ -28,9 +28,9 @@ class UnitStandardsControllerTest < ActionDispatch::IntegrationTest assert_difference('UnitStandard.count') do post unit_standards_path, params: { unit_standard: { - unit_id: units(:fen_bilgisi_ogretmenligi_programi).id, + unit_id: units(:fen_bilgisi_ogretmenligi_programi).id, standard_id: standards(:fedek).id, - status: :active + status: :active } } end @@ -53,9 +53,9 @@ class UnitStandardsControllerTest < ActionDispatch::IntegrationTest unit_standard = UnitStandard.last patch unit_standard_path(@unit_standard), params: { unit_standard: { - unit_id: units(:fen_bilgisi_ogretmenligi_programi).id, + unit_id: units(:fen_bilgisi_ogretmenligi_programi).id, standard_id: standards(:fedek).id, - status: :passive + status: :passive } } diff --git a/test/models/outcome_test.rb b/test/models/outcome_test.rb index a7af1634c..a698fc15a 100644 --- a/test/models/outcome_test.rb +++ b/test/models/outcome_test.rb @@ -30,7 +30,7 @@ class OutcomeTest < ActiveSupport::TestCase end # delegates - test "a outcome reach unit parameter" do + test 'a outcome reach unit parameter' do assert outcomes(:one).unit end diff --git a/test/models/unit_standard_test.rb b/test/models/unit_standard_test.rb index 8fd2f97bf..0c087b337 100644 --- a/test/models/unit_standard_test.rb +++ b/test/models/unit_standard_test.rb @@ -6,7 +6,7 @@ class UnitStandardTest < ActiveSupport::TestCase extend Support::Minitest::AssociationHelper extend Support::Minitest::EnumerationHelper extend Support::Minitest::ValidationHelper - + # enums enum status: { passive: 0, active: 1 } From a1bc6700d891a9fed4d87e24b7b57aa5315ecb51 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 18 Mar 2020 14:56:53 +0300 Subject: [PATCH 483/970] Delete repeated routes --- config/routes.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 5e8f5332c..3ebb6ba1e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -31,7 +31,6 @@ draw :tuition_management draw :user_management draw :yoksis - draw :meksis resources :students, only: %i[edit update] From 82e3cea753c6c5c77250e4d4abbb6d772a4a6a66 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 18 Mar 2020 14:59:33 +0300 Subject: [PATCH 484/970] Add newline at the end of file --- app/views/reference/standards/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/reference/standards/index.html.erb b/app/views/reference/standards/index.html.erb index ac1be4a28..e975c0020 100644 --- a/app/views/reference/standards/index.html.erb +++ b/app/views/reference/standards/index.html.erb @@ -5,4 +5,4 @@ pagy: @pagy, card_header: t('.card_header'), params: %w[name], - actions: %w[edit destroy] %> \ No newline at end of file + actions: %w[edit destroy] %> From 8458ae64936dde01b631fa329e41099c60599681 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 18 Mar 2020 15:03:02 +0300 Subject: [PATCH 485/970] Add a newline --- db/structure.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/structure.sql b/db/structure.sql index 7f5ebcb7d..b919e6b9c 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -7630,3 +7630,4 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200310101357'), ('20200317094504'); + From f2579959b8fdc79241908b41b271002a9d4214b2 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 18 Mar 2020 23:23:45 +0300 Subject: [PATCH 486/970] Show code fields as string --- app/views/outcome_management/outcomes/_form.html.erb | 2 +- .../outcome_management/outcomes/_micro_outcome_fields.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/outcome_management/outcomes/_form.html.erb b/app/views/outcome_management/outcomes/_form.html.erb index 328816600..fe9e960a0 100644 --- a/app/views/outcome_management/outcomes/_form.html.erb +++ b/app/views/outcome_management/outcomes/_form.html.erb @@ -22,7 +22,7 @@ <% end %>
- <%= f.input :code, as: :text, input_html: { rows: 3 } %> + <%= f.input :code %>
<%= f.input :name, as: :text, input_html: { rows: 3 } %> diff --git a/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb b/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb index 2fa0e4145..a8135425a 100644 --- a/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb +++ b/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb @@ -4,7 +4,7 @@
<%= f.input(:unit_standard_id, as: :hidden, wrapper: false, input_html: { value: @unit_standard.id }) %>
- <%= f.input :code, as: :text, input_html: { rows: 3 } %> + <%= f.input :code %>
<%= f.input :name, as: :text, input_html: { rows: 3 } %> From 8d43438eb8d635823259d877e7dcbbbff7eb1abb Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 08:44:16 +0300 Subject: [PATCH 487/970] Add standard fixture to delete --- test/fixtures/standards.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/fixtures/standards.yml b/test/fixtures/standards.yml index 42fedd1ea..858f66211 100644 --- a/test/fixtures/standards.yml +++ b/test/fixtures/standards.yml @@ -1,6 +1,9 @@ fedek: - version: Version + version: 1 name: FEDEK mudek: - version: Version + version: 1 name: MÜDEK +standard_to_delete: + version: 1 + name: Standard From c6905a5752054e2d43efe40b3306541ded3fc7cc Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 08:44:49 +0300 Subject: [PATCH 488/970] Add has many standards relation --- app/models/standard.rb | 3 +++ app/models/unit.rb | 1 + 2 files changed, 4 insertions(+) diff --git a/app/models/standard.rb b/app/models/standard.rb index 76294e1cc..dbc041cbb 100644 --- a/app/models/standard.rb +++ b/app/models/standard.rb @@ -4,6 +4,9 @@ class Standard < ApplicationRecord # search include ReferenceSearch + # relations + has_many :unit_standards, dependent: :destroy + # validations validates :version, presence: true, length: { maximum: 50 } validates :name, presence: true, uniqueness: { scope: :version }, length: { maximum: 255 } diff --git a/app/models/unit.rb b/app/models/unit.rb index 061410d7a..6030c858a 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -47,6 +47,7 @@ class Unit < ApplicationRecord has_many :available_courses, dependent: :destroy has_many :unit_calendars, dependent: :destroy has_many :calendars, through: :unit_calendars + has_many :unit_standards, dependent: :destroy has_many :unit_tuitions, dependent: :destroy has_many :tuitions, through: :unit_tuitions From 6224f8bef22ae0768322c9df32eaa7762de1396f Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 08:45:09 +0300 Subject: [PATCH 489/970] Add missing tests --- test/models/standard_test.rb | 4 ++++ test/models/unit_test.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/test/models/standard_test.rb b/test/models/standard_test.rb index f6092208e..5a0c55dca 100644 --- a/test/models/standard_test.rb +++ b/test/models/standard_test.rb @@ -3,8 +3,12 @@ require 'test_helper' class StandardTest < ActiveSupport::TestCase + extend Support::Minitest::AssociationHelper extend Support::Minitest::ValidationHelper + # relations + has_many :unit_standards, dependent: :destroy + # validations: presence validates_presence_of :version validates_presence_of :name diff --git a/test/models/unit_test.rb b/test/models/unit_test.rb index aae81e569..beabae497 100644 --- a/test/models/unit_test.rb +++ b/test/models/unit_test.rb @@ -33,6 +33,7 @@ class UnitTest < ActiveSupport::TestCase has_many :available_courses, dependent: :destroy has_many :unit_calendars, dependent: :destroy has_many :calendars, through: :unit_calendars + has_many :unit_standards, dependent: :destroy has_many :unit_tuitions, dependent: :destroy has_many :tuitions, through: :unit_tuitions From 96f1d09837396933989bcb037a6a44a6f6e18383 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 14:14:22 +0300 Subject: [PATCH 490/970] Delete standard related migrations --- db/migrate/20200305103056_create_standards.rb | 20 -- .../20200305120339_create_unit_standards.rb | 17 -- db/migrate/20200310044429_create_outcomes.rb | 20 -- db/structure.sql | 233 ------------------ 4 files changed, 290 deletions(-) delete mode 100644 db/migrate/20200305103056_create_standards.rb delete mode 100644 db/migrate/20200305120339_create_unit_standards.rb delete mode 100644 db/migrate/20200310044429_create_outcomes.rb diff --git a/db/migrate/20200305103056_create_standards.rb b/db/migrate/20200305103056_create_standards.rb deleted file mode 100644 index f1f5850ab..000000000 --- a/db/migrate/20200305103056_create_standards.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class CreateStandards < ActiveRecord::Migration[6.0] - def change - create_table :standards do |t| - t.string :version - t.string :name - - t.timestamps null: false - end - - add_length_constraint :standards, :version, less_than_or_equal_to: 50 - add_length_constraint :standards, :name, less_than_or_equal_to: 255 - - add_presence_constraint :standards, :version - add_presence_constraint :standards, :name - - add_unique_constraint :standards, [:version, :name] - end -end diff --git a/db/migrate/20200305120339_create_unit_standards.rb b/db/migrate/20200305120339_create_unit_standards.rb deleted file mode 100644 index 5ffbdaeca..000000000 --- a/db/migrate/20200305120339_create_unit_standards.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CreateUnitStandards < ActiveRecord::Migration[6.0] - def change - create_table :unit_standards do |t| - t.references :standard, foreign_key: true, null: false - t.references :unit, foreign_key: true, null: false - t.integer :status - - t.timestamps - end - - add_null_constraint :unit_standards, :status - - add_numericality_constraint :unit_standards, :status, greater_than_or_equal_to: 0 - end -end diff --git a/db/migrate/20200310044429_create_outcomes.rb b/db/migrate/20200310044429_create_outcomes.rb deleted file mode 100644 index 5235af096..000000000 --- a/db/migrate/20200310044429_create_outcomes.rb +++ /dev/null @@ -1,20 +0,0 @@ -class CreateOutcomes < ActiveRecord::Migration[6.0] - def change - create_table :outcomes do |t| - t.references :unit_standard, null: false, foreign_key: true - t.references :parent, foreign_key: { to_table: :outcomes } - t.string :code - t.string :name - - t.timestamps - end - - add_length_constraint :outcomes, :code, less_than_or_equal_to: 10 - add_length_constraint :outcomes, :name, less_than_or_equal_to: 255 - - add_presence_constraint :outcomes, :code - add_presence_constraint :outcomes, :name - - add_unique_constraint :outcomes, [:unit_standard_id, :code] - end -end diff --git a/db/structure.sql b/db/structure.sql index b919e6b9c..0f2d32cab 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -2250,44 +2250,6 @@ CREATE SEQUENCE public.meeting_agendas_id_seq ALTER SEQUENCE public.meeting_agendas_id_seq OWNED BY public.meeting_agendas.id; --- --- Name: outcomes; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.outcomes ( - id bigint NOT NULL, - unit_standard_id bigint NOT NULL, - parent_id bigint, - code character varying, - name character varying, - created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL, - CONSTRAINT outcomes_code_length CHECK ((length((code)::text) <= 10)), - CONSTRAINT outcomes_code_presence CHECK (((code IS NOT NULL) AND ((code)::text !~ '^\s*$'::text))), - CONSTRAINT outcomes_name_length CHECK ((length((name)::text) <= 255)), - CONSTRAINT outcomes_name_presence CHECK (((name IS NOT NULL) AND ((name)::text !~ '^\s*$'::text))) -); - - --- --- Name: outcomes_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.outcomes_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: outcomes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.outcomes_id_seq OWNED BY public.outcomes.id; - - -- -- Name: papers; Type: TABLE; Schema: public; Owner: - -- @@ -3046,42 +3008,6 @@ CREATE SEQUENCE public.semester_registrations_id_seq ALTER SEQUENCE public.semester_registrations_id_seq OWNED BY public.semester_registrations.id; --- --- Name: standards; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.standards ( - id bigint NOT NULL, - version character varying, - name character varying, - created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL, - CONSTRAINT standards_name_length CHECK ((length((name)::text) <= 255)), - CONSTRAINT standards_name_presence CHECK (((name IS NOT NULL) AND ((name)::text !~ '^\s*$'::text))), - CONSTRAINT standards_version_length CHECK ((length((version)::text) <= 50)), - CONSTRAINT standards_version_presence CHECK (((version IS NOT NULL) AND ((version)::text !~ '^\s*$'::text))) -); - - --- --- Name: standards_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.standards_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: standards_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.standards_id_seq OWNED BY public.standards.id; - - -- -- Name: student_disability_types; Type: TABLE; Schema: public; Owner: - -- @@ -3609,41 +3535,6 @@ CREATE SEQUENCE public.unit_instruction_types_id_seq ALTER SEQUENCE public.unit_instruction_types_id_seq OWNED BY public.unit_instruction_types.id; --- --- Name: unit_standards; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.unit_standards ( - id bigint NOT NULL, - standard_id bigint NOT NULL, - unit_id bigint NOT NULL, - status integer, - created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL, - CONSTRAINT unit_standards_status_null CHECK ((status IS NOT NULL)), - CONSTRAINT unit_standards_status_numericality CHECK ((status >= 0)) -); - - --- --- Name: unit_standards_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.unit_standards_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: unit_standards_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.unit_standards_id_seq OWNED BY public.unit_standards.id; - - -- -- Name: unit_statuses; Type: TABLE; Schema: public; Owner: - -- @@ -4293,13 +4184,6 @@ ALTER TABLE ONLY public.ldap_sync_errors ALTER COLUMN id SET DEFAULT nextval('pu ALTER TABLE ONLY public.meeting_agendas ALTER COLUMN id SET DEFAULT nextval('public.meeting_agendas_id_seq'::regclass); --- --- Name: outcomes id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.outcomes ALTER COLUMN id SET DEFAULT nextval('public.outcomes_id_seq'::regclass); - - -- -- Name: papers id; Type: DEFAULT; Schema: public; Owner: - -- @@ -4412,13 +4296,6 @@ ALTER TABLE ONLY public.sdp_codes ALTER COLUMN id SET DEFAULT nextval('public.sd ALTER TABLE ONLY public.semester_registrations ALTER COLUMN id SET DEFAULT nextval('public.semester_registrations_id_seq'::regclass); --- --- Name: standards id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.standards ALTER COLUMN id SET DEFAULT nextval('public.standards_id_seq'::regclass); - - -- -- Name: student_disability_types id; Type: DEFAULT; Schema: public; Owner: - -- @@ -4524,13 +4401,6 @@ ALTER TABLE ONLY public.unit_instruction_languages ALTER COLUMN id SET DEFAULT n ALTER TABLE ONLY public.unit_instruction_types ALTER COLUMN id SET DEFAULT nextval('public.unit_instruction_types_id_seq'::regclass); --- --- Name: unit_standards id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.unit_standards ALTER COLUMN id SET DEFAULT nextval('public.unit_standards_id_seq'::regclass); - - -- -- Name: unit_statuses id; Type: DEFAULT; Schema: public; Owner: - -- @@ -5117,22 +4987,6 @@ ALTER TABLE ONLY public.meeting_agendas ADD CONSTRAINT meeting_agendas_pkey PRIMARY KEY (id); --- --- Name: outcomes outcomes_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.outcomes - ADD CONSTRAINT outcomes_pkey PRIMARY KEY (id); - - --- --- Name: outcomes outcomes_unit_standard_id_code_unique; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.outcomes - ADD CONSTRAINT outcomes_unit_standard_id_code_unique UNIQUE (unit_standard_id, code) DEFERRABLE; - - -- -- Name: papers papers_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -5285,22 +5139,6 @@ ALTER TABLE ONLY public.semester_registrations ADD CONSTRAINT semester_registrations_pkey PRIMARY KEY (id); --- --- Name: standards standards_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.standards - ADD CONSTRAINT standards_pkey PRIMARY KEY (id); - - --- --- Name: standards standards_version_name_unique; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.standards - ADD CONSTRAINT standards_version_name_unique UNIQUE (version, name) DEFERRABLE; - - -- -- Name: student_disability_types student_disability_types_code_unique; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -5597,14 +5435,6 @@ ALTER TABLE ONLY public.unit_instruction_types ADD CONSTRAINT unit_instruction_types_pkey PRIMARY KEY (id); --- --- Name: unit_standards unit_standards_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.unit_standards - ADD CONSTRAINT unit_standards_pkey PRIMARY KEY (id); - - -- -- Name: unit_statuses unit_statuses_code_unique; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -6233,20 +6063,6 @@ CREATE INDEX index_meeting_agendas_on_agenda_id ON public.meeting_agendas USING CREATE INDEX index_meeting_agendas_on_committee_meeting_id ON public.meeting_agendas USING btree (committee_meeting_id); --- --- Name: index_outcomes_on_parent_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_outcomes_on_parent_id ON public.outcomes USING btree (parent_id); - - --- --- Name: index_outcomes_on_unit_standard_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_outcomes_on_unit_standard_id ON public.outcomes USING btree (unit_standard_id); - - -- -- Name: index_papers_on_country_id; Type: INDEX; Schema: public; Owner: - -- @@ -6506,20 +6322,6 @@ CREATE INDEX index_unit_calendars_on_calendar_id ON public.unit_calendars USING CREATE INDEX index_unit_calendars_on_unit_id ON public.unit_calendars USING btree (unit_id); --- --- Name: index_unit_standards_on_standard_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_unit_standards_on_standard_id ON public.unit_standards USING btree (standard_id); - - --- --- Name: index_unit_standards_on_unit_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_unit_standards_on_unit_id ON public.unit_standards USING btree (unit_id); - - -- -- Name: index_unit_tuitions_on_tuition_id; Type: INDEX; Schema: public; Owner: - -- @@ -6763,14 +6565,6 @@ ALTER TABLE ONLY public.available_courses ADD CONSTRAINT fk_rails_356137da91 FOREIGN KEY (academic_term_id) REFERENCES public.academic_terms(id); --- --- Name: outcomes fk_rails_3634b68120; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.outcomes - ADD CONSTRAINT fk_rails_3634b68120 FOREIGN KEY (unit_standard_id) REFERENCES public.unit_standards(id); - - -- -- Name: group_courses fk_rails_3b3edaa11b; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -6795,14 +6589,6 @@ ALTER TABLE ONLY public.articles ADD CONSTRAINT fk_rails_3d31dad1cc FOREIGN KEY (user_id) REFERENCES public.users(id); --- --- Name: outcomes fk_rails_3ea0ff4a78; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.outcomes - ADD CONSTRAINT fk_rails_3ea0ff4a78 FOREIGN KEY (parent_id) REFERENCES public.outcomes(id); - - -- -- Name: duties fk_rails_3f1a2d48dd; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -6899,14 +6685,6 @@ ALTER TABLE ONLY public.calendar_committee_decisions ADD CONSTRAINT fk_rails_4f3eb3da94 FOREIGN KEY (calendar_id) REFERENCES public.calendars(id); --- --- Name: unit_standards fk_rails_505755c23e; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.unit_standards - ADD CONSTRAINT fk_rails_505755c23e FOREIGN KEY (unit_id) REFERENCES public.units(id); - - -- -- Name: identities fk_rails_5373344100; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7283,14 +7061,6 @@ ALTER TABLE ONLY public.books ADD CONSTRAINT fk_rails_bc582ddd02 FOREIGN KEY (user_id) REFERENCES public.users(id); --- --- Name: unit_standards fk_rails_bd51470089; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.unit_standards - ADD CONSTRAINT fk_rails_bd51470089 FOREIGN KEY (standard_id) REFERENCES public.standards(id); - - -- -- Name: ldap_sync_errors fk_rails_c34f07ddd2; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7624,9 +7394,6 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200213124638'), ('20200215132359'), ('20200217110305'), -('20200305103056'), -('20200305120339'), -('20200310044429'), ('20200310101357'), ('20200317094504'); From dbdd910c87954b626fc61a3be748e1af180a073f Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 14:16:59 +0300 Subject: [PATCH 491/970] Add standard related migrations correctly --- ...19080917_create_accreditation_standards.rb | 20 ++ db/migrate/20200319082359_create_standards.rb | 16 + .../20200319085939_create_unit_standards.rb | 12 + db/migrate/20200319090221_create_outcomes.rb | 20 ++ db/structure.sql | 297 +++++++++++++++++- 5 files changed, 364 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20200319080917_create_accreditation_standards.rb create mode 100644 db/migrate/20200319082359_create_standards.rb create mode 100644 db/migrate/20200319085939_create_unit_standards.rb create mode 100644 db/migrate/20200319090221_create_outcomes.rb diff --git a/db/migrate/20200319080917_create_accreditation_standards.rb b/db/migrate/20200319080917_create_accreditation_standards.rb new file mode 100644 index 000000000..295fe47cf --- /dev/null +++ b/db/migrate/20200319080917_create_accreditation_standards.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class CreateAccreditationStandards < ActiveRecord::Migration[6.0] + def change + create_table :accreditation_standards do |t| + t.string :version + t.string :name + + t.timestamps + end + + add_length_constraint :accreditation_standards, :version, less_than_or_equal_to: 50 + add_length_constraint :accreditation_standards, :name, less_than_or_equal_to: 255 + + add_presence_constraint :accreditation_standards, :version + add_presence_constraint :accreditation_standards, :name + + add_unique_constraint :accreditation_standards, [:version, :name] + end +end diff --git a/db/migrate/20200319082359_create_standards.rb b/db/migrate/20200319082359_create_standards.rb new file mode 100644 index 000000000..98b6d5708 --- /dev/null +++ b/db/migrate/20200319082359_create_standards.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CreateStandards < ActiveRecord::Migration[6.0] + def change + create_table :standards do |t| + t.references :accreditation_standard, foreign_key: true, null: false + t.integer :status + + t.timestamps + end + + add_null_constraint :standards, :status + + add_numericality_constraint :standards, :status, greater_than_or_equal_to: 0 + end +end diff --git a/db/migrate/20200319085939_create_unit_standards.rb b/db/migrate/20200319085939_create_unit_standards.rb new file mode 100644 index 000000000..5b46f38ac --- /dev/null +++ b/db/migrate/20200319085939_create_unit_standards.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class CreateUnitStandards < ActiveRecord::Migration[6.0] + def change + create_table :unit_standards do |t| + t.references :unit, foreign_key: true + t.references :standard, foreign_key: true + + t.timestamps + end + end +end diff --git a/db/migrate/20200319090221_create_outcomes.rb b/db/migrate/20200319090221_create_outcomes.rb new file mode 100644 index 000000000..612efd676 --- /dev/null +++ b/db/migrate/20200319090221_create_outcomes.rb @@ -0,0 +1,20 @@ +class CreateOutcomes < ActiveRecord::Migration[6.0] + def change + create_table :outcomes do |t| + t.references :standard, null: false, foreign_key: true + t.references :parent, foreign_key: { to_table: :outcomes } + t.string :code + t.string :name + + t.timestamps + end + + add_length_constraint :outcomes, :code, less_than_or_equal_to: 10 + add_length_constraint :outcomes, :name, less_than_or_equal_to: 255 + + add_presence_constraint :outcomes, :code + add_presence_constraint :outcomes, :name + + add_unique_constraint :outcomes, [:standard_id, :code] + end +end diff --git a/db/structure.sql b/db/structure.sql index 0f2d32cab..434c10b25 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -115,6 +115,42 @@ CREATE SEQUENCE public.academic_terms_id_seq ALTER SEQUENCE public.academic_terms_id_seq OWNED BY public.academic_terms.id; +-- +-- Name: accreditation_standards; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.accreditation_standards ( + id bigint NOT NULL, + version character varying, + name character varying, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL, + CONSTRAINT accreditation_standards_name_length CHECK ((length((name)::text) <= 255)), + CONSTRAINT accreditation_standards_name_presence CHECK (((name IS NOT NULL) AND ((name)::text !~ '^\s*$'::text))), + CONSTRAINT accreditation_standards_version_length CHECK ((length((version)::text) <= 50)), + CONSTRAINT accreditation_standards_version_presence CHECK (((version IS NOT NULL) AND ((version)::text !~ '^\s*$'::text))) +); + + +-- +-- Name: accreditation_standards_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.accreditation_standards_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: accreditation_standards_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.accreditation_standards_id_seq OWNED BY public.accreditation_standards.id; + + -- -- Name: action_text_rich_texts; Type: TABLE; Schema: public; Owner: - -- @@ -2250,6 +2286,44 @@ CREATE SEQUENCE public.meeting_agendas_id_seq ALTER SEQUENCE public.meeting_agendas_id_seq OWNED BY public.meeting_agendas.id; +-- +-- Name: outcomes; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.outcomes ( + id bigint NOT NULL, + standard_id bigint NOT NULL, + parent_id bigint, + code character varying, + name character varying, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL, + CONSTRAINT outcomes_code_length CHECK ((length((code)::text) <= 10)), + CONSTRAINT outcomes_code_presence CHECK (((code IS NOT NULL) AND ((code)::text !~ '^\s*$'::text))), + CONSTRAINT outcomes_name_length CHECK ((length((name)::text) <= 255)), + CONSTRAINT outcomes_name_presence CHECK (((name IS NOT NULL) AND ((name)::text !~ '^\s*$'::text))) +); + + +-- +-- Name: outcomes_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.outcomes_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: outcomes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.outcomes_id_seq OWNED BY public.outcomes.id; + + -- -- Name: papers; Type: TABLE; Schema: public; Owner: - -- @@ -3008,6 +3082,40 @@ CREATE SEQUENCE public.semester_registrations_id_seq ALTER SEQUENCE public.semester_registrations_id_seq OWNED BY public.semester_registrations.id; +-- +-- Name: standards; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.standards ( + id bigint NOT NULL, + accreditation_standard_id bigint NOT NULL, + status integer, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL, + CONSTRAINT standards_status_null CHECK ((status IS NOT NULL)), + CONSTRAINT standards_status_numericality CHECK ((status >= 0)) +); + + +-- +-- Name: standards_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.standards_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: standards_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.standards_id_seq OWNED BY public.standards.id; + + -- -- Name: student_disability_types; Type: TABLE; Schema: public; Owner: - -- @@ -3535,6 +3643,38 @@ CREATE SEQUENCE public.unit_instruction_types_id_seq ALTER SEQUENCE public.unit_instruction_types_id_seq OWNED BY public.unit_instruction_types.id; +-- +-- Name: unit_standards; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.unit_standards ( + id bigint NOT NULL, + unit_id bigint, + standard_id bigint, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL +); + + +-- +-- Name: unit_standards_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.unit_standards_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: unit_standards_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.unit_standards_id_seq OWNED BY public.unit_standards.id; + + -- -- Name: unit_statuses; Type: TABLE; Schema: public; Owner: - -- @@ -3827,6 +3967,13 @@ ALTER TABLE ONLY public.academic_credentials ALTER COLUMN id SET DEFAULT nextval ALTER TABLE ONLY public.academic_terms ALTER COLUMN id SET DEFAULT nextval('public.academic_terms_id_seq'::regclass); +-- +-- Name: accreditation_standards id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.accreditation_standards ALTER COLUMN id SET DEFAULT nextval('public.accreditation_standards_id_seq'::regclass); + + -- -- Name: action_text_rich_texts id; Type: DEFAULT; Schema: public; Owner: - -- @@ -4184,6 +4331,13 @@ ALTER TABLE ONLY public.ldap_sync_errors ALTER COLUMN id SET DEFAULT nextval('pu ALTER TABLE ONLY public.meeting_agendas ALTER COLUMN id SET DEFAULT nextval('public.meeting_agendas_id_seq'::regclass); +-- +-- Name: outcomes id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.outcomes ALTER COLUMN id SET DEFAULT nextval('public.outcomes_id_seq'::regclass); + + -- -- Name: papers id; Type: DEFAULT; Schema: public; Owner: - -- @@ -4296,6 +4450,13 @@ ALTER TABLE ONLY public.sdp_codes ALTER COLUMN id SET DEFAULT nextval('public.sd ALTER TABLE ONLY public.semester_registrations ALTER COLUMN id SET DEFAULT nextval('public.semester_registrations_id_seq'::regclass); +-- +-- Name: standards id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.standards ALTER COLUMN id SET DEFAULT nextval('public.standards_id_seq'::regclass); + + -- -- Name: student_disability_types id; Type: DEFAULT; Schema: public; Owner: - -- @@ -4401,6 +4562,13 @@ ALTER TABLE ONLY public.unit_instruction_languages ALTER COLUMN id SET DEFAULT n ALTER TABLE ONLY public.unit_instruction_types ALTER COLUMN id SET DEFAULT nextval('public.unit_instruction_types_id_seq'::regclass); +-- +-- Name: unit_standards id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.unit_standards ALTER COLUMN id SET DEFAULT nextval('public.unit_standards_id_seq'::regclass); + + -- -- Name: unit_statuses id; Type: DEFAULT; Schema: public; Owner: - -- @@ -4459,6 +4627,22 @@ ALTER TABLE ONLY public.academic_terms ADD CONSTRAINT academic_terms_pkey PRIMARY KEY (id); +-- +-- Name: accreditation_standards accreditation_standards_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.accreditation_standards + ADD CONSTRAINT accreditation_standards_pkey PRIMARY KEY (id); + + +-- +-- Name: accreditation_standards accreditation_standards_version_name_unique; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.accreditation_standards + ADD CONSTRAINT accreditation_standards_version_name_unique UNIQUE (version, name) DEFERRABLE; + + -- -- Name: action_text_rich_texts action_text_rich_texts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -4987,6 +5171,22 @@ ALTER TABLE ONLY public.meeting_agendas ADD CONSTRAINT meeting_agendas_pkey PRIMARY KEY (id); +-- +-- Name: outcomes outcomes_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.outcomes + ADD CONSTRAINT outcomes_pkey PRIMARY KEY (id); + + +-- +-- Name: outcomes outcomes_standard_id_code_unique; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.outcomes + ADD CONSTRAINT outcomes_standard_id_code_unique UNIQUE (standard_id, code) DEFERRABLE; + + -- -- Name: papers papers_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -5139,6 +5339,14 @@ ALTER TABLE ONLY public.semester_registrations ADD CONSTRAINT semester_registrations_pkey PRIMARY KEY (id); +-- +-- Name: standards standards_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.standards + ADD CONSTRAINT standards_pkey PRIMARY KEY (id); + + -- -- Name: student_disability_types student_disability_types_code_unique; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -5435,6 +5643,14 @@ ALTER TABLE ONLY public.unit_instruction_types ADD CONSTRAINT unit_instruction_types_pkey PRIMARY KEY (id); +-- +-- Name: unit_standards unit_standards_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.unit_standards + ADD CONSTRAINT unit_standards_pkey PRIMARY KEY (id); + + -- -- Name: unit_statuses unit_statuses_code_unique; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -6063,6 +6279,20 @@ CREATE INDEX index_meeting_agendas_on_agenda_id ON public.meeting_agendas USING CREATE INDEX index_meeting_agendas_on_committee_meeting_id ON public.meeting_agendas USING btree (committee_meeting_id); +-- +-- Name: index_outcomes_on_parent_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_outcomes_on_parent_id ON public.outcomes USING btree (parent_id); + + +-- +-- Name: index_outcomes_on_standard_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_outcomes_on_standard_id ON public.outcomes USING btree (standard_id); + + -- -- Name: index_papers_on_country_id; Type: INDEX; Schema: public; Owner: - -- @@ -6273,6 +6503,13 @@ CREATE INDEX index_semester_registrations_on_academic_term_id ON public.semester CREATE INDEX index_semester_registrations_on_student_id ON public.semester_registrations USING btree (student_id); +-- +-- Name: index_standards_on_accreditation_standard_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_standards_on_accreditation_standard_id ON public.standards USING btree (accreditation_standard_id); + + -- -- Name: index_students_on_scholarship_type_id; Type: INDEX; Schema: public; Owner: - -- @@ -6322,6 +6559,20 @@ CREATE INDEX index_unit_calendars_on_calendar_id ON public.unit_calendars USING CREATE INDEX index_unit_calendars_on_unit_id ON public.unit_calendars USING btree (unit_id); +-- +-- Name: index_unit_standards_on_standard_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_unit_standards_on_standard_id ON public.unit_standards USING btree (standard_id); + + +-- +-- Name: index_unit_standards_on_unit_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_unit_standards_on_unit_id ON public.unit_standards USING btree (unit_id); + + -- -- Name: index_unit_tuitions_on_tuition_id; Type: INDEX; Schema: public; Owner: - -- @@ -6589,6 +6840,14 @@ ALTER TABLE ONLY public.articles ADD CONSTRAINT fk_rails_3d31dad1cc FOREIGN KEY (user_id) REFERENCES public.users(id); +-- +-- Name: outcomes fk_rails_3ea0ff4a78; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.outcomes + ADD CONSTRAINT fk_rails_3ea0ff4a78 FOREIGN KEY (parent_id) REFERENCES public.outcomes(id); + + -- -- Name: duties fk_rails_3f1a2d48dd; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -6685,6 +6944,14 @@ ALTER TABLE ONLY public.calendar_committee_decisions ADD CONSTRAINT fk_rails_4f3eb3da94 FOREIGN KEY (calendar_id) REFERENCES public.calendars(id); +-- +-- Name: unit_standards fk_rails_505755c23e; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.unit_standards + ADD CONSTRAINT fk_rails_505755c23e FOREIGN KEY (unit_id) REFERENCES public.units(id); + + -- -- Name: identities fk_rails_5373344100; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -6981,6 +7248,14 @@ ALTER TABLE ONLY public.available_courses ADD CONSTRAINT fk_rails_a9099f01f5 FOREIGN KEY (coordinator_id) REFERENCES public.employees(id); +-- +-- Name: outcomes fk_rails_ab65fefdd7; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.outcomes + ADD CONSTRAINT fk_rails_ab65fefdd7 FOREIGN KEY (standard_id) REFERENCES public.standards(id); + + -- -- Name: classrooms fk_rails_b0064b7304; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -6989,6 +7264,14 @@ ALTER TABLE ONLY public.classrooms ADD CONSTRAINT fk_rails_b0064b7304 FOREIGN KEY (building_id) REFERENCES public.buildings(id); +-- +-- Name: standards fk_rails_b1419bb38e; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.standards + ADD CONSTRAINT fk_rails_b1419bb38e FOREIGN KEY (accreditation_standard_id) REFERENCES public.accreditation_standards(id); + + -- -- Name: prospective_students fk_rails_b1c146f76e; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7061,6 +7344,14 @@ ALTER TABLE ONLY public.books ADD CONSTRAINT fk_rails_bc582ddd02 FOREIGN KEY (user_id) REFERENCES public.users(id); +-- +-- Name: unit_standards fk_rails_bd51470089; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.unit_standards + ADD CONSTRAINT fk_rails_bd51470089 FOREIGN KEY (standard_id) REFERENCES public.standards(id); + + -- -- Name: ldap_sync_errors fk_rails_c34f07ddd2; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7395,6 +7686,10 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200215132359'), ('20200217110305'), ('20200310101357'), -('20200317094504'); +('20200317094504'), +('20200319080917'), +('20200319082359'), +('20200319085939'), +('20200319090221'); From 57622ffb8dc707fd7f81b66584b4d1e988782dd9 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 14:25:00 +0300 Subject: [PATCH 492/970] Delete standard related old files --- .../unit_standards_controller.rb | 58 ------------- .../reference/standards_controller.rb | 13 --- .../unit_standard_policy.rb | 13 --- app/policies/reference/standard_policy.rb | 15 ---- .../unit_standards/_form.html.erb | 35 -------- .../unit_standards/_select2.html.erb | 5 -- .../unit_standards/edit.html.erb | 1 - .../unit_standards/index.html.erb | 41 --------- .../unit_standards/new.html.erb | 1 - .../unit_standards/show.html.erb | 72 ---------------- app/views/reference/standards/_form.html.erb | 15 ---- app/views/reference/standards/edit.html.erb | 1 - app/views/reference/standards/index.html.erb | 8 -- app/views/reference/standards/new.html.erb | 1 - .../outcome_management/unit_standards.en.yml | 40 --------- .../outcome_management/unit_standards.tr.yml | 40 --------- .../controllers/reference/standards.en.yml | 28 ------ .../controllers/reference/standards.tr.yml | 28 ------ .../unit_standards_controller_test.rb | 86 ------------------- .../reference/standards_controller_test.rb | 14 --- .../unit_standard_policy_test.rb | 22 ----- 21 files changed, 537 deletions(-) delete mode 100644 app/controllers/outcome_management/unit_standards_controller.rb delete mode 100644 app/controllers/reference/standards_controller.rb delete mode 100644 app/policies/outcome_management/unit_standard_policy.rb delete mode 100644 app/policies/reference/standard_policy.rb delete mode 100644 app/views/outcome_management/unit_standards/_form.html.erb delete mode 100644 app/views/outcome_management/unit_standards/_select2.html.erb delete mode 100644 app/views/outcome_management/unit_standards/edit.html.erb delete mode 100644 app/views/outcome_management/unit_standards/index.html.erb delete mode 100644 app/views/outcome_management/unit_standards/new.html.erb delete mode 100644 app/views/outcome_management/unit_standards/show.html.erb delete mode 100644 app/views/reference/standards/_form.html.erb delete mode 100644 app/views/reference/standards/edit.html.erb delete mode 100644 app/views/reference/standards/index.html.erb delete mode 100644 app/views/reference/standards/new.html.erb delete mode 100644 config/locales/controllers/outcome_management/unit_standards.en.yml delete mode 100644 config/locales/controllers/outcome_management/unit_standards.tr.yml delete mode 100644 config/locales/controllers/reference/standards.en.yml delete mode 100644 config/locales/controllers/reference/standards.tr.yml delete mode 100644 test/controllers/outcome_management/unit_standards_controller_test.rb delete mode 100644 test/controllers/reference/standards_controller_test.rb delete mode 100644 test/policies/outcome_management/unit_standard_policy_test.rb diff --git a/app/controllers/outcome_management/unit_standards_controller.rb b/app/controllers/outcome_management/unit_standards_controller.rb deleted file mode 100644 index fcca7d239..000000000 --- a/app/controllers/outcome_management/unit_standards_controller.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -module OutcomeManagement - class UnitStandardsController < ApplicationController - include SearchableModule - - before_action :set_unit_standard, only: %i[show edit update destroy] - before_action :authorized? - - def index - unit_standards = UnitStandard.includes(:standard, :unit) - @pagy, @unit_standards = pagy(unit_standards) - end - - def show - @unit = @unit_standard.unit - @outcomes = @unit_standard.macro_outcomes.ordered - end - - def new - @unit_standard = UnitStandard.new - end - - def edit; end - - def create - @unit_standard = UnitStandard.new(unit_standard_params) - @unit_standard.save ? redirect_with('success') : render(:new) - end - - def update - @unit_standard.update(unit_standard_params) ? redirect_with('success') : render(:edit) - end - - def destroy - message = @unit_standard.destroy ? 'success' : 'error' - redirect_with(message) - end - - private - - def redirect_with(message) - redirect_to unit_standards_path, flash: { info: t(".#{message}") } - end - - def set_unit_standard - @unit_standard = UnitStandard.find(params[:id]) - end - - def authorized? - authorize([:outcome_management, @unit_standard || UnitStandard]) - end - - def unit_standard_params - params.require(:unit_standard).permit(:unit_id, :standard_id, :status) - end - end -end diff --git a/app/controllers/reference/standards_controller.rb b/app/controllers/reference/standards_controller.rb deleted file mode 100644 index 3223f0c80..000000000 --- a/app/controllers/reference/standards_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module Reference - class StandardsController < ApplicationController - include ReferenceResource - - private - - def secure_params - params.require(:standard).permit(:name, :version) - end - end -end diff --git a/app/policies/outcome_management/unit_standard_policy.rb b/app/policies/outcome_management/unit_standard_policy.rb deleted file mode 100644 index 5fd4abfcc..000000000 --- a/app/policies/outcome_management/unit_standard_policy.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module OutcomeManagement - class UnitStandardPolicy < ApplicationPolicy - include CrudPolicyMethods - - private - - def permitted?(*privileges) - user.privilege? :outcome_management, privileges - end - end -end diff --git a/app/policies/reference/standard_policy.rb b/app/policies/reference/standard_policy.rb deleted file mode 100644 index 930cf768b..000000000 --- a/app/policies/reference/standard_policy.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Reference - class StandardPolicy < ApplicationPolicy - include CrudPolicyMethods - - undef :show? - - private - - def permitted?(*privileges) - user.privilege? :reference_management, privileges - end - end -end diff --git a/app/views/outcome_management/unit_standards/_form.html.erb b/app/views/outcome_management/unit_standards/_form.html.erb deleted file mode 100644 index 4e6a6fd5b..000000000 --- a/app/views/outcome_management/unit_standards/_form.html.erb +++ /dev/null @@ -1,35 +0,0 @@ -
-
-
-
- <%= fa_icon 'university' %> - <%= form_title %> -
-
- <%= simple_form_for(@unit_standard) do |f| %> -
-
- <%= f.error_notification %> -
-
- <%= f.association :unit, collection: Unit.active.programs.order(:name), label_method: :names_depth_cache %> -
-
- <%= f.association :standard %> -
-
- <%= f.input :status, collection: enum_options_for_select(f.object.class, :status), selected: :active %> -
- -
- <%= f.button :submit, class: 'btn btn-outline-success btn-sm' %> - <%= link_to_back(:back) %> -
-
- <% end %> -
-
-
-
- -<%= render 'select2' %> diff --git a/app/views/outcome_management/unit_standards/_select2.html.erb b/app/views/outcome_management/unit_standards/_select2.html.erb deleted file mode 100644 index 506bee4db..000000000 --- a/app/views/outcome_management/unit_standards/_select2.html.erb +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/app/views/outcome_management/unit_standards/edit.html.erb b/app/views/outcome_management/unit_standards/edit.html.erb deleted file mode 100644 index 66a539974..000000000 --- a/app/views/outcome_management/unit_standards/edit.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render 'form', unit_standard: @unit_standard, form_title: t('.form_title') %> diff --git a/app/views/outcome_management/unit_standards/index.html.erb b/app/views/outcome_management/unit_standards/index.html.erb deleted file mode 100644 index a6d89364a..000000000 --- a/app/views/outcome_management/unit_standards/index.html.erb +++ /dev/null @@ -1,41 +0,0 @@ -
-
-
-
- <%= fa_icon 'align-justify', text: t('.card_header') %> -
- <%= link_to_new(t('.new_unit_standard_link'), new_unit_standard_path) %> -
-
-
- - - - - - - - - - - <% @unit_standards.each do |unit_standard| %> - <% unit = unit_standard.unit %> - - - - - - - - <% end %> - -
<%= t('.standard') %><%= t('.unit') %><%= t('.status') %><%= t('actions') %>
<%= unit_standard.standard.name %><%= link_to(unit.names_depth_cache, unit_path(unit)) %><%= enum_t(unit_standard, :status) %><%= link_to_actions(unit_standard) %>
-
-
- -
-
diff --git a/app/views/outcome_management/unit_standards/new.html.erb b/app/views/outcome_management/unit_standards/new.html.erb deleted file mode 100644 index 66a539974..000000000 --- a/app/views/outcome_management/unit_standards/new.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render 'form', unit_standard: @unit_standard, form_title: t('.form_title') %> diff --git a/app/views/outcome_management/unit_standards/show.html.erb b/app/views/outcome_management/unit_standards/show.html.erb deleted file mode 100644 index ad7efb08a..000000000 --- a/app/views/outcome_management/unit_standards/show.html.erb +++ /dev/null @@ -1,72 +0,0 @@ -
-
-
-
- <%= fa_icon 'university' %><%= @unit.name %> -
- <%= link_to_actions(@unit_standard, except: :show) %> -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
<%= t('.unit') %><%= link_to(@unit.name, @unit) %>
<%= t('.standard') %><%= @unit_standard.standard.name %>
<%= t('.status') %><%= enum_t(@unit_standard, :status) %>
<%= t('created_at') %><%= @unit_standard.created_at %>
<%= t('updated_at') %><%= @unit_standard.updated_at %>
-
-
-
-
- -
-
-
-
- <%= fa_icon 'dot-circle-o', text: t('.card_header') %> -
- <%= link_to_new(t('.new_outcome_link'), new_unit_standard_outcome_path(@unit_standard)) %> -
-
-
- - - - - - - - - - <% @outcomes.each do |outcome| %> - - - - - - <% end %> - -
<%= t('.outcome_code') %><%= t('.outcome_name') %><%= t('actions') %>
<%= outcome.code %><%= outcome.name %><%= link_to_show([@unit_standard, outcome]) %>
-
-
-
-
diff --git a/app/views/reference/standards/_form.html.erb b/app/views/reference/standards/_form.html.erb deleted file mode 100644 index c9e9b8c26..000000000 --- a/app/views/reference/standards/_form.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<%= render 'layouts/builders/form', - namespace: 'reference', - klass: @standard, - params: [ - { - field: 'version', - width: 6, - required: true - }, - { - field: 'name', - width: 6, - required: true - } - ] %> diff --git a/app/views/reference/standards/edit.html.erb b/app/views/reference/standards/edit.html.erb deleted file mode 100644 index 2d3436368..000000000 --- a/app/views/reference/standards/edit.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render 'form' %> diff --git a/app/views/reference/standards/index.html.erb b/app/views/reference/standards/index.html.erb deleted file mode 100644 index e975c0020..000000000 --- a/app/views/reference/standards/index.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<%= render 'layouts/builders/index', - namespace: 'reference', - klass: 'standard', - collection: @standards, - pagy: @pagy, - card_header: t('.card_header'), - params: %w[name], - actions: %w[edit destroy] %> diff --git a/app/views/reference/standards/new.html.erb b/app/views/reference/standards/new.html.erb deleted file mode 100644 index 2d3436368..000000000 --- a/app/views/reference/standards/new.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render 'form' %> diff --git a/config/locales/controllers/outcome_management/unit_standards.en.yml b/config/locales/controllers/outcome_management/unit_standards.en.yml deleted file mode 100644 index f142aff6f..000000000 --- a/config/locales/controllers/outcome_management/unit_standards.en.yml +++ /dev/null @@ -1,40 +0,0 @@ -en: - activerecord: - attributes: - unit_standard: &unit_standard_attributes - standard: Standard - status: Status - unit: Program - enums: - unit_standard: - statuses: - active: Active - passive: Passive - helpers: - submit: - unit_standard: - create: Create Unit Standard - update: Update Unit Standard - outcome_management: - unit_standards: - create: - success: Unit standard successfully created. - destroy: - success: Unit standard successfully deleted. - warning: Unit standard can not be deleted. - edit: - form_title: Update Unit Standard - index: - <<: *unit_standard_attributes - card_header: Unit Standards - new_unit_standard_link: Create a New Unit Standard - new: - form_title: Create a Unit Standard - show: - <<: *unit_standard_attributes - card_header: Learning Outcomes - new_outcome_link: Create a New Learning Outcome - outcome_code: Code - outcome_name: Name - update: - success: Unit standard successfully updated. diff --git a/config/locales/controllers/outcome_management/unit_standards.tr.yml b/config/locales/controllers/outcome_management/unit_standards.tr.yml deleted file mode 100644 index b3ac3e2ea..000000000 --- a/config/locales/controllers/outcome_management/unit_standards.tr.yml +++ /dev/null @@ -1,40 +0,0 @@ -tr: - activerecord: - attributes: - unit_standard: &unit_standard_attributes - standard: Standart - status: Durum - unit: Program - enums: - unit_standard: - statuses: - active: Aktif - passive: Pasif - helpers: - submit: - unit_standard: - create: Birim Standardı Oluştur - update: Birim Standardını Güncelle - outcome_management: - unit_standards: - create: - success: Birim standardı başarıyla oluşturuldu. - destroy: - success: Birim standardı başarıyla silindi! - warning: Birim standardı silinemedi! - edit: - form_title: Birim Standardını Güncelle - index: - <<: *unit_standard_attributes - card_header: Birim Standartları - new_unit_standard_link: Yeni Birim Standardı Oluştur - new: - form_title: Birim Standardı Oluştur - show: - <<: *unit_standard_attributes - card_header: Öğrenim Çıktıları - new_outcome_link: Yeni Öğrenim Çıktısı Oluştur - outcome_code: Kodu - outcome_name: Adı - update: - success: Birim standardı başarıyla güncellendi. diff --git a/config/locales/controllers/reference/standards.en.yml b/config/locales/controllers/reference/standards.en.yml deleted file mode 100644 index f6194cc05..000000000 --- a/config/locales/controllers/reference/standards.en.yml +++ /dev/null @@ -1,28 +0,0 @@ -en: - activerecord: - attributes: - standard: &standard_attributes - version: Version - name: Name - helpers: - submit: - standard: - create: Create Standard - update: Update Standard - reference: - standards: - create: - success: Standard successfully created. - destroy: - success: Standard successfully deleted. - warning: Standard could not be deleted. - edit: - form_title: Update the Standard - index: - <<: *standard_attributes - card_header: Standards - new_standard_link: New Standard - new: - form_title: Create a New Standard - update: - success: Standard successfully updated. diff --git a/config/locales/controllers/reference/standards.tr.yml b/config/locales/controllers/reference/standards.tr.yml deleted file mode 100644 index 15900cc1b..000000000 --- a/config/locales/controllers/reference/standards.tr.yml +++ /dev/null @@ -1,28 +0,0 @@ -tr: - activerecord: - attributes: - standard: &standard_attributes - version: Versiyon - name: Adı - helpers: - submit: - standard: - create: Standart Oluştur - update: Standart Güncelle - reference: - standards: - create: - success: Standart başarıyla oluşturuldu. - destroy: - success: Standart başarıyla silindi. - warning: Standart silinemedi! - edit: - form_title: Standartı Güncelle - index: - <<: *standard_attributes - card_header: Standartlar - new_standard_link: Yeni Standart - new: - form_title: Standart Oluştur - update: - success: Standart başarıyla güncellendi. diff --git a/test/controllers/outcome_management/unit_standards_controller_test.rb b/test/controllers/outcome_management/unit_standards_controller_test.rb deleted file mode 100644 index bcfd91b9c..000000000 --- a/test/controllers/outcome_management/unit_standards_controller_test.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -require 'test_helper' - -module OutcomeManagement - class UnitStandardsControllerTest < ActionDispatch::IntegrationTest - setup do - sign_in users(:serhat) - @unit_standard = unit_standards(:one) - end - - test 'should get index' do - get unit_standards_path - assert_response :success - end - - test 'should get show' do - get unit_standards_path(@unit_standard) - assert_response :success - end - - test 'should get new' do - get new_unit_standard_path - assert_response :success - end - - test 'should create unit standard' do - assert_difference('UnitStandard.count') do - post unit_standards_path, params: { - unit_standard: { - unit_id: units(:fen_bilgisi_ogretmenligi_programi).id, - standard_id: standards(:fedek).id, - status: :active - } - } - end - - unit_standard = UnitStandard.last - - assert_equal units(:fen_bilgisi_ogretmenligi_programi), unit_standard.unit - assert_equal standards(:fedek), unit_standard.standard - assert unit_standard.active? - assert_redirected_to unit_standards_path - end - - test 'should get edit' do - get edit_unit_standard_path(@unit_standard) - assert_response :success - assert_select '.card-header strong', translate('.edit.form_title') - end - - test 'should update unit standard' do - unit_standard = UnitStandard.last - patch unit_standard_path(@unit_standard), params: { - unit_standard: { - unit_id: units(:fen_bilgisi_ogretmenligi_programi).id, - standard_id: standards(:fedek).id, - status: :passive - } - } - - unit_standard.reload - - assert_equal units(:fen_bilgisi_ogretmenligi_programi), unit_standard.unit - assert_equal standards(:fedek), unit_standard.standard - assert unit_standard.passive? - assert_redirected_to unit_standards_path - assert_equal translate('.update.success'), flash[:info] - end - - test 'should destroy unit standard' do - assert_difference('UnitStandard.count', -1) do - delete unit_standard_path(@unit_standard) - end - - assert_redirected_to unit_standards_path - assert_equal translate('.destroy.success'), flash[:info] - end - - private - - def translate(key) - t("outcome_management.unit_standards#{key}") - end - end -end diff --git a/test/controllers/reference/standards_controller_test.rb b/test/controllers/reference/standards_controller_test.rb deleted file mode 100644 index 84078316d..000000000 --- a/test/controllers/reference/standards_controller_test.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'test_helper' -require_relative '../concerns/reference_resource_test' - -class StandardsControllerTest < ActionDispatch::IntegrationTest - include ReferenceResourceTest - - setup do - @target_path = 'reference' - @create_params = { name: 'MİAK', version: '1' } - @update_params = { name: 'EPDAD', version: '1' } - end -end diff --git a/test/policies/outcome_management/unit_standard_policy_test.rb b/test/policies/outcome_management/unit_standard_policy_test.rb deleted file mode 100644 index 0f5fae08a..000000000 --- a/test/policies/outcome_management/unit_standard_policy_test.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -require 'pundit_test_case' - -module OutcomeManagement - class UnitStandardPolicyTest < PunditTestCase - %w[ - create? - destroy? - edit? - index? - new? - show? - update? - ].each do |method| - test method do - assert_permit users(:serhat) - assert_not_permit users(:mine) - end - end - end -end From 76c010677a3c11efc35aa8be4da30e27ca1ec1ff Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 14:26:36 +0300 Subject: [PATCH 493/970] Add accreditation standard model & controller --- .../accreditation_standards_controller.rb | 13 +++++++++++++ app/models/accreditation_standard.rb | 13 +++++++++++++ .../reference/accreditation_standard_policy.rb | 15 +++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 app/controllers/reference/accreditation_standards_controller.rb create mode 100644 app/models/accreditation_standard.rb create mode 100644 app/policies/reference/accreditation_standard_policy.rb diff --git a/app/controllers/reference/accreditation_standards_controller.rb b/app/controllers/reference/accreditation_standards_controller.rb new file mode 100644 index 000000000..ec63f8596 --- /dev/null +++ b/app/controllers/reference/accreditation_standards_controller.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Reference + class AccreditationStandardsController < ApplicationController + include ReferenceResource + + private + + def secure_params + params.require(:accreditation_standard).permit(:name, :version) + end + end +end diff --git a/app/models/accreditation_standard.rb b/app/models/accreditation_standard.rb new file mode 100644 index 000000000..ca1312763 --- /dev/null +++ b/app/models/accreditation_standard.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AccreditationStandard < ApplicationRecord + # search + include ReferenceSearch + + # relations + has_many :standards, dependent: :destroy + + # validations + validates :version, presence: true, length: { maximum: 50 } + validates :name, presence: true, uniqueness: { scope: :version }, length: { maximum: 255 } +end diff --git a/app/policies/reference/accreditation_standard_policy.rb b/app/policies/reference/accreditation_standard_policy.rb new file mode 100644 index 000000000..3086f14eb --- /dev/null +++ b/app/policies/reference/accreditation_standard_policy.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Reference + class AccreditationStandardPolicy < ApplicationPolicy + include CrudPolicyMethods + + undef :show? + + private + + def permitted?(*privileges) + user.privilege? :reference_management, privileges + end + end +end From 5b591e625170f8d684f42656cab6940a6f4b62a2 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 14:31:27 +0300 Subject: [PATCH 494/970] Add accreditation standard routes & views --- .../accreditation_standards/_form.html.erb | 15 ++++++++++ .../accreditation_standards/edit.html.erb | 1 + .../accreditation_standards/index.html.erb | 8 ++++++ .../accreditation_standards/new.html.erb | 1 + app/views/reference/dashboard/index.html.erb | 2 +- .../reference/accreditation_standards.en.yml | 28 +++++++++++++++++++ .../reference/accreditation_standards.tr.yml | 28 +++++++++++++++++++ config/routes/reference.rb | 22 +++++++-------- 8 files changed, 93 insertions(+), 12 deletions(-) create mode 100644 app/views/reference/accreditation_standards/_form.html.erb create mode 100644 app/views/reference/accreditation_standards/edit.html.erb create mode 100644 app/views/reference/accreditation_standards/index.html.erb create mode 100644 app/views/reference/accreditation_standards/new.html.erb create mode 100644 config/locales/controllers/reference/accreditation_standards.en.yml create mode 100644 config/locales/controllers/reference/accreditation_standards.tr.yml diff --git a/app/views/reference/accreditation_standards/_form.html.erb b/app/views/reference/accreditation_standards/_form.html.erb new file mode 100644 index 000000000..61c423385 --- /dev/null +++ b/app/views/reference/accreditation_standards/_form.html.erb @@ -0,0 +1,15 @@ +<%= render 'layouts/builders/form', + namespace: 'reference', + klass: @accreditation_standard, + params: [ + { + field: 'version', + width: 6, + required: true + }, + { + field: 'name', + width: 6, + required: true + } + ] %> diff --git a/app/views/reference/accreditation_standards/edit.html.erb b/app/views/reference/accreditation_standards/edit.html.erb new file mode 100644 index 000000000..2d3436368 --- /dev/null +++ b/app/views/reference/accreditation_standards/edit.html.erb @@ -0,0 +1 @@ +<%= render 'form' %> diff --git a/app/views/reference/accreditation_standards/index.html.erb b/app/views/reference/accreditation_standards/index.html.erb new file mode 100644 index 000000000..002f5e7c9 --- /dev/null +++ b/app/views/reference/accreditation_standards/index.html.erb @@ -0,0 +1,8 @@ +<%= render 'layouts/builders/index', + namespace: 'reference', + klass: 'accreditation_standard', + collection: @accreditation_standards, + pagy: @pagy, + card_header: t('.card_header'), + params: %w[name], + actions: %w[edit destroy] %> diff --git a/app/views/reference/accreditation_standards/new.html.erb b/app/views/reference/accreditation_standards/new.html.erb new file mode 100644 index 000000000..2d3436368 --- /dev/null +++ b/app/views/reference/accreditation_standards/new.html.erb @@ -0,0 +1 @@ +<%= render 'form' %> diff --git a/app/views/reference/dashboard/index.html.erb b/app/views/reference/dashboard/index.html.erb index eef306e98..e3703a4b4 100644 --- a/app/views/reference/dashboard/index.html.erb +++ b/app/views/reference/dashboard/index.html.erb @@ -58,7 +58,7 @@ <%= link_to %i[reference titles], class: item_class do %> <%= t('.titles') %> <% end %> - <%= link_to %i[reference standards], class: item_class do %> + <%= link_to %i[reference accreditation_standards], class: item_class do %> <%= t('.standards') %> <% end %>
diff --git a/config/locales/controllers/reference/accreditation_standards.en.yml b/config/locales/controllers/reference/accreditation_standards.en.yml new file mode 100644 index 000000000..dbbda6f81 --- /dev/null +++ b/config/locales/controllers/reference/accreditation_standards.en.yml @@ -0,0 +1,28 @@ +en: + activerecord: + attributes: + accreditation_standard: &accreditation_standard_attributes + version: Version + name: Name + helpers: + submit: + accreditation_standard: + create: Create Accreditation Standard + update: Update Accreditation Standard + reference: + accreditation_standards: + create: + success: Accreditation standard successfully created. + destroy: + success: Accreditation standard successfully deleted. + warning: Accreditation standard could not be deleted. + edit: + form_title: Update the Accreditation Standard + index: + <<: *accreditation_standard_attributes + card_header: Accreditation Standards + new_accreditation_standard_link: New Accreditation Standard + new: + form_title: Create a New Accreditation Standard + update: + success: Accreditation standard successfully updated. diff --git a/config/locales/controllers/reference/accreditation_standards.tr.yml b/config/locales/controllers/reference/accreditation_standards.tr.yml new file mode 100644 index 000000000..67b431158 --- /dev/null +++ b/config/locales/controllers/reference/accreditation_standards.tr.yml @@ -0,0 +1,28 @@ +tr: + activerecord: + attributes: + accreditation_standard: &accreditation_standard_attributes + version: Versiyon + name: Adı + helpers: + submit: + accreditation_standard: + create: Akreditasyon standardı Oluştur + update: Akreditasyon standardını Güncelle + reference: + accreditation_standards: + create: + success: Akreditasyon standardı başarıyla oluşturuldu. + destroy: + success: Akreditasyon standardı başarıyla silindi. + warning: Akreditasyon standardı silinemedi! + edit: + form_title: Akreditasyon Standardını Güncelle + index: + <<: *accreditation_standard_attributes + card_header: Akreditasyon Standartları + new_accreditation_standard_link: Yeni Akreditasyon Standardı + new: + form_title: Akreditasyon Standardı Oluştur + update: + success: Akreditasyon standardı başarıyla güncellendi. diff --git a/config/routes/reference.rb b/config/routes/reference.rb index f8c9f6969..53f017c61 100644 --- a/config/routes/reference.rb +++ b/config/routes/reference.rb @@ -2,15 +2,15 @@ namespace :reference do get '/', to: 'dashboard#index' - resources :academic_terms, except: :show - resources :assessment_methods, except: :show - resources :course_group_types, except: :show - resources :course_types, except: :show - resources :document_types, except: :show - resources :evaluation_types, except: :show - resources :high_school_types, except: :show - resources :languages, except: :show - resources :scholarship_types, except: :show - resources :standards, except: :show - resources :titles, except: :show + resources :academic_terms, except: :show + resources :assessment_methods, except: :show + resources :course_group_types, except: :show + resources :course_types, except: :show + resources :document_types, except: :show + resources :evaluation_types, except: :show + resources :high_school_types, except: :show + resources :languages, except: :show + resources :scholarship_types, except: :show + resources :accreditation_standards, except: :show + resources :titles, except: :show end From 16d01392beb0bcdbf087d36cecf7d813f7599a47 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 14:33:09 +0300 Subject: [PATCH 495/970] Add accreditation standard tests --- ...accreditation_standards_controller_test.rb | 14 ++++++++++ test/fixtures/accreditation_standards.yml | 9 +++++++ test/models/accreditation_standard_test.rb | 26 +++++++++++++++++++ .../accreditation_standard_policy_test.rb | 21 +++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 test/controllers/reference/accreditation_standards_controller_test.rb create mode 100644 test/fixtures/accreditation_standards.yml create mode 100644 test/models/accreditation_standard_test.rb create mode 100644 test/policies/reference/accreditation_standard_policy_test.rb diff --git a/test/controllers/reference/accreditation_standards_controller_test.rb b/test/controllers/reference/accreditation_standards_controller_test.rb new file mode 100644 index 000000000..dce5acb71 --- /dev/null +++ b/test/controllers/reference/accreditation_standards_controller_test.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +require 'test_helper' +require_relative '../concerns/reference_resource_test' + +class AccreditationStandardsControllerTest < ActionDispatch::IntegrationTest + include ReferenceResourceTest + + setup do + @target_path = 'reference' + @create_params = { name: 'MİAK', version: '1' } + @update_params = { name: 'EPDAD', version: '1' } + end +end diff --git a/test/fixtures/accreditation_standards.yml b/test/fixtures/accreditation_standards.yml new file mode 100644 index 000000000..648bdf287 --- /dev/null +++ b/test/fixtures/accreditation_standards.yml @@ -0,0 +1,9 @@ +fedek: + version: 1 + name: FEDEK +mudek: + version: 1 + name: MÜDEK +accreditation_standard_to_delete: + version: 1 + name: Standard diff --git a/test/models/accreditation_standard_test.rb b/test/models/accreditation_standard_test.rb new file mode 100644 index 000000000..245e14178 --- /dev/null +++ b/test/models/accreditation_standard_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require 'test_helper' + +class AccreditationStandardTest < ActiveSupport::TestCase + extend Support::Minitest::AssociationHelper + extend Support::Minitest::ValidationHelper + + # relations + has_many :standards, dependent: :destroy + + # validations: presence + validates_presence_of :version + validates_presence_of :name + + # validations: length + validates_length_of :version, maximum: 50 + validates_length_of :name, maximum: 255 + + # validations: uniqueness + test 'uniqueness validations for name of a accreditation standard' do + fake = accreditation_standards(:fedek).dup + assert_not fake.valid? + assert_not_empty fake.errors[:name] + end +end diff --git a/test/policies/reference/accreditation_standard_policy_test.rb b/test/policies/reference/accreditation_standard_policy_test.rb new file mode 100644 index 000000000..0ee3e38ee --- /dev/null +++ b/test/policies/reference/accreditation_standard_policy_test.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'pundit_test_case' + +module Reference + class AccreditationStandardPolicyTest < PunditTestCase + %w[ + create? + destroy? + edit? + index? + new? + update? + ].each do |method| + test method do + assert_permit users(:serhat) + assert_not_permit users(:mine) + end + end + end +end From e3be999e810c06449aeb92dffc8577fe94bf6da4 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 15:08:57 +0300 Subject: [PATCH 496/970] Add standard & unit_standard models --- app/models/standard.rb | 15 +++++++++++---- app/models/unit_standard.rb | 11 +++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/app/models/standard.rb b/app/models/standard.rb index dbc041cbb..0b0fbff86 100644 --- a/app/models/standard.rb +++ b/app/models/standard.rb @@ -1,13 +1,20 @@ # frozen_string_literal: true class Standard < ApplicationRecord - # search - include ReferenceSearch + # enums + enum status: { passive: 0, active: 1 } # relations + belongs_to :accreditation_standard + has_many :macro_outcomes, -> { where(parent_id: nil) }, class_name: 'Outcome', inverse_of: :standard + has_many :outcomes, dependent: :destroy has_many :unit_standards, dependent: :destroy + has_many :units, through: :unit_standards # validations - validates :version, presence: true, length: { maximum: 50 } - validates :name, presence: true, uniqueness: { scope: :version }, length: { maximum: 255 } + validates :status, inclusion: { in: statuses.keys } + validates_associated :unit_standards + + # delegates + delegate :name, to: :accreditation_standard end diff --git a/app/models/unit_standard.rb b/app/models/unit_standard.rb index 4b75c000c..43f9464ed 100644 --- a/app/models/unit_standard.rb +++ b/app/models/unit_standard.rb @@ -1,16 +1,11 @@ # frozen_string_literal: true class UnitStandard < ApplicationRecord - # enums - enum status: { passive: 0, active: 1 } - # relations - belongs_to :standard belongs_to :unit - has_many :outcomes, dependent: :destroy - has_many :macro_outcomes, -> { where(parent_id: nil) }, class_name: 'Outcome', inverse_of: :unit_standard + belongs_to :standard # validations - validates :standard, presence: true, uniqueness: { scope: :unit } - validates :status, inclusion: { in: statuses.keys }, uniqueness: { scope: :unit } + validates :standard, uniqueness: { scope: :unit } + validates_with UnitStandardValidator end From d3b70451a1db93c24343cd5ddff6e7281fc4394f Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 15:09:40 +0300 Subject: [PATCH 497/970] Add unit standard validator --- app/validators/unit_standard_validator.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 app/validators/unit_standard_validator.rb diff --git a/app/validators/unit_standard_validator.rb b/app/validators/unit_standard_validator.rb new file mode 100644 index 000000000..ce42bd72e --- /dev/null +++ b/app/validators/unit_standard_validator.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class UnitStandardValidator < ActiveModel::Validator + def validate(record) + @record = record + @standard = record.standard + return unless already_exists? + + @standard.errors.add( + :base, + I18n.t('defined', name: @record&.unit&.name, scope: %i[validators unit_standard]) + ) + end + + def already_exists? + UnitStandard.includes(:standard) + .where.not(id: @record.id) + .where(unit: @record.unit_id, standards: { status: :active }).exists? + end +end From 5d61bfdfc4fc68c771b7f0a9bac821f68e18b51a Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 15:10:38 +0300 Subject: [PATCH 498/970] Add standard controller, policy & routes --- .../standards_controller.rb | 62 +++++++++++++++++++ .../outcome_management/standard_policy.rb | 17 +++++ config/routes/outcome_management.rb | 4 +- 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 app/controllers/outcome_management/standards_controller.rb create mode 100644 app/policies/outcome_management/standard_policy.rb diff --git a/app/controllers/outcome_management/standards_controller.rb b/app/controllers/outcome_management/standards_controller.rb new file mode 100644 index 000000000..45ba7b0f2 --- /dev/null +++ b/app/controllers/outcome_management/standards_controller.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module OutcomeManagement + class StandardsController < ApplicationController + include SearchableModule + + before_action :set_standard, only: %i[show edit update destroy] + before_action :authorized? + + def index + standards = Standard.includes(:accreditation_standard, :unit_standards, :units) + @pagy, @standards = pagy(standards) + end + + def show + @outcomes = @standard.macro_outcomes.ordered + end + + def new + @standard = Standard.new + end + + def edit; end + + def create + @standard = Standard.new(standard_params) + @standard.save ? redirect_with('success') : render(:new) + end + + def update + @standard.update(standard_params) ? redirect_with('success') : render(:edit) + end + + def destroy + message = @standard.destroy ? 'success' : 'error' + redirect_with(message) + end + + def units + @units = params[:term].present? ? Unit.active.faculties.search(params[:term]) : Unit.active.faculties + respond_to :json + end + + private + + def redirect_with(message) + redirect_to standards_path, flash: { info: t(".#{message}") } + end + + def set_standard + @standard = Standard.find(params[:id]) + end + + def authorized? + authorize([:outcome_management, @standard || Standard]) + end + + def standard_params + params.require(:standard).permit(:accreditation_standard_id, :status, unit_ids: []) + end + end +end diff --git a/app/policies/outcome_management/standard_policy.rb b/app/policies/outcome_management/standard_policy.rb new file mode 100644 index 000000000..c8b8e3865 --- /dev/null +++ b/app/policies/outcome_management/standard_policy.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module OutcomeManagement + class StandardPolicy < ApplicationPolicy + include CrudPolicyMethods + + def units? + permitted? :read + end + + private + + def permitted?(*privileges) + user.privilege? :outcome_management, privileges + end + end +end diff --git a/config/routes/outcome_management.rb b/config/routes/outcome_management.rb index a5fb2d8f2..600d0d6e1 100644 --- a/config/routes/outcome_management.rb +++ b/config/routes/outcome_management.rb @@ -1,7 +1,9 @@ # frozen_string_literal: true scope module: :outcome_management do - resources :unit_standards do + resources :standards do resources :outcomes, except: :index + + get :units, on: :collection end end From 756768043386c303003be9ec945d5b672923efc6 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 15:13:35 +0300 Subject: [PATCH 499/970] Add standard views --- .../layouts/shared/menus/_admin.html.erb | 4 +- .../standards/_form.html.erb | 36 ++++++++++ .../standards/_select2.html.erb | 23 ++++++ .../standards/edit.html.erb | 1 + .../standards/index.html.erb | 39 ++++++++++ .../outcome_management/standards/new.html.erb | 1 + .../standards/show.html.erb | 72 +++++++++++++++++++ .../standards/units.json.jbuilder | 10 +++ .../outcome_management/standards.en.yml | 40 +++++++++++ .../outcome_management/standards.tr.yml | 40 +++++++++++ config/locales/validators/en.yml | 2 + config/locales/validators/tr.yml | 2 + 12 files changed, 268 insertions(+), 2 deletions(-) create mode 100644 app/views/outcome_management/standards/_form.html.erb create mode 100644 app/views/outcome_management/standards/_select2.html.erb create mode 100644 app/views/outcome_management/standards/edit.html.erb create mode 100644 app/views/outcome_management/standards/index.html.erb create mode 100644 app/views/outcome_management/standards/new.html.erb create mode 100644 app/views/outcome_management/standards/show.html.erb create mode 100644 app/views/outcome_management/standards/units.json.jbuilder create mode 100644 config/locales/controllers/outcome_management/standards.en.yml create mode 100644 config/locales/controllers/outcome_management/standards.tr.yml diff --git a/app/views/layouts/shared/menus/_admin.html.erb b/app/views/layouts/shared/menus/_admin.html.erb index 0f6a4c74a..3851e263e 100644 --- a/app/views/layouts/shared/menus/_admin.html.erb +++ b/app/views/layouts/shared/menus/_admin.html.erb @@ -65,9 +65,9 @@ <%= fa_icon('dot-circle-o', class: 'nav-icon') %><%= t('.outcome_management') %>
- <%= simple_form_for([@unit_standard, @outcome]) do |f| %> + <%= simple_form_for([@standard, @outcome]) do |f| %>
<%= f.error_notification %> diff --git a/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb b/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb index a8135425a..8d81cb2e0 100644 --- a/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb +++ b/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb @@ -2,7 +2,7 @@
- <%= f.input(:unit_standard_id, as: :hidden, wrapper: false, input_html: { value: @unit_standard.id }) %> + <%= f.input(:standard_id, as: :hidden, wrapper: false, input_html: { value: @standard.id }) %>
<%= f.input :code %>
diff --git a/app/views/outcome_management/outcomes/index.html.erb b/app/views/outcome_management/outcomes/index.html.erb index b65b1deab..bb75ec425 100644 --- a/app/views/outcome_management/outcomes/index.html.erb +++ b/app/views/outcome_management/outcomes/index.html.erb @@ -4,7 +4,7 @@
<%= fa_icon 'align-justify', text: t('.card_header') %>
- <%= link_to_new(t('.new_outcome_link'), new_unit_standard_outcome_path(@unit_standard)) %> + <%= link_to_new(t('.new_outcome_link'), new_standard_outcome_path(@standard)) %>
@@ -21,7 +21,7 @@ <%= outcome.code %> <%= outcome.name %> - <%= link_to_actions[@unit_standard, outcome]) %> + <%= link_to_actions[@standard, outcome]) %> <% end %> diff --git a/app/views/outcome_management/outcomes/show.html.erb b/app/views/outcome_management/outcomes/show.html.erb index 3f64e8b41..67f542e7a 100644 --- a/app/views/outcome_management/outcomes/show.html.erb +++ b/app/views/outcome_management/outcomes/show.html.erb @@ -4,7 +4,7 @@
<%= fa_icon 'dot-circle-o' %><%= @outcome.code %>
- <%= link_to_actions([@unit_standard, @outcome], except: :show) %> + <%= link_to_actions([@standard, @outcome], except: :show) %>
From 6a59b236b488862e26b2730f141a0d9d2d5166c0 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 19 Mar 2020 15:17:16 +0300 Subject: [PATCH 504/970] Add outcome tests --- .../outcomes_controller_test.rb | 26 +++++++++---------- test/fixtures/outcomes.yml | 8 +++--- test/models/outcome_test.rb | 9 ++----- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/test/controllers/outcome_management/outcomes_controller_test.rb b/test/controllers/outcome_management/outcomes_controller_test.rb index 6efe57237..c36a5cca8 100644 --- a/test/controllers/outcome_management/outcomes_controller_test.rb +++ b/test/controllers/outcome_management/outcomes_controller_test.rb @@ -6,52 +6,52 @@ module OutcomeManagement class OutcomesControllerTest < ActionDispatch::IntegrationTest setup do sign_in users(:serhat) - @unit_standard = unit_standards(:one) + @standard = standards(:one) @outcome = outcomes(:one) end test 'should get show' do - get unit_standard_outcome_path(@unit_standard, @outcome) + get standard_outcome_path(@standard, @outcome) assert_response :success end test 'should get new' do - get new_unit_standard_outcome_path(@unit_standard) + get new_standard_outcome_path(@standard) assert_response :success end test 'should create outcome' do assert_difference('Outcome.count', 2) do - post unit_standard_outcomes_path(@unit_standard), params: { + post standard_outcomes_path(@standard), params: { outcome: { code: 'PÇ-3', name: 'Çözme ve uygulayabilme becerisi', micro_outcomes_attributes: { - '0' => { unit_standard_id: @unit_standard.id, code: 'PÇ3-1', name: 'Çözme becerisi' } + '0' => { standard_id: @standard.id, code: 'PÇ3-1', name: 'Çözme becerisi' } } } } end - outcome = @unit_standard.macro_outcomes.last + outcome = @standard.macro_outcomes.last assert_equal 'PÇ-3', outcome.code assert_equal 'Çözme ve uygulayabilme becerisi', outcome.name assert_equal 1, outcome.micro_outcomes.count - assert_redirected_to unit_standard_path(@unit_standard) + assert_redirected_to standard_path(@standard) end test 'should get edit' do - get edit_unit_standard_outcome_path(@unit_standard, @outcome) + get edit_standard_outcome_path(@standard, @outcome) assert_response :success assert_select '.card-header strong', translate('.edit.form_title') end test 'should update outcome' do - patch unit_standard_outcome_path(@unit_standard, @outcome), params: { + patch standard_outcome_path(@standard, @outcome), params: { outcome: { code: 'PÇ1', name: 'Seçme ve uygulama becerisi.', micro_outcomes_attributes: { - '0' => { unit_standard_id: @unit_standard.id, code: 'PÇ1-1', name: 'Seçme becerisi.' } + '0' => { standard_id: @standard.id, code: 'PÇ1-1', name: 'Seçme becerisi.' } } } } @@ -61,16 +61,16 @@ class OutcomesControllerTest < ActionDispatch::IntegrationTest assert_equal 'PÇ1', @outcome.code assert_equal 'Seçme ve uygulama becerisi.', @outcome.name assert_equal 'PÇ1-1', @outcome.micro_outcomes.ordered.first.code - assert_redirected_to unit_standard_path(@unit_standard) + assert_redirected_to standard_path(@standard) assert_equal translate('.update.success'), flash[:info] end test 'should destroy outcome' do assert_difference('Outcome.count', -1) do - delete unit_standard_outcome_path(@unit_standard, @outcome) + delete standard_outcome_path(@standard, @outcome) end - assert_redirected_to unit_standard_path(@unit_standard) + assert_redirected_to standard_path(@standard) assert_equal translate('.destroy.success'), flash[:info] end diff --git a/test/fixtures/outcomes.yml b/test/fixtures/outcomes.yml index 5f1542d55..3f433c39f 100644 --- a/test/fixtures/outcomes.yml +++ b/test/fixtures/outcomes.yml @@ -1,16 +1,16 @@ one: - unit_standard: one + standard: one code: PÇ-1 name: Seçme ve uygulama becerisi two: - unit_standard: one + standard: one code: PÇ-1-1 name: Seçme becerisi three: - unit_standard: one + standard: one code: PÇ-1-2 name: Uygulama becerisi four: - unit_standard: one + standard: one code: PÇ-2 name: Yorumlama becerisi diff --git a/test/models/outcome_test.rb b/test/models/outcome_test.rb index a698fc15a..3dff731af 100644 --- a/test/models/outcome_test.rb +++ b/test/models/outcome_test.rb @@ -7,7 +7,7 @@ class OutcomeTest < ActiveSupport::TestCase extend Support::Minitest::ValidationHelper # relations - belongs_to :unit_standard + belongs_to :standard belongs_to :macro_outcome, class_name: 'Outcome', foreign_key: :parent_id, inverse_of: :micro_outcomes, optional: true has_many :micro_outcomes, class_name: 'Outcome', foreign_key: :parent_id, @@ -29,14 +29,9 @@ class OutcomeTest < ActiveSupport::TestCase assert_not_empty fake.errors[:code] end - # delegates - test 'a outcome reach unit parameter' do - assert outcomes(:one).unit - end - # scopes test 'ordered returns outcomes ordered by code' do - outcomes = unit_standards(:one).macro_outcomes.ordered + outcomes = standards(:one).macro_outcomes.ordered assert_equal outcomes(:one), outcomes.first assert_equal outcomes(:four), outcomes.last end From 0b406ff5ee00b994f5e8c1274f94acb59986f4fa Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 19 Mar 2020 17:21:40 +0300 Subject: [PATCH 505/970] Check whether user have disability or not --- app/models/user.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index cb8b89c79..cd83d265c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -147,6 +147,10 @@ def academic? employees.active.academic.exists? end + def disabled? + !disability_rate.zero? + end + def self.with_most_articles where.not(articles_count: 0).order('articles_count desc').limit(10) end From 0603458e499b71a7070633a51709cdb62396015e Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 19 Mar 2020 17:22:45 +0300 Subject: [PATCH 506/970] WIP:Create scaffold of tuition debt service --- .../debt/tuition/operation/scholarship.rb | 19 ++++++++++++++++++ .../debt/tuition/process/from_abroad.rb | 16 +++++++++++++++ .../tuition/process/secondary_education.rb | 16 +++++++++++++++ app/services/debt/tuition/tuition_debt.rb | 16 +++++++++++++++ app/services/debt/tuition/tuition_handler.rb | 20 +++++++++++++++++++ 5 files changed, 87 insertions(+) create mode 100644 app/services/debt/tuition/operation/scholarship.rb create mode 100644 app/services/debt/tuition/process/from_abroad.rb create mode 100644 app/services/debt/tuition/process/secondary_education.rb create mode 100644 app/services/debt/tuition/tuition_debt.rb create mode 100644 app/services/debt/tuition/tuition_handler.rb diff --git a/app/services/debt/tuition/operation/scholarship.rb b/app/services/debt/tuition/operation/scholarship.rb new file mode 100644 index 000000000..ca2c8460a --- /dev/null +++ b/app/services/debt/tuition/operation/scholarship.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative '../tuition_handler' + +module Debt + module Tuition + module Operation + class Scholarship < TuitionHandler + def compute(params) + params.amount = 0 + end + + def fulfill?(params) + params.student.scholarship? + end + end + end + end +end diff --git a/app/services/debt/tuition/process/from_abroad.rb b/app/services/debt/tuition/process/from_abroad.rb new file mode 100644 index 000000000..5986d87a0 --- /dev/null +++ b/app/services/debt/tuition/process/from_abroad.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require_relative '../tuition_handler' +require_relative '../operation/scholarship' + +module Debt + module Tuition + module Process + class FromAbroad < TuitionHandler + def self.chain + Operation::Scholarship.new + end + end + end + end +end diff --git a/app/services/debt/tuition/process/secondary_education.rb b/app/services/debt/tuition/process/secondary_education.rb new file mode 100644 index 000000000..1eed3ea98 --- /dev/null +++ b/app/services/debt/tuition/process/secondary_education.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require_relative '../tuition_handler' +require_relative '../operation/scholarship' + +module Debt + module Tuition + module Process + class SecondaryEducation < TuitionHandler + def self.chain + Operation::Scholarship.new + end + end + end + end +end diff --git a/app/services/debt/tuition/tuition_debt.rb b/app/services/debt/tuition/tuition_debt.rb new file mode 100644 index 000000000..5d7f558c8 --- /dev/null +++ b/app/services/debt/tuition/tuition_debt.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Debt + module Tuition + class TuitionDebt + attr_reader :student, :user + attr_accessor :amount + + def initialize(student, amount) + @student = student + @user = student.user + @amount = amount + end + end + end +end diff --git a/app/services/debt/tuition/tuition_handler.rb b/app/services/debt/tuition/tuition_handler.rb new file mode 100644 index 000000000..54c5ddf2b --- /dev/null +++ b/app/services/debt/tuition/tuition_handler.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Debt + module Tuition + class TuitionHandler + attr_reader :successor + + def initialize(successor = nil) + @successor = successor + end + + def call(tuition) + return compute(tuition) if fulfill?(tuition) + return successor.call(tuition) if successor + + Rails.logger.info "Any tuition chain operation couldn't possible for #{tuition.user.id_number}." + end + end + end +end From 463f2c8cc24a35502757b28757a12d9f0f5393fa Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 19 Mar 2020 17:28:50 +0300 Subject: [PATCH 507/970] WIP:Add disability process to tuition debt --- .../debt/tuition/operation/disability.rb | 19 +++++++++++++++++++ .../debt/tuition/process/from_abroad.rb | 3 ++- .../tuition/process/secondary_education.rb | 3 ++- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 app/services/debt/tuition/operation/disability.rb diff --git a/app/services/debt/tuition/operation/disability.rb b/app/services/debt/tuition/operation/disability.rb new file mode 100644 index 000000000..582e6484c --- /dev/null +++ b/app/services/debt/tuition/operation/disability.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative '../tuition_handler' + +module Debt + module Tuition + module Operation + class Disability < TuitionHandler + def compute(params) + params.amount -= (params.amount * params.user.disability_rate) / 100 + end + + def fulfill?(params) + params.user.disabled? + end + end + end + end +end diff --git a/app/services/debt/tuition/process/from_abroad.rb b/app/services/debt/tuition/process/from_abroad.rb index 5986d87a0..91356e577 100644 --- a/app/services/debt/tuition/process/from_abroad.rb +++ b/app/services/debt/tuition/process/from_abroad.rb @@ -2,13 +2,14 @@ require_relative '../tuition_handler' require_relative '../operation/scholarship' +require_relative '../operation/disability' module Debt module Tuition module Process class FromAbroad < TuitionHandler def self.chain - Operation::Scholarship.new + Operation::Scholarship.new(Operation::Disability.new) end end end diff --git a/app/services/debt/tuition/process/secondary_education.rb b/app/services/debt/tuition/process/secondary_education.rb index 1eed3ea98..03ef4d8e0 100644 --- a/app/services/debt/tuition/process/secondary_education.rb +++ b/app/services/debt/tuition/process/secondary_education.rb @@ -2,13 +2,14 @@ require_relative '../tuition_handler' require_relative '../operation/scholarship' +require_relative '../operation/disability' module Debt module Tuition module Process class SecondaryEducation < TuitionHandler def self.chain - Operation::Scholarship.new + Operation::Scholarship.new(Operation::Disability.new) end end end From e118938273504eff478a6f42b7f7af58c232e6e4 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Fri, 20 Mar 2020 11:14:35 +0300 Subject: [PATCH 508/970] Add outcome validation --- app/models/outcome.rb | 3 +- app/validators/outcome_validator.rb | 33 +++++++++++++++++++ .../outcomes/_form.html.erb | 9 ----- config/locales/validators/en.yml | 3 ++ config/locales/validators/tr.yml | 3 ++ 5 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 app/validators/outcome_validator.rb diff --git a/app/models/outcome.rb b/app/models/outcome.rb index 093448683..f85c661ed 100644 --- a/app/models/outcome.rb +++ b/app/models/outcome.rb @@ -7,11 +7,12 @@ class Outcome < ApplicationRecord inverse_of: :micro_outcomes, optional: true has_many :micro_outcomes, class_name: 'Outcome', foreign_key: :parent_id, inverse_of: :macro_outcome, dependent: :destroy - accepts_nested_attributes_for :micro_outcomes, allow_destroy: true + accepts_nested_attributes_for :micro_outcomes, reject_if: :all_blank, allow_destroy: true # validations validates :code, presence: true, uniqueness: { scope: :standard_id }, length: { maximum: 10 } validates :name, presence: true, length: { maximum: 255 } + validates_with OutcomeValidator # scopes scope :ordered, -> { order(:code) } diff --git a/app/validators/outcome_validator.rb b/app/validators/outcome_validator.rb new file mode 100644 index 000000000..e4871bef6 --- /dev/null +++ b/app/validators/outcome_validator.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +class OutcomeValidator < ActiveModel::Validator + def validate(record) + @record = record + @micro_outcomes = record.micro_outcomes + @codes = @micro_outcomes.map(&:code).push(record.code) + return if codes_unique? + + add_error_message_to_invalid_records + @record.errors.add(:base, message('invalid_code')) + end + + def codes_unique? + @codes.uniq.size == @codes.size + end + + def add_error_message_to_invalid_records + invalid_codes = @codes.select { |code| @codes.count(code) > 1 }.uniq + + @micro_outcomes.each do |micro_outcome| + micro_outcome.errors.add(:code, message('must_be_uniq')) if invalid_codes.include?(micro_outcome.code) + end + + @record.errors.add(:code, message('must_be_uniq')) if invalid_codes.include?(@record.code) + end + + private + + def message(key) + I18n.t(key, scope: %i[validators outcome]) + end +end diff --git a/app/views/outcome_management/outcomes/_form.html.erb b/app/views/outcome_management/outcomes/_form.html.erb index 474863df5..0fb82c6ed 100644 --- a/app/views/outcome_management/outcomes/_form.html.erb +++ b/app/views/outcome_management/outcomes/_form.html.erb @@ -11,15 +11,6 @@
<%= f.error_notification %> <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> - <% if f.object.errors.any? %> -
    - <% f.object.errors.full_messages.each do |message| %> -
  • - <%= message %> -
  • - <% end %> -
- <% end %>
<%= f.input :code %> diff --git a/config/locales/validators/en.yml b/config/locales/validators/en.yml index 78f6be00b..03bc4ad81 100644 --- a/config/locales/validators/en.yml +++ b/config/locales/validators/en.yml @@ -30,6 +30,9 @@ en: image: not_permitted: '%{mime_type} is not an allowed file type. You can upload files in %{extension_whitelist} formats.' size_not_satisfied: File size is not between the permitted range. You can upload files from minimum %{minimum} KBs to maximum %{maximum} MBs. + outcome: + invalid_code: Multiple outputs have the same code, the code field must be unique. + must_be_uniq: must be unique. prospective_student: unchangeable_variables: The program and academic term of a registered student cannot be changed. position: diff --git a/config/locales/validators/tr.yml b/config/locales/validators/tr.yml index 3e2e5ffd6..4505eace6 100644 --- a/config/locales/validators/tr.yml +++ b/config/locales/validators/tr.yml @@ -30,6 +30,9 @@ tr: image: not_permitted: '%{mime_type} izin verilen bir dosya türü değil. %{extension_whitelist} türlerinde bir dosya yükleyebilirsiniz' size_not_satisfied: Dosya boyutu izin verilen aralıkta değil. Yükleyeceğiniz dosya en az %{minimum} KB, en çok %{maximum} MB boyutunda olabilir. + outcome: + invalid_code: Birden farklı çıktıya aynı kod verilmiş, kod alanı benzersiz olmalıdır. + must_be_uniq: benzersiz olmalıdır. prospective_student: unchangeable_variables: Kayıtlı bir öğrencinin yerleştiği program ve akademik dönemi değiştirilemez. position: From 7a960fa383a73ba5cb7c5a42688868a122a96b2c Mon Sep 17 00:00:00 2001 From: isubas Date: Fri, 20 Mar 2020 11:47:02 +0300 Subject: [PATCH 509/970] Upgrade dependencies --- Gemfile.lock | 100 +++++++++++----------- plugins/support/Gemfile.lock | 130 ++++++++++++++--------------- plugins/tenant/acme/Gemfile.lock | 128 ++++++++++++++-------------- plugins/tenant/common/Gemfile.lock | 130 ++++++++++++++--------------- plugins/tenant/omu/Gemfile.lock | 130 ++++++++++++++--------------- 5 files changed, 309 insertions(+), 309 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6299649bd..de55508cd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -27,58 +27,58 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (6.0.2.1) - actionpack (= 6.0.2.1) + actioncable (6.0.2.2) + actionpack (= 6.0.2.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.2.1) - actionpack (= 6.0.2.1) - activejob (= 6.0.2.1) - activerecord (= 6.0.2.1) - activestorage (= 6.0.2.1) - activesupport (= 6.0.2.1) + actionmailbox (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) mail (>= 2.7.1) - actionmailer (6.0.2.1) - actionpack (= 6.0.2.1) - actionview (= 6.0.2.1) - activejob (= 6.0.2.1) + actionmailer (6.0.2.2) + actionpack (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.2.1) - actionview (= 6.0.2.1) - activesupport (= 6.0.2.1) + actionpack (6.0.2.2) + actionview (= 6.0.2.2) + activesupport (= 6.0.2.2) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.2.1) - actionpack (= 6.0.2.1) - activerecord (= 6.0.2.1) - activestorage (= 6.0.2.1) - activesupport (= 6.0.2.1) + actiontext (6.0.2.2) + actionpack (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) nokogiri (>= 1.8.5) - actionview (6.0.2.1) - activesupport (= 6.0.2.1) + actionview (6.0.2.2) + activesupport (= 6.0.2.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) active_flag (1.5.0) activerecord (>= 5) - activejob (6.0.2.1) - activesupport (= 6.0.2.1) + activejob (6.0.2.2) + activesupport (= 6.0.2.2) globalid (>= 0.3.6) - activemodel (6.0.2.1) - activesupport (= 6.0.2.1) - activerecord (6.0.2.1) - activemodel (= 6.0.2.1) - activesupport (= 6.0.2.1) - activestorage (6.0.2.1) - actionpack (= 6.0.2.1) - activejob (= 6.0.2.1) - activerecord (= 6.0.2.1) + activemodel (6.0.2.2) + activesupport (= 6.0.2.2) + activerecord (6.0.2.2) + activemodel (= 6.0.2.2) + activesupport (= 6.0.2.2) + activestorage (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) marcel (~> 0.3.1) - activesupport (6.0.2.1) + activesupport (6.0.2.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -304,29 +304,29 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.2.1) - actioncable (= 6.0.2.1) - actionmailbox (= 6.0.2.1) - actionmailer (= 6.0.2.1) - actionpack (= 6.0.2.1) - actiontext (= 6.0.2.1) - actionview (= 6.0.2.1) - activejob (= 6.0.2.1) - activemodel (= 6.0.2.1) - activerecord (= 6.0.2.1) - activestorage (= 6.0.2.1) - activesupport (= 6.0.2.1) + rails (6.0.2.2) + actioncable (= 6.0.2.2) + actionmailbox (= 6.0.2.2) + actionmailer (= 6.0.2.2) + actionpack (= 6.0.2.2) + actiontext (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + activemodel (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) bundler (>= 1.3.0) - railties (= 6.0.2.1) + railties (= 6.0.2.2) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) - railties (6.0.2.1) - actionpack (= 6.0.2.1) - activesupport (= 6.0.2.1) + railties (6.0.2.2) + actionpack (= 6.0.2.2) + activesupport (= 6.0.2.2) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) diff --git a/plugins/support/Gemfile.lock b/plugins/support/Gemfile.lock index cdf0d999e..289f40ade 100644 --- a/plugins/support/Gemfile.lock +++ b/plugins/support/Gemfile.lock @@ -7,116 +7,116 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (6.0.1) - actionpack (= 6.0.1) + actioncable (6.0.2.2) + actionpack (= 6.0.2.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.1) - actionpack (= 6.0.1) - activejob (= 6.0.1) - activerecord (= 6.0.1) - activestorage (= 6.0.1) - activesupport (= 6.0.1) + actionmailbox (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) mail (>= 2.7.1) - actionmailer (6.0.1) - actionpack (= 6.0.1) - actionview (= 6.0.1) - activejob (= 6.0.1) + actionmailer (6.0.2.2) + actionpack (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.1) - actionview (= 6.0.1) - activesupport (= 6.0.1) - rack (~> 2.0) + actionpack (6.0.2.2) + actionview (= 6.0.2.2) + activesupport (= 6.0.2.2) + rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.1) - actionpack (= 6.0.1) - activerecord (= 6.0.1) - activestorage (= 6.0.1) - activesupport (= 6.0.1) + actiontext (6.0.2.2) + actionpack (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) nokogiri (>= 1.8.5) - actionview (6.0.1) - activesupport (= 6.0.1) + actionview (6.0.2.2) + activesupport (= 6.0.2.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.0.1) - activesupport (= 6.0.1) + activejob (6.0.2.2) + activesupport (= 6.0.2.2) globalid (>= 0.3.6) - activemodel (6.0.1) - activesupport (= 6.0.1) - activerecord (6.0.1) - activemodel (= 6.0.1) - activesupport (= 6.0.1) - activestorage (6.0.1) - actionpack (= 6.0.1) - activejob (= 6.0.1) - activerecord (= 6.0.1) + activemodel (6.0.2.2) + activesupport (= 6.0.2.2) + activerecord (6.0.2.2) + activemodel (= 6.0.2.2) + activesupport (= 6.0.2.2) + activestorage (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) marcel (~> 0.3.1) - activesupport (6.0.1) + activesupport (6.0.2.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2) - builder (3.2.3) - concurrent-ruby (1.1.5) - crass (1.0.5) + builder (3.2.4) + concurrent-ruby (1.1.6) + crass (1.0.6) erubi (1.9.0) globalid (0.4.2) activesupport (>= 4.2.0) - i18n (1.7.0) + i18n (1.8.2) concurrent-ruby (~> 1.0) - loofah (2.3.1) + loofah (2.4.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) marcel (0.3.3) mimemagic (~> 0.3.2) - method_source (0.9.2) - mimemagic (0.3.3) + method_source (1.0.0) + mimemagic (0.3.4) mini_mime (1.0.2) mini_portile2 (2.4.0) - minitest (5.13.0) + minitest (5.14.0) minitest-focus (1.1.2) minitest (>= 4, < 6) nio4r (2.5.2) - nokogiri (1.10.8) + nokogiri (1.10.9) mini_portile2 (~> 2.4.0) - rack (2.0.8) + rack (2.2.2) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.1) - actioncable (= 6.0.1) - actionmailbox (= 6.0.1) - actionmailer (= 6.0.1) - actionpack (= 6.0.1) - actiontext (= 6.0.1) - actionview (= 6.0.1) - activejob (= 6.0.1) - activemodel (= 6.0.1) - activerecord (= 6.0.1) - activestorage (= 6.0.1) - activesupport (= 6.0.1) + rails (6.0.2.2) + actioncable (= 6.0.2.2) + actionmailbox (= 6.0.2.2) + actionmailer (= 6.0.2.2) + actionpack (= 6.0.2.2) + actiontext (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + activemodel (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) bundler (>= 1.3.0) - railties (= 6.0.1) + railties (= 6.0.2.2) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) - railties (6.0.1) - actionpack (= 6.0.1) - activesupport (= 6.0.1) + railties (6.0.2.2) + actionpack (= 6.0.2.2) + activesupport (= 6.0.2.2) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) - rake (13.0.0) + rake (13.0.1) sprockets (4.0.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -124,14 +124,14 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - thor (0.20.3) + thor (1.0.1) thread_safe (0.3.6) - tzinfo (1.2.5) + tzinfo (1.2.6) thread_safe (~> 0.1) websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) - zeitwerk (2.2.1) + zeitwerk (2.3.0) PLATFORMS ruby diff --git a/plugins/tenant/acme/Gemfile.lock b/plugins/tenant/acme/Gemfile.lock index 7208ece84..b82b97e90 100644 --- a/plugins/tenant/acme/Gemfile.lock +++ b/plugins/tenant/acme/Gemfile.lock @@ -20,116 +20,116 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (6.0.1) - actionpack (= 6.0.1) + actioncable (6.0.2.2) + actionpack (= 6.0.2.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.1) - actionpack (= 6.0.1) - activejob (= 6.0.1) - activerecord (= 6.0.1) - activestorage (= 6.0.1) - activesupport (= 6.0.1) + actionmailbox (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) mail (>= 2.7.1) - actionmailer (6.0.1) - actionpack (= 6.0.1) - actionview (= 6.0.1) - activejob (= 6.0.1) + actionmailer (6.0.2.2) + actionpack (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.1) - actionview (= 6.0.1) - activesupport (= 6.0.1) - rack (~> 2.0) + actionpack (6.0.2.2) + actionview (= 6.0.2.2) + activesupport (= 6.0.2.2) + rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.1) - actionpack (= 6.0.1) - activerecord (= 6.0.1) - activestorage (= 6.0.1) - activesupport (= 6.0.1) + actiontext (6.0.2.2) + actionpack (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) nokogiri (>= 1.8.5) - actionview (6.0.1) - activesupport (= 6.0.1) + actionview (6.0.2.2) + activesupport (= 6.0.2.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.0.1) - activesupport (= 6.0.1) + activejob (6.0.2.2) + activesupport (= 6.0.2.2) globalid (>= 0.3.6) - activemodel (6.0.1) - activesupport (= 6.0.1) - activerecord (6.0.1) - activemodel (= 6.0.1) - activesupport (= 6.0.1) - activestorage (6.0.1) - actionpack (= 6.0.1) - activejob (= 6.0.1) - activerecord (= 6.0.1) + activemodel (6.0.2.2) + activesupport (= 6.0.2.2) + activerecord (6.0.2.2) + activemodel (= 6.0.2.2) + activesupport (= 6.0.2.2) + activestorage (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) marcel (~> 0.3.1) - activesupport (6.0.1) + activesupport (6.0.2.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2) - builder (3.2.3) - concurrent-ruby (1.1.5) - crass (1.0.5) + builder (3.2.4) + concurrent-ruby (1.1.6) + crass (1.0.6) erubi (1.9.0) globalid (0.4.2) activesupport (>= 4.2.0) - i18n (1.7.0) + i18n (1.8.2) concurrent-ruby (~> 1.0) - loofah (2.3.1) + loofah (2.4.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) marcel (0.3.3) mimemagic (~> 0.3.2) - method_source (0.9.2) - mimemagic (0.3.3) + method_source (1.0.0) + mimemagic (0.3.4) mini_mime (1.0.2) mini_portile2 (2.4.0) - minitest (5.13.0) + minitest (5.14.0) minitest-focus (1.1.2) minitest (>= 4, < 6) nio4r (2.5.2) nokogiri (1.10.9) mini_portile2 (~> 2.4.0) - rack (2.0.8) + rack (2.2.2) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.1) - actioncable (= 6.0.1) - actionmailbox (= 6.0.1) - actionmailer (= 6.0.1) - actionpack (= 6.0.1) - actiontext (= 6.0.1) - actionview (= 6.0.1) - activejob (= 6.0.1) - activemodel (= 6.0.1) - activerecord (= 6.0.1) - activestorage (= 6.0.1) - activesupport (= 6.0.1) + rails (6.0.2.2) + actioncable (= 6.0.2.2) + actionmailbox (= 6.0.2.2) + actionmailer (= 6.0.2.2) + actionpack (= 6.0.2.2) + actiontext (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + activemodel (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) bundler (>= 1.3.0) - railties (= 6.0.1) + railties (= 6.0.2.2) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) - railties (6.0.1) - actionpack (= 6.0.1) - activesupport (= 6.0.1) + railties (6.0.2.2) + actionpack (= 6.0.2.2) + activesupport (= 6.0.2.2) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) - rake (13.0.0) + rake (13.0.1) sprockets (4.0.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -138,14 +138,14 @@ GEM activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.4.1) - thor (0.20.3) + thor (1.0.1) thread_safe (0.3.6) - tzinfo (1.2.5) + tzinfo (1.2.6) thread_safe (~> 0.1) websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) - zeitwerk (2.2.1) + zeitwerk (2.3.0) PLATFORMS ruby diff --git a/plugins/tenant/common/Gemfile.lock b/plugins/tenant/common/Gemfile.lock index 7cffc823c..d2358b6b0 100644 --- a/plugins/tenant/common/Gemfile.lock +++ b/plugins/tenant/common/Gemfile.lock @@ -13,116 +13,116 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (6.0.1) - actionpack (= 6.0.1) + actioncable (6.0.2.2) + actionpack (= 6.0.2.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.1) - actionpack (= 6.0.1) - activejob (= 6.0.1) - activerecord (= 6.0.1) - activestorage (= 6.0.1) - activesupport (= 6.0.1) + actionmailbox (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) mail (>= 2.7.1) - actionmailer (6.0.1) - actionpack (= 6.0.1) - actionview (= 6.0.1) - activejob (= 6.0.1) + actionmailer (6.0.2.2) + actionpack (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.1) - actionview (= 6.0.1) - activesupport (= 6.0.1) - rack (~> 2.0) + actionpack (6.0.2.2) + actionview (= 6.0.2.2) + activesupport (= 6.0.2.2) + rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.1) - actionpack (= 6.0.1) - activerecord (= 6.0.1) - activestorage (= 6.0.1) - activesupport (= 6.0.1) + actiontext (6.0.2.2) + actionpack (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) nokogiri (>= 1.8.5) - actionview (6.0.1) - activesupport (= 6.0.1) + actionview (6.0.2.2) + activesupport (= 6.0.2.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.0.1) - activesupport (= 6.0.1) + activejob (6.0.2.2) + activesupport (= 6.0.2.2) globalid (>= 0.3.6) - activemodel (6.0.1) - activesupport (= 6.0.1) - activerecord (6.0.1) - activemodel (= 6.0.1) - activesupport (= 6.0.1) - activestorage (6.0.1) - actionpack (= 6.0.1) - activejob (= 6.0.1) - activerecord (= 6.0.1) + activemodel (6.0.2.2) + activesupport (= 6.0.2.2) + activerecord (6.0.2.2) + activemodel (= 6.0.2.2) + activesupport (= 6.0.2.2) + activestorage (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) marcel (~> 0.3.1) - activesupport (6.0.1) + activesupport (6.0.2.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2) - builder (3.2.3) - concurrent-ruby (1.1.5) - crass (1.0.5) + builder (3.2.4) + concurrent-ruby (1.1.6) + crass (1.0.6) erubi (1.9.0) globalid (0.4.2) activesupport (>= 4.2.0) - i18n (1.7.0) + i18n (1.8.2) concurrent-ruby (~> 1.0) - loofah (2.3.1) + loofah (2.4.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) marcel (0.3.3) mimemagic (~> 0.3.2) - method_source (0.9.2) - mimemagic (0.3.3) + method_source (1.0.0) + mimemagic (0.3.4) mini_mime (1.0.2) mini_portile2 (2.4.0) - minitest (5.13.0) + minitest (5.14.0) minitest-focus (1.1.2) minitest (>= 4, < 6) nio4r (2.5.2) - nokogiri (1.10.8) + nokogiri (1.10.9) mini_portile2 (~> 2.4.0) - rack (2.0.8) + rack (2.2.2) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.1) - actioncable (= 6.0.1) - actionmailbox (= 6.0.1) - actionmailer (= 6.0.1) - actionpack (= 6.0.1) - actiontext (= 6.0.1) - actionview (= 6.0.1) - activejob (= 6.0.1) - activemodel (= 6.0.1) - activerecord (= 6.0.1) - activestorage (= 6.0.1) - activesupport (= 6.0.1) + rails (6.0.2.2) + actioncable (= 6.0.2.2) + actionmailbox (= 6.0.2.2) + actionmailer (= 6.0.2.2) + actionpack (= 6.0.2.2) + actiontext (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + activemodel (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) bundler (>= 1.3.0) - railties (= 6.0.1) + railties (= 6.0.2.2) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) - railties (6.0.1) - actionpack (= 6.0.1) - activesupport (= 6.0.1) + railties (6.0.2.2) + actionpack (= 6.0.2.2) + activesupport (= 6.0.2.2) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) - rake (13.0.0) + rake (13.0.1) sprockets (4.0.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -130,14 +130,14 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - thor (0.20.3) + thor (1.0.1) thread_safe (0.3.6) - tzinfo (1.2.5) + tzinfo (1.2.6) thread_safe (~> 0.1) websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) - zeitwerk (2.2.1) + zeitwerk (2.3.0) PLATFORMS ruby diff --git a/plugins/tenant/omu/Gemfile.lock b/plugins/tenant/omu/Gemfile.lock index f5ffe93af..8a4c88a34 100644 --- a/plugins/tenant/omu/Gemfile.lock +++ b/plugins/tenant/omu/Gemfile.lock @@ -20,116 +20,116 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (6.0.1) - actionpack (= 6.0.1) + actioncable (6.0.2.2) + actionpack (= 6.0.2.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.1) - actionpack (= 6.0.1) - activejob (= 6.0.1) - activerecord (= 6.0.1) - activestorage (= 6.0.1) - activesupport (= 6.0.1) + actionmailbox (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) mail (>= 2.7.1) - actionmailer (6.0.1) - actionpack (= 6.0.1) - actionview (= 6.0.1) - activejob (= 6.0.1) + actionmailer (6.0.2.2) + actionpack (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.1) - actionview (= 6.0.1) - activesupport (= 6.0.1) - rack (~> 2.0) + actionpack (6.0.2.2) + actionview (= 6.0.2.2) + activesupport (= 6.0.2.2) + rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.1) - actionpack (= 6.0.1) - activerecord (= 6.0.1) - activestorage (= 6.0.1) - activesupport (= 6.0.1) + actiontext (6.0.2.2) + actionpack (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) nokogiri (>= 1.8.5) - actionview (6.0.1) - activesupport (= 6.0.1) + actionview (6.0.2.2) + activesupport (= 6.0.2.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.0.1) - activesupport (= 6.0.1) + activejob (6.0.2.2) + activesupport (= 6.0.2.2) globalid (>= 0.3.6) - activemodel (6.0.1) - activesupport (= 6.0.1) - activerecord (6.0.1) - activemodel (= 6.0.1) - activesupport (= 6.0.1) - activestorage (6.0.1) - actionpack (= 6.0.1) - activejob (= 6.0.1) - activerecord (= 6.0.1) + activemodel (6.0.2.2) + activesupport (= 6.0.2.2) + activerecord (6.0.2.2) + activemodel (= 6.0.2.2) + activesupport (= 6.0.2.2) + activestorage (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) marcel (~> 0.3.1) - activesupport (6.0.1) + activesupport (6.0.2.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2) - builder (3.2.3) - concurrent-ruby (1.1.5) - crass (1.0.5) + builder (3.2.4) + concurrent-ruby (1.1.6) + crass (1.0.6) erubi (1.9.0) globalid (0.4.2) activesupport (>= 4.2.0) - i18n (1.7.0) + i18n (1.8.2) concurrent-ruby (~> 1.0) - loofah (2.3.1) + loofah (2.4.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) marcel (0.3.3) mimemagic (~> 0.3.2) - method_source (0.9.2) - mimemagic (0.3.3) + method_source (1.0.0) + mimemagic (0.3.4) mini_mime (1.0.2) mini_portile2 (2.4.0) - minitest (5.13.0) + minitest (5.14.0) minitest-focus (1.1.2) minitest (>= 4, < 6) nio4r (2.5.2) - nokogiri (1.10.8) + nokogiri (1.10.9) mini_portile2 (~> 2.4.0) - rack (2.0.8) + rack (2.2.2) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.1) - actioncable (= 6.0.1) - actionmailbox (= 6.0.1) - actionmailer (= 6.0.1) - actionpack (= 6.0.1) - actiontext (= 6.0.1) - actionview (= 6.0.1) - activejob (= 6.0.1) - activemodel (= 6.0.1) - activerecord (= 6.0.1) - activestorage (= 6.0.1) - activesupport (= 6.0.1) + rails (6.0.2.2) + actioncable (= 6.0.2.2) + actionmailbox (= 6.0.2.2) + actionmailer (= 6.0.2.2) + actionpack (= 6.0.2.2) + actiontext (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + activemodel (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) bundler (>= 1.3.0) - railties (= 6.0.1) + railties (= 6.0.2.2) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) - railties (6.0.1) - actionpack (= 6.0.1) - activesupport (= 6.0.1) + railties (6.0.2.2) + actionpack (= 6.0.2.2) + activesupport (= 6.0.2.2) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) - rake (13.0.0) + rake (13.0.1) sprockets (4.0.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -138,14 +138,14 @@ GEM activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.4.1) - thor (0.20.3) + thor (1.0.1) thread_safe (0.3.6) - tzinfo (1.2.5) + tzinfo (1.2.6) thread_safe (~> 0.1) websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) - zeitwerk (2.2.1) + zeitwerk (2.3.0) PLATFORMS ruby From 142687c99c9afc6dd78f746eb289ac62190471d0 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 20 Mar 2020 14:37:07 +0300 Subject: [PATCH 510/970] Reach units of secondary education --- app/models/unit.rb | 1 + app/models/unit_instruction_type.rb | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/app/models/unit.rb b/app/models/unit.rb index 061410d7a..618c3ec81 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -74,6 +74,7 @@ class Unit < ApplicationRecord scope :partially_passive, -> { where(unit_status: UnitStatus.partially_passive) } scope :programs, -> { where(unit_type: UnitType.program) } scope :research_centers, -> { where(unit_type: UnitType.research_center) } + scope :secondary, -> { where(unit_instruction_type: UnitInstructionType.secondary) } scope :senates, -> { where(unit_type: UnitType.senate) } scope :undergraduate_programs, -> { where(unit_type: UnitType.undergraduate_program) } scope :without_programs, -> { where.not(unit_type: UnitType.program) } diff --git a/app/models/unit_instruction_type.rb b/app/models/unit_instruction_type.rb index 0cbbe9cfd..32c6fc62a 100644 --- a/app/models/unit_instruction_type.rb +++ b/app/models/unit_instruction_type.rb @@ -7,4 +7,10 @@ class UnitInstructionType < ApplicationRecord # relations has_many :units, dependent: :nullify + + # scopes + scope :distance, -> { where(code: 3) } + scope :normal, -> { where(code: 1) } + scope :open, -> { where(code: 4) } + scope :secondary, -> { where(code: 2) } end From db43320de4b33d54684a4691a81618d5538be3cf Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 20 Mar 2020 14:46:11 +0300 Subject: [PATCH 511/970] Add new delegates to unit tuition --- app/models/unit_tuition.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/unit_tuition.rb b/app/models/unit_tuition.rb index 692d47e72..7b45957fb 100644 --- a/app/models/unit_tuition.rb +++ b/app/models/unit_tuition.rb @@ -10,5 +10,5 @@ class UnitTuition < ApplicationRecord validates_with UnitTuitionValidator # delegates - delegate :academic_term, to: :tuition + delegate :academic_term, :fee, :foreign_student_fee, to: :tuition end From 6e74a5471e8b71f193190f10d7c7787e296a86bc Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 20 Mar 2020 15:21:14 +0300 Subject: [PATCH 512/970] Create tuition_debts table --- .../20200320114534_create_tuition_debts.rb | 19 ++++ db/structure.sql | 101 +++++++++++++++++- 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20200320114534_create_tuition_debts.rb diff --git a/db/migrate/20200320114534_create_tuition_debts.rb b/db/migrate/20200320114534_create_tuition_debts.rb new file mode 100644 index 000000000..d1cc178fe --- /dev/null +++ b/db/migrate/20200320114534_create_tuition_debts.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class CreateTuitionDebts < ActiveRecord::Migration[6.0] + def change + create_table :tuition_debts do |t| + t.references :student, null: false, foreign_key: true + t.references :academic_term, null: false, foreign_key: true + t.references :unit_tuition, null: false, foreign_key: true + t.decimal :amount, precision: 8, scale: 3 + t.text :description + + t.timestamps + end + + add_null_constraint :tuition_debts, :amount + add_numericality_constraint :tuition_debts, :amount, greater_than: 0 + add_length_constraint :tuition_debts, :description, less_than_or_equal_to: 65_535 + end +end diff --git a/db/structure.sql b/db/structure.sql index 0f2d32cab..c35ec0abc 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -3400,6 +3400,44 @@ CREATE SEQUENCE public.titles_id_seq ALTER SEQUENCE public.titles_id_seq OWNED BY public.titles.id; +-- +-- Name: tuition_debts; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.tuition_debts ( + id bigint NOT NULL, + student_id bigint NOT NULL, + academic_term_id bigint NOT NULL, + unit_tuition_id bigint NOT NULL, + amount numeric(8,3), + description text, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL, + CONSTRAINT tuition_debts_amount_null CHECK ((amount IS NOT NULL)), + CONSTRAINT tuition_debts_amount_numericality CHECK ((amount > (0)::numeric)), + CONSTRAINT tuition_debts_description_length CHECK ((length(description) <= 65535)) +); + + +-- +-- Name: tuition_debts_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.tuition_debts_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: tuition_debts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.tuition_debts_id_seq OWNED BY public.tuition_debts.id; + + -- -- Name: tuitions; Type: TABLE; Schema: public; Owner: - -- @@ -4373,6 +4411,13 @@ ALTER TABLE ONLY public.students ALTER COLUMN id SET DEFAULT nextval('public.stu ALTER TABLE ONLY public.titles ALTER COLUMN id SET DEFAULT nextval('public.titles_id_seq'::regclass); +-- +-- Name: tuition_debts id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.tuition_debts ALTER COLUMN id SET DEFAULT nextval('public.tuition_debts_id_seq'::regclass); + + -- -- Name: tuitions id; Type: DEFAULT; Schema: public; Owner: - -- @@ -5371,6 +5416,14 @@ ALTER TABLE ONLY public.titles ADD CONSTRAINT titles_pkey PRIMARY KEY (id); +-- +-- Name: tuition_debts tuition_debts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.tuition_debts + ADD CONSTRAINT tuition_debts_pkey PRIMARY KEY (id); + + -- -- Name: tuitions tuitions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -6301,6 +6354,27 @@ CREATE INDEX index_students_on_unit_id ON public.students USING btree (unit_id); CREATE INDEX index_students_on_user_id ON public.students USING btree (user_id); +-- +-- Name: index_tuition_debts_on_academic_term_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_tuition_debts_on_academic_term_id ON public.tuition_debts USING btree (academic_term_id); + + +-- +-- Name: index_tuition_debts_on_student_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_tuition_debts_on_student_id ON public.tuition_debts USING btree (student_id); + + +-- +-- Name: index_tuition_debts_on_unit_tuition_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_tuition_debts_on_unit_tuition_id ON public.tuition_debts USING btree (unit_tuition_id); + + -- -- Name: index_tuitions_on_academic_term_id; Type: INDEX; Schema: public; Owner: - -- @@ -6693,6 +6767,14 @@ ALTER TABLE ONLY public.identities ADD CONSTRAINT fk_rails_5373344100 FOREIGN KEY (user_id) REFERENCES public.users(id); +-- +-- Name: tuition_debts fk_rails_544f94c661; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.tuition_debts + ADD CONSTRAINT fk_rails_544f94c661 FOREIGN KEY (student_id) REFERENCES public.students(id); + + -- -- Name: prospective_students fk_rails_54b90f3e1c; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -6981,6 +7063,14 @@ ALTER TABLE ONLY public.available_courses ADD CONSTRAINT fk_rails_a9099f01f5 FOREIGN KEY (coordinator_id) REFERENCES public.employees(id); +-- +-- Name: tuition_debts fk_rails_aba306a739; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.tuition_debts + ADD CONSTRAINT fk_rails_aba306a739 FOREIGN KEY (academic_term_id) REFERENCES public.academic_terms(id); + + -- -- Name: classrooms fk_rails_b0064b7304; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7229,6 +7319,14 @@ ALTER TABLE ONLY public.available_course_groups ADD CONSTRAINT fk_rails_edbeba9693 FOREIGN KEY (available_course_id) REFERENCES public.available_courses(id); +-- +-- Name: tuition_debts fk_rails_edf549ccde; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.tuition_debts + ADD CONSTRAINT fk_rails_edf549ccde FOREIGN KEY (unit_tuition_id) REFERENCES public.unit_tuitions(id); + + -- -- Name: curriculum_course_groups fk_rails_f0035661f5; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7395,6 +7493,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200215132359'), ('20200217110305'), ('20200310101357'), -('20200317094504'); +('20200317094504'), +('20200320114534'); From 145bcac1eaf4b3373718247e4c0ee641aa526946 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 20 Mar 2020 15:42:35 +0300 Subject: [PATCH 513/970] Create tuition debt model --- app/models/tuition_debt.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 app/models/tuition_debt.rb diff --git a/app/models/tuition_debt.rb b/app/models/tuition_debt.rb new file mode 100644 index 000000000..7231fcbdc --- /dev/null +++ b/app/models/tuition_debt.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class TuitionDebt < ApplicationRecord + # relations + belongs_to :student + belongs_to :academic_term + belongs_to :unit_tuition + + # validations + validates :amount, numericality: { greater_than: 0 } + validates :description, length: { maximum: 65_535 } + validates :student_id, uniqueness: { scope: :academic_term_id } +end From 90bbcd1e2680a45cb4b2bc50dcdd119e9fc59a85 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 20 Mar 2020 15:43:14 +0300 Subject: [PATCH 514/970] Add relations for tuition debts --- app/models/academic_term.rb | 1 + app/models/student.rb | 1 + app/models/unit_tuition.rb | 1 + 3 files changed, 3 insertions(+) diff --git a/app/models/academic_term.rb b/app/models/academic_term.rb index 20052a59b..8ec3f6758 100644 --- a/app/models/academic_term.rb +++ b/app/models/academic_term.rb @@ -12,6 +12,7 @@ class AcademicTerm < ApplicationRecord has_many :registration_documents, dependent: :nullify has_many :semester_registrations, dependent: :nullify has_many :tuitions, dependent: :nullify + has_many :tuition_debts, dependent: :nullify # validations validates :active, inclusion: { in: [true, false] } diff --git a/app/models/student.rb b/app/models/student.rb index 6729013a7..7ff8f11e1 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -24,6 +24,7 @@ class Student < ApplicationRecord has_many :curriculums, through: :unit has_many :semester_registrations, dependent: :destroy has_many :course_enrollments, through: :semester_registrations + has_many :tuition_debts, dependent: :destroy # scopes scope :exceeded, -> { where(exceeded_education_period: true) } diff --git a/app/models/unit_tuition.rb b/app/models/unit_tuition.rb index 7b45957fb..aa25eff36 100644 --- a/app/models/unit_tuition.rb +++ b/app/models/unit_tuition.rb @@ -4,6 +4,7 @@ class UnitTuition < ApplicationRecord # relations belongs_to :unit belongs_to :tuition + has_many :tuition_debts, dependent: :nullify # validations validates :tuition_id, uniqueness: { scope: :unit_id } From 1fd31e1ac4b34ed8b2e0b719331b4de66f7972e5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:36:47 +0000 Subject: [PATCH 515/970] chore(deps): bump aws-sdk-s3 from 1.61.0 to 1.61.1 Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.61.0 to 1.61.1. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6299649bd..8ca96963f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,8 +94,8 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.0.3) - aws-partitions (1.281.0) - aws-sdk-core (3.91.0) + aws-partitions (1.286.0) + aws-sdk-core (3.92.0) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) @@ -103,7 +103,7 @@ GEM aws-sdk-kms (1.30.0) aws-sdk-core (~> 3, >= 3.71.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.61.0) + aws-sdk-s3 (1.61.1) aws-sdk-core (~> 3, >= 3.83.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) From 9ff5bf7a8b9bf6a7a7736eea145466e90a0ebc66 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:37:18 +0000 Subject: [PATCH 516/970] chore(deps): bump pg from 1.2.2 to 1.2.3 Bumps [pg](https://github.com/ged/ruby-pg) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/ged/ruby-pg/releases) - [Changelog](https://github.com/ged/ruby-pg/blob/master/History.rdoc) - [Commits](https://github.com/ged/ruby-pg/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6299649bd..957db0539 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -269,7 +269,7 @@ GEM parallel (1.19.1) parser (2.7.0.4) ast (~> 2.4.0) - pg (1.2.2) + pg (1.2.3) pg_search (2.3.2) activerecord (>= 5.2) activesupport (>= 5.2) From b2de42faf9864dad9f8a29c144c64df8d78d8d38 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:37:51 +0000 Subject: [PATCH 517/970] chore(deps): bump webpacker from 4.2.2 to 5.0.0 Bumps [webpacker](https://github.com/rails/webpacker) from 4.2.2 to 5.0.0. - [Release notes](https://github.com/rails/webpacker/releases) - [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md) - [Commits](https://github.com/rails/webpacker/compare/v4.2.2...v5.0.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6299649bd..04f56decc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -376,6 +376,7 @@ GEM selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) + semantic_range (2.3.0) sidekiq (6.0.5) connection_pool (>= 2.2.2) rack (~> 2.0) @@ -452,10 +453,11 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webpacker (4.2.2) - activesupport (>= 4.2) + webpacker (5.0.0) + activesupport (>= 5.2) rack-proxy (>= 0.6.1) - railties (>= 4.2) + railties (>= 5.2) + semantic_range (>= 2.3.0) websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) From 21bf7c4d236bc7f94af65088cf44850ba24925cc Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:38:21 +0000 Subject: [PATCH 518/970] chore(deps): bump twilio-ruby from 5.31.6 to 5.32.0 Bumps [twilio-ruby](https://github.com/twilio/twilio-ruby) from 5.31.6 to 5.32.0. - [Release notes](https://github.com/twilio/twilio-ruby/releases) - [Changelog](https://github.com/twilio/twilio-ruby/blob/master/CHANGES.md) - [Commits](https://github.com/twilio/twilio-ruby/compare/5.31.6...5.32.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6299649bd..ac0967dad 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -415,7 +415,7 @@ GEM thor (0.20.3) thread_safe (0.3.6) tilt (2.0.10) - twilio-ruby (5.31.6) + twilio-ruby (5.32.0) faraday (~> 1.0.0) jwt (>= 1.5, <= 2.5) nokogiri (>= 1.6, < 2.0) From 6f7c8db7f4d435a39f56c212c67e88eaf3c23e39 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:38:56 +0000 Subject: [PATCH 519/970] chore(deps): bump parser from 2.7.0.4 to 2.7.0.5 Bumps [parser](https://github.com/whitequark/parser) from 2.7.0.4 to 2.7.0.5. - [Release notes](https://github.com/whitequark/parser/releases) - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v2.7.0.4...v2.7.0.5) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6299649bd..7682f4369 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -267,7 +267,7 @@ GEM orm_adapter (0.5.0) pagy (3.7.3) parallel (1.19.1) - parser (2.7.0.4) + parser (2.7.0.5) ast (~> 2.4.0) pg (1.2.2) pg_search (2.3.2) From c5bfce7db9ebe9ec8f6e893ac8c64ba4d2a0fa0f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:39:57 +0000 Subject: [PATCH 520/970] chore(deps): bump sorbet-runtime from 0.5.5439 to 0.5.5460 Bumps [sorbet-runtime](https://github.com/sorbet/sorbet) from 0.5.5439 to 0.5.5460. - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6299649bd..e0bc38ddd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -394,7 +394,7 @@ GEM slack-notifier (2.3.2) smart_properties (1.15.0) smstools (0.2.0) - sorbet-runtime (0.5.5439) + sorbet-runtime (0.5.5460) spring (2.1.0) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) From b5e9083ccf4c0934be397aee20cf640e86a0a0a3 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:40:21 +0000 Subject: [PATCH 521/970] chore(deps): bump aws-sdk-core from 3.91.0 to 3.92.0 Bumps [aws-sdk-core](https://github.com/aws/aws-sdk-ruby) from 3.91.0 to 3.92.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-core/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6299649bd..5c83e4745 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,8 +94,8 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.0.3) - aws-partitions (1.281.0) - aws-sdk-core (3.91.0) + aws-partitions (1.286.0) + aws-sdk-core (3.92.0) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) From 6144cedc82ea45767df58ce08ad8fd4bcc9ade1e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:40:54 +0000 Subject: [PATCH 522/970] chore(deps): bump valid_email2 from 3.1.3 to 3.2.0 Bumps [valid_email2](https://github.com/micke/valid_email2) from 3.1.3 to 3.2.0. - [Release notes](https://github.com/micke/valid_email2/releases) - [Changelog](https://github.com/micke/valid_email2/blob/master/CHANGELOG.md) - [Commits](https://github.com/micke/valid_email2/compare/v3.1.3...v3.2.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6299649bd..e779dde17 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -425,7 +425,7 @@ GEM execjs (>= 0.3.0, < 3) unicode-display_width (1.6.1) uniform_notifier (1.13.0) - valid_email2 (3.1.3) + valid_email2 (3.2.0) activemodel (>= 3.2) mail (~> 2.5) validate_email (0.1.6) From cfd5565bb7a721caf632d253b12a155ab2225bc1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:41:28 +0000 Subject: [PATCH 523/970] chore(deps): bump wicked_pdf from 2.0.1 to 2.0.2 Bumps [wicked_pdf](https://github.com/mileszs/wicked_pdf) from 2.0.1 to 2.0.2. - [Release notes](https://github.com/mileszs/wicked_pdf/releases) - [Changelog](https://github.com/mileszs/wicked_pdf/blob/master/CHANGELOG.md) - [Commits](https://github.com/mileszs/wicked_pdf/compare/2.0.1...2.0.2) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6299649bd..0990cbd80 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -459,7 +459,7 @@ GEM websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) - wicked_pdf (2.0.1) + wicked_pdf (2.0.2) activesupport xpath (3.2.0) nokogiri (~> 1.8) From 738466c5d7b2bad6a3bb58e574ba48a32c81fa8d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:45:02 +0000 Subject: [PATCH 524/970] chore(deps): bump babel-loader from 8.0.6 to 8.1.0 Bumps [babel-loader](https://github.com/babel/babel-loader) from 8.0.6 to 8.1.0. - [Release notes](https://github.com/babel/babel-loader/releases) - [Changelog](https://github.com/babel/babel-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/babel/babel-loader/compare/v8.0.6...v8.1.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 65 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/yarn.lock b/yarn.lock index abc9654ba..83b88a78a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1158,7 +1158,7 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.0, ajv@^6.5.5: version "6.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== @@ -1441,14 +1441,15 @@ babel-eslint@^10.0.3: resolve "^1.12.0" babel-loader@^8.0.6: - version "8.0.6" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.6.tgz#e33bdb6f362b03f4bb141a0c21ab87c501b70dfb" - integrity sha512-4BmWKtBOBm13uoUwd08UwjZlaw3O9GWf456R9j+5YykFZ6LUIjIKLc0zEZf+hauxPOJs96C8k6FvYD09vWzhYw== + version "8.1.0" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.1.0.tgz#c611d5112bd5209abe8b9fa84c3e4da25275f1c3" + integrity sha512-7q7nC1tYOrqvUrN3LQK4GwSk/TQorZSOlO9C+RZDZpODgyN4ZlCqE5q9cDsyWOliN+aU9B4JX01xK9eJXowJLw== dependencies: - find-cache-dir "^2.0.0" - loader-utils "^1.0.2" - mkdirp "^0.5.1" + find-cache-dir "^2.1.0" + loader-utils "^1.4.0" + mkdirp "^0.5.3" pify "^4.0.1" + schema-utils "^2.6.5" babel-plugin-dynamic-import-node@^2.3.0: version "2.3.0" @@ -2858,6 +2859,11 @@ emojis-list@^2.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= +emojis-list@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" + integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== + encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -3367,7 +3373,7 @@ finalhandler@~1.1.2: statuses "~1.5.0" unpipe "~1.0.0" -find-cache-dir@^2.0.0, find-cache-dir@^2.1.0: +find-cache-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== @@ -4772,7 +4778,7 @@ loader-runner@^2.4.0: resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== -loader-utils@1.2.3, loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3: +loader-utils@1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== @@ -4781,6 +4787,15 @@ loader-utils@1.2.3, loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.1. emojis-list "^2.0.0" json5 "^1.0.1" +loader-utils@^1.0.1, loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" + integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== + dependencies: + big.js "^5.2.2" + emojis-list "^3.0.0" + json5 "^1.0.1" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -5141,16 +5156,16 @@ minimatch@^3.0.4, minimatch@~3.0.2, minimatch@~3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.1.3, minimist@^1.2.0: +minimist@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= +minimist@^1.2.0, minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + minipass-collect@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" @@ -5203,12 +5218,12 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -"mkdirp@>=0.5 0", mkdirp@^0.5, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= +"mkdirp@>=0.5 0", mkdirp@^0.5, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.1: + version "0.5.3" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.3.tgz#5a514b7179259287952881e94410ec5465659f8c" + integrity sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg== dependencies: - minimist "0.0.8" + minimist "^1.2.5" moment@^2.10.2: version "2.24.0" @@ -7236,12 +7251,12 @@ schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" -schema-utils@^2.5.0, schema-utils@^2.6.0, schema-utils@^2.6.1, schema-utils@^2.6.4: - version "2.6.4" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.4.tgz#a27efbf6e4e78689d91872ee3ccfa57d7bdd0f53" - integrity sha512-VNjcaUxVnEeun6B2fiiUDjXXBtD4ZSH7pdbfIu1pOFwgptDPLMo/z9jr4sUfsjFVPqDCEin/F7IYlq7/E6yDbQ== +schema-utils@^2.5.0, schema-utils@^2.6.0, schema-utils@^2.6.1, schema-utils@^2.6.4, schema-utils@^2.6.5: + version "2.6.5" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.5.tgz#c758f0a7e624263073d396e29cd40aa101152d8a" + integrity sha512-5KXuwKziQrTVHh8j/Uxz+QUbxkaLW9X/86NBlx/gnKgtsZA2GIVMUn17qWhRFwF8jdYb3Dig5hRO/W5mZqy6SQ== dependencies: - ajv "^6.10.2" + ajv "^6.12.0" ajv-keywords "^3.4.1" scss-tokenizer@^0.2.3: From 4b26947b01bea3711ffce67c18542077085b99d0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:45:52 +0000 Subject: [PATCH 525/970] chore(deps): bump js-base64 from 2.5.1 to 2.5.2 Bumps [js-base64](https://github.com/dankogai/js-base64) from 2.5.1 to 2.5.2. - [Release notes](https://github.com/dankogai/js-base64/releases) - [Commits](https://github.com/dankogai/js-base64/compare/2.5.1...2.5.2) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index abc9654ba..ce740fef9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4565,9 +4565,9 @@ jquery@>=1.12.0, jquery@^3.4.1: integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw== js-base64@^2.1.8: - version "2.5.1" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.1.tgz#1efa39ef2c5f7980bb1784ade4a8af2de3291121" - integrity sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw== + version "2.5.2" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.2.tgz#313b6274dda718f714d00b3330bbae6e38e90209" + integrity sha512-Vg8czh0Q7sFBSUMWWArX/miJeBWYBPpdU/3M/DKSaekLMqrqVPaedp+5mZhie/r0lgrcaYBfwXatEew6gwgiQQ== js-levenshtein@^1.1.3: version "1.1.6" From 844fdf156ee936da1b894ef6277548d4273cfcde Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:46:29 +0000 Subject: [PATCH 526/970] chore(deps): bump fs-minipass from 2.0.0 to 2.1.0 Bumps [fs-minipass](https://github.com/npm/fs-minipass) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/npm/fs-minipass/releases) - [Commits](https://github.com/npm/fs-minipass/compare/v2.0.0...v2.1.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index abc9654ba..3abb496b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3519,9 +3519,9 @@ from2@^2.1.0: readable-stream "^2.0.0" fs-minipass@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.0.0.tgz#a6415edab02fae4b9e9230bc87ee2e4472003cd1" - integrity sha512-40Qz+LFXmd9tzYVnnBmZvFfvAADfUA14TXPK1s7IfElJTIZ97rA8w4Kin7Wt5JBrC3ShnnFJO/5vPjPEeJIq9A== + version "2.1.0" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" + integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== dependencies: minipass "^3.0.0" From d78f015479b0c5626d9015f57711b3d8074d7d38 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:47:41 +0000 Subject: [PATCH 527/970] chore(deps-dev): bump eslint-config-standard from 14.1.0 to 14.1.1 Bumps [eslint-config-standard](https://github.com/standard/eslint-config-standard) from 14.1.0 to 14.1.1. - [Release notes](https://github.com/standard/eslint-config-standard/releases) - [Changelog](https://github.com/standard/eslint-config-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/standard/eslint-config-standard/compare/v14.1.0...v14.1.1) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index be9131765..de7ebf16c 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "devDependencies": { "babel-eslint": "^10.0.3", "eslint": "^6.7.2", - "eslint-config-standard": "^14.1.0", + "eslint-config-standard": "^14.1.1", "eslint-plugin-import": "^2.20.1", "eslint-plugin-node": "^10.0.0", "eslint-plugin-promise": "^4.0.1", diff --git a/yarn.lock b/yarn.lock index abc9654ba..522c0436b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2948,10 +2948,10 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -eslint-config-standard@^14.1.0: - version "14.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-14.1.0.tgz#b23da2b76fe5a2eba668374f246454e7058f15d4" - integrity sha512-EF6XkrrGVbvv8hL/kYa/m6vnvmUT+K82pJJc4JJVMM6+Qgqh0pnwprSxdduDLB9p/7bIxD+YV5O0wfb8lmcPbA== +eslint-config-standard@^14.1.1: + version "14.1.1" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz#830a8e44e7aef7de67464979ad06b406026c56ea" + integrity sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg== eslint-import-resolver-node@^0.3.2: version "0.3.3" From fd5bf8b0f344b7c4c68e6d665683dd10a6901b1e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 00:50:10 +0000 Subject: [PATCH 528/970] chore(deps): bump regjsparser from 0.6.3 to 0.6.4 Bumps [regjsparser](https://github.com/jviereck/regjsparser) from 0.6.3 to 0.6.4. - [Release notes](https://github.com/jviereck/regjsparser/releases) - [Changelog](https://github.com/jviereck/regjsparser/blob/gh-pages/CHANGELOG) - [Commits](https://github.com/jviereck/regjsparser/compare/v0.6.3...v0.6.4) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index abc9654ba..e543154fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6997,9 +6997,9 @@ regjsgen@^0.5.0: integrity sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg== regjsparser@^0.6.0: - version "0.6.3" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.3.tgz#74192c5805d35e9f5ebe3c1fb5b40d40a8a38460" - integrity sha512-8uZvYbnfAtEm9Ab8NTb3hdLwL4g/LQzEYP7Xs27T96abJCCE2d6r3cPZPQEsLKy0vRSGVNG+/zVGtLr86HQduA== + version "0.6.4" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.4.tgz#a769f8684308401a66e9b529d2436ff4d0666272" + integrity sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw== dependencies: jsesc "~0.5.0" From cd2303a5ab7d0b60629c228fa75c14273839ed03 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Mon, 23 Mar 2020 15:45:02 +0300 Subject: [PATCH 529/970] Change sidebar outcomes link name --- app/views/layouts/shared/menus/_admin.html.erb | 2 +- config/locales/layouts/shared/sidebar.en.yml | 2 +- config/locales/layouts/shared/sidebar.tr.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/shared/menus/_admin.html.erb b/app/views/layouts/shared/menus/_admin.html.erb index 3851e263e..5d1e1ce93 100644 --- a/app/views/layouts/shared/menus/_admin.html.erb +++ b/app/views/layouts/shared/menus/_admin.html.erb @@ -62,7 +62,7 @@
+ <%= render 'search' %> diff --git a/config/locales/controllers/outcome_management/standards.en.yml b/config/locales/controllers/outcome_management/standards.en.yml index 099e25217..ed7c846d8 100644 --- a/config/locales/controllers/outcome_management/standards.en.yml +++ b/config/locales/controllers/outcome_management/standards.en.yml @@ -30,6 +30,9 @@ en: new_standard_link: Create a New Unit Standard new: form_title: Create a Unit Standard + search: + <<: *standard_attributes + unit: Program show: <<: *standard_attributes card_header: Learning Outcomes diff --git a/config/locales/controllers/outcome_management/standards.tr.yml b/config/locales/controllers/outcome_management/standards.tr.yml index 0d8ee9cc1..e7f84fad8 100644 --- a/config/locales/controllers/outcome_management/standards.tr.yml +++ b/config/locales/controllers/outcome_management/standards.tr.yml @@ -30,6 +30,9 @@ tr: new_standard_link: Yeni Birim Standardı Oluştur new: form_title: Birim Standardı Oluştur + search: + <<: *standard_attributes + unit: Program show: <<: *standard_attributes card_header: Öğrenim Çıktıları From 79691582afb1f6723205502f50e2a685b19255a4 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 24 Mar 2020 15:34:29 +0300 Subject: [PATCH 533/970] Move version field to standard --- .../standards_controller.rb | 2 +- .../accreditation_standards_controller.rb | 2 +- app/models/accreditation_standard.rb | 3 +-- app/models/standard.rb | 3 ++- .../standards/_form.html.erb | 7 +++-- .../standards/_search.html.erb | 14 +++++++--- .../standards/index.html.erb | 2 ++ .../standards/show.html.erb | 6 ++++- .../accreditation_standards/_form.html.erb | 7 +---- .../accreditation_standards/index.html.erb | 2 +- .../outcome_management/standards.en.yml | 1 + .../outcome_management/standards.tr.yml | 1 + .../reference/accreditation_standards.en.yml | 1 - .../reference/accreditation_standards.tr.yml | 1 - ...19080917_create_accreditation_standards.rb | 5 +--- db/migrate/20200319082359_create_standards.rb | 7 +++++ db/structure.sql | 26 ++++++++++++------- .../standards_controller_test.rb | 2 ++ ...accreditation_standards_controller_test.rb | 4 +-- test/fixtures/accreditation_standards.yml | 3 --- test/fixtures/standards.yml | 1 + test/models/accreditation_standard_test.rb | 2 -- test/models/standard_test.rb | 13 ++++++++++ 23 files changed, 75 insertions(+), 40 deletions(-) diff --git a/app/controllers/outcome_management/standards_controller.rb b/app/controllers/outcome_management/standards_controller.rb index 3af7085c6..40cd3fdce 100644 --- a/app/controllers/outcome_management/standards_controller.rb +++ b/app/controllers/outcome_management/standards_controller.rb @@ -59,7 +59,7 @@ def authorized? end def standard_params - params.require(:standard).permit(:accreditation_standard_id, :status, unit_ids: []) + params.require(:standard).permit(:accreditation_standard_id, :version, :status, unit_ids: []) end end end diff --git a/app/controllers/reference/accreditation_standards_controller.rb b/app/controllers/reference/accreditation_standards_controller.rb index ec63f8596..523a39900 100644 --- a/app/controllers/reference/accreditation_standards_controller.rb +++ b/app/controllers/reference/accreditation_standards_controller.rb @@ -7,7 +7,7 @@ class AccreditationStandardsController < ApplicationController private def secure_params - params.require(:accreditation_standard).permit(:name, :version) + params.require(:accreditation_standard).permit(:name) end end end diff --git a/app/models/accreditation_standard.rb b/app/models/accreditation_standard.rb index ca1312763..5337c7a38 100644 --- a/app/models/accreditation_standard.rb +++ b/app/models/accreditation_standard.rb @@ -8,6 +8,5 @@ class AccreditationStandard < ApplicationRecord has_many :standards, dependent: :destroy # validations - validates :version, presence: true, length: { maximum: 50 } - validates :name, presence: true, uniqueness: { scope: :version }, length: { maximum: 255 } + validates :name, presence: true, uniqueness: true, length: { maximum: 255 } end diff --git a/app/models/standard.rb b/app/models/standard.rb index 29992e53a..4779cbb5f 100644 --- a/app/models/standard.rb +++ b/app/models/standard.rb @@ -5,7 +5,7 @@ class Standard < ApplicationRecord include DynamicSearch # dynamic_search - search_keys :accreditation_standard_id, :status + search_keys :accreditation_standard_id, :version, :status # enums enum status: { passive: 0, active: 1 } @@ -19,6 +19,7 @@ class Standard < ApplicationRecord # validations validates :status, inclusion: { in: statuses.keys } + validates :version, presence: true, uniqueness: { scope: :accreditation_standard_id }, length: { maximum: 50 } validates_associated :unit_standards # delegates diff --git a/app/views/outcome_management/standards/_form.html.erb b/app/views/outcome_management/standards/_form.html.erb index a8dd4799c..84c094825 100644 --- a/app/views/outcome_management/standards/_form.html.erb +++ b/app/views/outcome_management/standards/_form.html.erb @@ -12,14 +12,17 @@ <%= f.error_notification %> <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> -
+
<%= f.input :unit_ids, label: t('units', scope: %i[activerecord attributes standard]), collection: f.object.units, value_method: :id, label_method: :name, input_html: { multiple: 'multiple' }, required: true %>
+
+ <%= f.input :status, collection: enum_options_for_select(f.object.class, :status) %> +
<%= f.association :accreditation_standard %>
- <%= f.input :status, collection: enum_options_for_select(f.object.class, :status), selected: :active %> + <%= f.input :version %>
diff --git a/app/views/outcome_management/standards/_search.html.erb b/app/views/outcome_management/standards/_search.html.erb index d8820ed13..3d2e24f15 100644 --- a/app/views/outcome_management/standards/_search.html.erb +++ b/app/views/outcome_management/standards/_search.html.erb @@ -23,7 +23,7 @@
<%= form_tag standards_path, method: :get do %>
-
+
<%= label_tag(:unit_id, t('.unit')) %> <%= select_tag(:unit_id, options_from_collection_for_select(Unit.active.programs.order(:name), :id, :names_depth_cache, params[:unit_id]), @@ -31,7 +31,7 @@ class: 'form-control', style: 'width: 100%') %>
-
+
<%= label_tag(:accreditation_standard_id, t('.accreditation_standard')) %> <%= select_tag(:accreditation_standard_id, options_from_collection_for_select(AccreditationStandard.order(:name), :id, :name, params[:accreditation_standard_id]), @@ -40,7 +40,15 @@ class: 'form-control', style: 'width: 100%') %>
-
+
+ <%= label_tag(:version, t('.version')) %> + <%= text_field_tag(:version, + params[:version], + include_blank: true, + class: 'form-control', + style: 'width: 100%') %> +
+
<%= label_tag(:status, t('.status')) %> <%= select_tag(:status, options_for_select(enum_options_for_select(Standard, :status), params[:status]), diff --git a/app/views/outcome_management/standards/index.html.erb b/app/views/outcome_management/standards/index.html.erb index edad11001..c5be5b6c5 100644 --- a/app/views/outcome_management/standards/index.html.erb +++ b/app/views/outcome_management/standards/index.html.erb @@ -13,6 +13,7 @@
+ @@ -22,6 +23,7 @@ <% @standards.each do |standard| %> + diff --git a/app/views/outcome_management/standards/show.html.erb b/app/views/outcome_management/standards/show.html.erb index 3fb418ec2..539b52b6b 100644 --- a/app/views/outcome_management/standards/show.html.erb +++ b/app/views/outcome_management/standards/show.html.erb @@ -19,9 +19,13 @@ + + + + - + diff --git a/app/views/reference/accreditation_standards/_form.html.erb b/app/views/reference/accreditation_standards/_form.html.erb index 61c423385..84bcdc5e9 100644 --- a/app/views/reference/accreditation_standards/_form.html.erb +++ b/app/views/reference/accreditation_standards/_form.html.erb @@ -2,14 +2,9 @@ namespace: 'reference', klass: @accreditation_standard, params: [ - { - field: 'version', - width: 6, - required: true - }, { field: 'name', - width: 6, + width: 12, required: true } ] %> diff --git a/app/views/reference/accreditation_standards/index.html.erb b/app/views/reference/accreditation_standards/index.html.erb index 002f5e7c9..5d91098dc 100644 --- a/app/views/reference/accreditation_standards/index.html.erb +++ b/app/views/reference/accreditation_standards/index.html.erb @@ -4,5 +4,5 @@ collection: @accreditation_standards, pagy: @pagy, card_header: t('.card_header'), - params: %w[name], + params: ['name'], actions: %w[edit destroy] %> diff --git a/config/locales/controllers/outcome_management/standards.en.yml b/config/locales/controllers/outcome_management/standards.en.yml index ed7c846d8..29655ab25 100644 --- a/config/locales/controllers/outcome_management/standards.en.yml +++ b/config/locales/controllers/outcome_management/standards.en.yml @@ -3,6 +3,7 @@ en: attributes: standard: &standard_attributes standard: Standard + version: Version status: Status units: Programs enums: diff --git a/config/locales/controllers/outcome_management/standards.tr.yml b/config/locales/controllers/outcome_management/standards.tr.yml index e7f84fad8..7b112f41a 100644 --- a/config/locales/controllers/outcome_management/standards.tr.yml +++ b/config/locales/controllers/outcome_management/standards.tr.yml @@ -3,6 +3,7 @@ tr: attributes: standard: &standard_attributes accreditation_standard: Standart + version: Versiyon status: Durum units: Programlar enums: diff --git a/config/locales/controllers/reference/accreditation_standards.en.yml b/config/locales/controllers/reference/accreditation_standards.en.yml index dbbda6f81..249a4785f 100644 --- a/config/locales/controllers/reference/accreditation_standards.en.yml +++ b/config/locales/controllers/reference/accreditation_standards.en.yml @@ -2,7 +2,6 @@ en: activerecord: attributes: accreditation_standard: &accreditation_standard_attributes - version: Version name: Name helpers: submit: diff --git a/config/locales/controllers/reference/accreditation_standards.tr.yml b/config/locales/controllers/reference/accreditation_standards.tr.yml index 67b431158..03ff186e2 100644 --- a/config/locales/controllers/reference/accreditation_standards.tr.yml +++ b/config/locales/controllers/reference/accreditation_standards.tr.yml @@ -2,7 +2,6 @@ tr: activerecord: attributes: accreditation_standard: &accreditation_standard_attributes - version: Versiyon name: Adı helpers: submit: diff --git a/db/migrate/20200319080917_create_accreditation_standards.rb b/db/migrate/20200319080917_create_accreditation_standards.rb index 295fe47cf..72f28e92d 100644 --- a/db/migrate/20200319080917_create_accreditation_standards.rb +++ b/db/migrate/20200319080917_create_accreditation_standards.rb @@ -3,18 +3,15 @@ class CreateAccreditationStandards < ActiveRecord::Migration[6.0] def change create_table :accreditation_standards do |t| - t.string :version t.string :name t.timestamps end - add_length_constraint :accreditation_standards, :version, less_than_or_equal_to: 50 add_length_constraint :accreditation_standards, :name, less_than_or_equal_to: 255 - add_presence_constraint :accreditation_standards, :version add_presence_constraint :accreditation_standards, :name - add_unique_constraint :accreditation_standards, [:version, :name] + add_unique_constraint :accreditation_standards, :name end end diff --git a/db/migrate/20200319082359_create_standards.rb b/db/migrate/20200319082359_create_standards.rb index 98b6d5708..ab2c67876 100644 --- a/db/migrate/20200319082359_create_standards.rb +++ b/db/migrate/20200319082359_create_standards.rb @@ -4,13 +4,20 @@ class CreateStandards < ActiveRecord::Migration[6.0] def change create_table :standards do |t| t.references :accreditation_standard, foreign_key: true, null: false + t.string :version t.integer :status t.timestamps end + add_length_constraint :standards, :version, less_than_or_equal_to: 50 + + add_presence_constraint :standards, :version + add_null_constraint :standards, :status add_numericality_constraint :standards, :status, greater_than_or_equal_to: 0 + + add_unique_constraint :standards, [:version, :accreditation_standard_id] end end diff --git a/db/structure.sql b/db/structure.sql index 434c10b25..a7065bc81 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -121,14 +121,11 @@ ALTER SEQUENCE public.academic_terms_id_seq OWNED BY public.academic_terms.id; CREATE TABLE public.accreditation_standards ( id bigint NOT NULL, - version character varying, name character varying, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, CONSTRAINT accreditation_standards_name_length CHECK ((length((name)::text) <= 255)), - CONSTRAINT accreditation_standards_name_presence CHECK (((name IS NOT NULL) AND ((name)::text !~ '^\s*$'::text))), - CONSTRAINT accreditation_standards_version_length CHECK ((length((version)::text) <= 50)), - CONSTRAINT accreditation_standards_version_presence CHECK (((version IS NOT NULL) AND ((version)::text !~ '^\s*$'::text))) + CONSTRAINT accreditation_standards_name_presence CHECK (((name IS NOT NULL) AND ((name)::text !~ '^\s*$'::text))) ); @@ -3089,11 +3086,14 @@ ALTER SEQUENCE public.semester_registrations_id_seq OWNED BY public.semester_reg CREATE TABLE public.standards ( id bigint NOT NULL, accreditation_standard_id bigint NOT NULL, + version character varying, status integer, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, CONSTRAINT standards_status_null CHECK ((status IS NOT NULL)), - CONSTRAINT standards_status_numericality CHECK ((status >= 0)) + CONSTRAINT standards_status_numericality CHECK ((status >= 0)), + CONSTRAINT standards_version_length CHECK ((length((version)::text) <= 50)), + CONSTRAINT standards_version_presence CHECK (((version IS NOT NULL) AND ((version)::text !~ '^\s*$'::text))) ); @@ -4628,19 +4628,19 @@ ALTER TABLE ONLY public.academic_terms -- --- Name: accreditation_standards accreditation_standards_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: accreditation_standards accreditation_standards_name_unique; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.accreditation_standards - ADD CONSTRAINT accreditation_standards_pkey PRIMARY KEY (id); + ADD CONSTRAINT accreditation_standards_name_unique UNIQUE (name) DEFERRABLE; -- --- Name: accreditation_standards accreditation_standards_version_name_unique; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: accreditation_standards accreditation_standards_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.accreditation_standards - ADD CONSTRAINT accreditation_standards_version_name_unique UNIQUE (version, name) DEFERRABLE; + ADD CONSTRAINT accreditation_standards_pkey PRIMARY KEY (id); -- @@ -5347,6 +5347,14 @@ ALTER TABLE ONLY public.standards ADD CONSTRAINT standards_pkey PRIMARY KEY (id); +-- +-- Name: standards standards_version_accreditation_standard_id_unique; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.standards + ADD CONSTRAINT standards_version_accreditation_standard_id_unique UNIQUE (version, accreditation_standard_id) DEFERRABLE; + + -- -- Name: student_disability_types student_disability_types_code_unique; Type: CONSTRAINT; Schema: public; Owner: - -- diff --git a/test/controllers/outcome_management/standards_controller_test.rb b/test/controllers/outcome_management/standards_controller_test.rb index 670d8a548..c977b7af4 100644 --- a/test/controllers/outcome_management/standards_controller_test.rb +++ b/test/controllers/outcome_management/standards_controller_test.rb @@ -29,6 +29,7 @@ class StandardsControllerTest < ActionDispatch::IntegrationTest post standards_path, params: { standard: { accreditation_standard_id: accreditation_standards(:fedek).id, + version: '2020', status: :active, unit_ids: [units(:fen_bilgisi_ogretmenligi_programi).id] } @@ -54,6 +55,7 @@ class StandardsControllerTest < ActionDispatch::IntegrationTest patch standard_path(@standard), params: { standard: { accreditation_standard_id: accreditation_standards(:fedek).id, + version: '2020', status: :passive, unit_ids: [units(:bilgisayar_muhendisligi_programi).id] } diff --git a/test/controllers/reference/accreditation_standards_controller_test.rb b/test/controllers/reference/accreditation_standards_controller_test.rb index dce5acb71..97947c355 100644 --- a/test/controllers/reference/accreditation_standards_controller_test.rb +++ b/test/controllers/reference/accreditation_standards_controller_test.rb @@ -8,7 +8,7 @@ class AccreditationStandardsControllerTest < ActionDispatch::IntegrationTest setup do @target_path = 'reference' - @create_params = { name: 'MİAK', version: '1' } - @update_params = { name: 'EPDAD', version: '1' } + @create_params = { name: 'MİAK' } + @update_params = { name: 'EPDAD' } end end diff --git a/test/fixtures/accreditation_standards.yml b/test/fixtures/accreditation_standards.yml index 648bdf287..5d9bec7ce 100644 --- a/test/fixtures/accreditation_standards.yml +++ b/test/fixtures/accreditation_standards.yml @@ -1,9 +1,6 @@ fedek: - version: 1 name: FEDEK mudek: - version: 1 name: MÜDEK accreditation_standard_to_delete: - version: 1 name: Standard diff --git a/test/fixtures/standards.yml b/test/fixtures/standards.yml index bee889448..709105a26 100644 --- a/test/fixtures/standards.yml +++ b/test/fixtures/standards.yml @@ -1,3 +1,4 @@ one: accreditation_standard: mudek status: active + version: 2020 diff --git a/test/models/accreditation_standard_test.rb b/test/models/accreditation_standard_test.rb index 245e14178..035298658 100644 --- a/test/models/accreditation_standard_test.rb +++ b/test/models/accreditation_standard_test.rb @@ -10,11 +10,9 @@ class AccreditationStandardTest < ActiveSupport::TestCase has_many :standards, dependent: :destroy # validations: presence - validates_presence_of :version validates_presence_of :name # validations: length - validates_length_of :version, maximum: 50 validates_length_of :name, maximum: 255 # validations: uniqueness diff --git a/test/models/standard_test.rb b/test/models/standard_test.rb index c040121ce..04613dd65 100644 --- a/test/models/standard_test.rb +++ b/test/models/standard_test.rb @@ -17,8 +17,21 @@ class StandardTest < ActiveSupport::TestCase has_many :unit_standards, dependent: :destroy has_many :units, through: :unit_standards + # validations: presence + validates_presence_of :version + + # validations: length + validates_length_of :version, maximum: 50 + # delegates test 'a standard reach accreditation standard name parameter' do assert standards(:one).send(:name) end + + # validations: uniqueness + test 'uniqueness validations for version of a standard' do + fake = standards(:one).dup + assert_not fake.valid? + assert_not_empty fake.errors[:version] + end end From 546a75b419645d1a9019a9c2cf116b0f5f0cca1f Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 24 Mar 2020 15:36:02 +0300 Subject: [PATCH 534/970] Valid if new record is not active --- app/validators/unit_standard_validator.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/validators/unit_standard_validator.rb b/app/validators/unit_standard_validator.rb index ce42bd72e..7f6f9fdec 100644 --- a/app/validators/unit_standard_validator.rb +++ b/app/validators/unit_standard_validator.rb @@ -4,6 +4,7 @@ class UnitStandardValidator < ActiveModel::Validator def validate(record) @record = record @standard = record.standard + return unless @standard.active? return unless already_exists? @standard.errors.add( From 90bce3e82d57077441adfe9721550c8084864d97 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 26 Mar 2020 10:22:46 +0300 Subject: [PATCH 535/970] Add tuition debt model test --- test/fixtures/tuition_debts.yml | 6 ++++++ test/models/tuition_debt_test.rb | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 test/fixtures/tuition_debts.yml create mode 100644 test/models/tuition_debt_test.rb diff --git a/test/fixtures/tuition_debts.yml b/test/fixtures/tuition_debts.yml new file mode 100644 index 000000000..70d4c37d5 --- /dev/null +++ b/test/fixtures/tuition_debts.yml @@ -0,0 +1,6 @@ +one: + student: john + academic_term: active_term + unit_tuition: one + amount: 2.460,00 + description: Yurtdışından kabul edilen öğrenciler kapsamında borçlandırılma yapılmıştır. diff --git a/test/models/tuition_debt_test.rb b/test/models/tuition_debt_test.rb new file mode 100644 index 000000000..6a465954c --- /dev/null +++ b/test/models/tuition_debt_test.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'test_helper' + +class TuitionDebtTest < ActiveSupport::TestCase + extend Support::Minitest::AssociationHelper + extend Support::Minitest::ValidationHelper + + # relations + belongs_to :student + belongs_to :academic_term + belongs_to :unit_tuition + + # validations + validates_numerical_range :amount, greater_than: 0 + validates_length_of :description, maximum: 65_535 +end From 8d897296840d47995ad660cc6f8c4b71832fbb9f Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 26 Mar 2020 12:34:54 +0300 Subject: [PATCH 536/970] Stay without unique validation until we learn what to be must --- app/models/tuition_debt.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/models/tuition_debt.rb b/app/models/tuition_debt.rb index 7231fcbdc..11d7184ca 100644 --- a/app/models/tuition_debt.rb +++ b/app/models/tuition_debt.rb @@ -9,5 +9,4 @@ class TuitionDebt < ApplicationRecord # validations validates :amount, numericality: { greater_than: 0 } validates :description, length: { maximum: 65_535 } - validates :student_id, uniqueness: { scope: :academic_term_id } end From ce884dfb9a680c22102bde3de7d3c73b3bb29b5a Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 26 Mar 2020 12:39:06 +0300 Subject: [PATCH 537/970] Change paramters of tuition debt service --- app/services/debt/tuition/tuition_debt.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/services/debt/tuition/tuition_debt.rb b/app/services/debt/tuition/tuition_debt.rb index 5d7f558c8..27c82bdd5 100644 --- a/app/services/debt/tuition/tuition_debt.rb +++ b/app/services/debt/tuition/tuition_debt.rb @@ -3,13 +3,15 @@ module Debt module Tuition class TuitionDebt - attr_reader :student, :user + attr_reader :student, :user, :academic_term, :unit_tuition attr_accessor :amount - def initialize(student, amount) + def initialize(student, unit_tuition) @student = student @user = student.user - @amount = amount + @unit_tuition = unit_tuition + @amount = unit_tuition.fee + @academic_term = unit_tuition.academic_term end end end From 83e49cb87b7ddfd5784fa1f3b4acd655edde1b5f Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 26 Mar 2020 12:42:23 +0300 Subject: [PATCH 538/970] WIP: Add creation concern for debt operations --- .../debt/tuition/operation/creation.rb | 23 +++++++++++++++++++ .../debt/tuition/operation/disability.rb | 17 ++++++++++++-- .../debt/tuition/operation/scholarship.rb | 17 ++++++++++++-- app/services/debt/tuition/tuition_handler.rb | 2 +- 4 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 app/services/debt/tuition/operation/creation.rb diff --git a/app/services/debt/tuition/operation/creation.rb b/app/services/debt/tuition/operation/creation.rb new file mode 100644 index 000000000..72f967a82 --- /dev/null +++ b/app/services/debt/tuition/operation/creation.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +require_relative '../tuition_handler' + +module Debt + module Tuition + module Operation + module Creation + include ActiveSupport::Concern + + def create_debt(params, description) + ::TuitionDebt.create( + student: params.student, + academic_term: params.academic_term, + unit_tuition: params.unit_tuition, + amount: params.amount, + description: description + ) + end + end + end + end +end diff --git a/app/services/debt/tuition/operation/disability.rb b/app/services/debt/tuition/operation/disability.rb index 582e6484c..5f81fec97 100644 --- a/app/services/debt/tuition/operation/disability.rb +++ b/app/services/debt/tuition/operation/disability.rb @@ -6,13 +6,26 @@ module Debt module Tuition module Operation class Disability < TuitionHandler - def compute(params) - params.amount -= (params.amount * params.user.disability_rate) / 100 + include Creation + + def operate(params) + compute(params) + create_debt(params, description) end def fulfill?(params) params.user.disabled? end + + private + + def compute(params) + params.amount -= (params.amount * params.user.disability_rate) / 100 + end + + def description + 'Engel durumu göz önünde bulundurularak harç borcu oluşturulmuştur.' + end end end end diff --git a/app/services/debt/tuition/operation/scholarship.rb b/app/services/debt/tuition/operation/scholarship.rb index ca2c8460a..a4885be6b 100644 --- a/app/services/debt/tuition/operation/scholarship.rb +++ b/app/services/debt/tuition/operation/scholarship.rb @@ -6,13 +6,26 @@ module Debt module Tuition module Operation class Scholarship < TuitionHandler - def compute(params) - params.amount = 0 + include Creation + + def operate(params) + compute(params) + create_debt(params, description) end def fulfill?(params) params.student.scholarship? end + + private + + def compute(params) + params.amount = 1 + end + + def description + 'Burslu olduğu sembolik 1 lira borçlandırılmıştır.' + end end end end diff --git a/app/services/debt/tuition/tuition_handler.rb b/app/services/debt/tuition/tuition_handler.rb index 54c5ddf2b..21f50745c 100644 --- a/app/services/debt/tuition/tuition_handler.rb +++ b/app/services/debt/tuition/tuition_handler.rb @@ -10,7 +10,7 @@ def initialize(successor = nil) end def call(tuition) - return compute(tuition) if fulfill?(tuition) + return operate(tuition) if fulfill?(tuition) return successor.call(tuition) if successor Rails.logger.info "Any tuition chain operation couldn't possible for #{tuition.user.id_number}." From 931a0ca00d3efc2b69d3f5572b33fe7e10f4b3a6 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 26 Mar 2020 12:45:20 +0300 Subject: [PATCH 539/970] WIP: create new operation for tuition debt --- .../debt/tuition/operation/no_discount.rb | 27 +++++++++++++++++++ .../debt/tuition/process/from_abroad.rb | 3 ++- .../tuition/process/secondary_education.rb | 3 ++- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 app/services/debt/tuition/operation/no_discount.rb diff --git a/app/services/debt/tuition/operation/no_discount.rb b/app/services/debt/tuition/operation/no_discount.rb new file mode 100644 index 000000000..29bd4eec8 --- /dev/null +++ b/app/services/debt/tuition/operation/no_discount.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require_relative '../tuition_handler' + +module Debt + module Tuition + module Operation + class NoDiscount < TuitionHandler + include Creation + + def operate(params) + create_debt(params, description) + end + + def fulfill?(_params) + true + end + + private + + def description + 'Hiç bir indirim yapılmadan harç borcu oluşturulmuştur.' + end + end + end + end +end diff --git a/app/services/debt/tuition/process/from_abroad.rb b/app/services/debt/tuition/process/from_abroad.rb index 91356e577..4b8d8eb8b 100644 --- a/app/services/debt/tuition/process/from_abroad.rb +++ b/app/services/debt/tuition/process/from_abroad.rb @@ -3,13 +3,14 @@ require_relative '../tuition_handler' require_relative '../operation/scholarship' require_relative '../operation/disability' +require_relative '../operation/no_discount' module Debt module Tuition module Process class FromAbroad < TuitionHandler def self.chain - Operation::Scholarship.new(Operation::Disability.new) + Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) end end end diff --git a/app/services/debt/tuition/process/secondary_education.rb b/app/services/debt/tuition/process/secondary_education.rb index 03ef4d8e0..4cad88f24 100644 --- a/app/services/debt/tuition/process/secondary_education.rb +++ b/app/services/debt/tuition/process/secondary_education.rb @@ -3,13 +3,14 @@ require_relative '../tuition_handler' require_relative '../operation/scholarship' require_relative '../operation/disability' +require_relative '../operation/no_discount' module Debt module Tuition module Process class SecondaryEducation < TuitionHandler def self.chain - Operation::Scholarship.new(Operation::Disability.new) + Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) end end end From 15fc7ad67b1461f86225f1a103e24bb96e815c6a Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 26 Mar 2020 14:44:51 +0300 Subject: [PATCH 540/970] Change accreditation_standard to accreditation_institution --- .../standards_controller.rb | 4 +- ... accreditation_institutions_controller.rb} | 4 +- ...andard.rb => accreditation_institution.rb} | 2 +- app/models/standard.rb | 8 +-- ...rb => accreditation_institution_policy.rb} | 2 +- .../standards/_form.html.erb | 2 +- .../standards/_search.html.erb | 9 ++- .../standards/_select2.html.erb | 2 +- .../standards/index.html.erb | 2 +- .../standards/show.html.erb | 4 +- .../_form.html.erb | 2 +- .../edit.html.erb | 0 .../index.html.erb | 4 +- .../new.html.erb | 0 app/views/reference/dashboard/index.html.erb | 6 +- .../outcome_management/standards.en.yml | 2 +- .../outcome_management/standards.tr.yml | 2 +- .../accreditation_institutions.en.yml | 27 +++++++++ .../accreditation_institutions.tr.yml | 27 +++++++++ .../reference/accreditation_standards.en.yml | 27 --------- .../reference/accreditation_standards.tr.yml | 27 --------- .../controllers/reference/dashboard.en.yml | 2 +- .../controllers/reference/dashboard.tr.yml | 2 +- config/routes/reference.rb | 22 +++---- ...80917_create_accreditation_institutions.rb | 17 ++++++ ...19080917_create_accreditation_standards.rb | 17 ------ db/migrate/20200319082359_create_standards.rb | 4 +- db/structure.sql | 58 +++++++++---------- .../standards_controller_test.rb | 8 +-- ...editation_institutions_controller_test.rb} | 2 +- test/fixtures/accreditation_institutions.yml | 6 ++ test/fixtures/accreditation_standards.yml | 6 -- test/fixtures/standards.yml | 2 +- ...t.rb => accreditation_institution_test.rb} | 6 +- test/models/standard_test.rb | 4 +- ... accreditation_institution_policy_test.rb} | 2 +- 36 files changed, 160 insertions(+), 161 deletions(-) rename app/controllers/reference/{accreditation_standards_controller.rb => accreditation_institutions_controller.rb} (50%) rename app/models/{accreditation_standard.rb => accreditation_institution.rb} (81%) rename app/policies/reference/{accreditation_standard_policy.rb => accreditation_institution_policy.rb} (78%) rename app/views/reference/{accreditation_standards => accreditation_institutions}/_form.html.erb (82%) rename app/views/reference/{accreditation_standards => accreditation_institutions}/edit.html.erb (100%) rename app/views/reference/{accreditation_standards => accreditation_institutions}/index.html.erb (68%) rename app/views/reference/{accreditation_standards => accreditation_institutions}/new.html.erb (100%) create mode 100644 config/locales/controllers/reference/accreditation_institutions.en.yml create mode 100644 config/locales/controllers/reference/accreditation_institutions.tr.yml delete mode 100644 config/locales/controllers/reference/accreditation_standards.en.yml delete mode 100644 config/locales/controllers/reference/accreditation_standards.tr.yml create mode 100644 db/migrate/20200319080917_create_accreditation_institutions.rb delete mode 100644 db/migrate/20200319080917_create_accreditation_standards.rb rename test/controllers/reference/{accreditation_standards_controller_test.rb => accreditation_institutions_controller_test.rb} (77%) create mode 100644 test/fixtures/accreditation_institutions.yml delete mode 100644 test/fixtures/accreditation_standards.yml rename test/models/{accreditation_standard_test.rb => accreditation_institution_test.rb} (69%) rename test/policies/reference/{accreditation_standard_policy_test.rb => accreditation_institution_policy_test.rb} (84%) diff --git a/app/controllers/outcome_management/standards_controller.rb b/app/controllers/outcome_management/standards_controller.rb index 40cd3fdce..72923c734 100644 --- a/app/controllers/outcome_management/standards_controller.rb +++ b/app/controllers/outcome_management/standards_controller.rb @@ -8,7 +8,7 @@ class StandardsController < ApplicationController before_action :authorized? def index - standards = Standard.includes(:accreditation_standard, :unit_standards, :units).where( + standards = Standard.includes(:accreditation_institution, :unit_standards, :units).where( params[:unit_id].present? ? { unit_standards: { unit_id: params[:unit_id] } } : {} ) @@ -59,7 +59,7 @@ def authorized? end def standard_params - params.require(:standard).permit(:accreditation_standard_id, :version, :status, unit_ids: []) + params.require(:standard).permit(:accreditation_institution_id, :version, :status, unit_ids: []) end end end diff --git a/app/controllers/reference/accreditation_standards_controller.rb b/app/controllers/reference/accreditation_institutions_controller.rb similarity index 50% rename from app/controllers/reference/accreditation_standards_controller.rb rename to app/controllers/reference/accreditation_institutions_controller.rb index 523a39900..86a120448 100644 --- a/app/controllers/reference/accreditation_standards_controller.rb +++ b/app/controllers/reference/accreditation_institutions_controller.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true module Reference - class AccreditationStandardsController < ApplicationController + class AccreditationInstitutionsController < ApplicationController include ReferenceResource private def secure_params - params.require(:accreditation_standard).permit(:name) + params.require(:accreditation_institution).permit(:name) end end end diff --git a/app/models/accreditation_standard.rb b/app/models/accreditation_institution.rb similarity index 81% rename from app/models/accreditation_standard.rb rename to app/models/accreditation_institution.rb index 5337c7a38..a87110509 100644 --- a/app/models/accreditation_standard.rb +++ b/app/models/accreditation_institution.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class AccreditationStandard < ApplicationRecord +class AccreditationInstitution < ApplicationRecord # search include ReferenceSearch diff --git a/app/models/standard.rb b/app/models/standard.rb index 4779cbb5f..72e1f82ba 100644 --- a/app/models/standard.rb +++ b/app/models/standard.rb @@ -5,13 +5,13 @@ class Standard < ApplicationRecord include DynamicSearch # dynamic_search - search_keys :accreditation_standard_id, :version, :status + search_keys :accreditation_institution_id, :version, :status # enums enum status: { passive: 0, active: 1 } # relations - belongs_to :accreditation_standard + belongs_to :accreditation_institution has_many :macro_outcomes, -> { where(parent_id: nil) }, class_name: 'Outcome', inverse_of: :standard has_many :outcomes, dependent: :destroy has_many :unit_standards, dependent: :destroy @@ -19,9 +19,9 @@ class Standard < ApplicationRecord # validations validates :status, inclusion: { in: statuses.keys } - validates :version, presence: true, uniqueness: { scope: :accreditation_standard_id }, length: { maximum: 50 } + validates :version, presence: true, uniqueness: { scope: :accreditation_institution_id }, length: { maximum: 50 } validates_associated :unit_standards # delegates - delegate :name, to: :accreditation_standard + delegate :name, to: :accreditation_institution end diff --git a/app/policies/reference/accreditation_standard_policy.rb b/app/policies/reference/accreditation_institution_policy.rb similarity index 78% rename from app/policies/reference/accreditation_standard_policy.rb rename to app/policies/reference/accreditation_institution_policy.rb index 3086f14eb..22104e7db 100644 --- a/app/policies/reference/accreditation_standard_policy.rb +++ b/app/policies/reference/accreditation_institution_policy.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Reference - class AccreditationStandardPolicy < ApplicationPolicy + class AccreditationInstitutionPolicy < ApplicationPolicy include CrudPolicyMethods undef :show? diff --git a/app/views/outcome_management/standards/_form.html.erb b/app/views/outcome_management/standards/_form.html.erb index 84c094825..c75de0616 100644 --- a/app/views/outcome_management/standards/_form.html.erb +++ b/app/views/outcome_management/standards/_form.html.erb @@ -19,7 +19,7 @@ <%= f.input :status, collection: enum_options_for_select(f.object.class, :status) %>
- <%= f.association :accreditation_standard %> + <%= f.association :accreditation_institution %>
<%= f.input :version %> diff --git a/app/views/outcome_management/standards/_search.html.erb b/app/views/outcome_management/standards/_search.html.erb index 3d2e24f15..91a217618 100644 --- a/app/views/outcome_management/standards/_search.html.erb +++ b/app/views/outcome_management/standards/_search.html.erb @@ -32,10 +32,9 @@ style: 'width: 100%') %>
- <%= label_tag(:accreditation_standard_id, t('.accreditation_standard')) %> - <%= select_tag(:accreditation_standard_id, - options_from_collection_for_select(AccreditationStandard.order(:name), :id, :name, params[:accreditation_standard_id]), - collection: AccreditationStandard.all, + <%= label_tag(:accreditation_institution_id, t('.accreditation_institution')) %> + <%= select_tag(:accreditation_institution_id, + options_from_collection_for_select(AccreditationInstitution.order(:name), :id, :name, params[:accreditation_institution_id]), include_blank: true, class: 'form-control', style: 'width: 100%') %> @@ -70,6 +69,6 @@ diff --git a/app/views/outcome_management/standards/_select2.html.erb b/app/views/outcome_management/standards/_select2.html.erb index 19b44843d..43fe4cb6e 100644 --- a/app/views/outcome_management/standards/_select2.html.erb +++ b/app/views/outcome_management/standards/_select2.html.erb @@ -1,6 +1,6 @@ diff --git a/app/views/tuition_management/tuition_debts/index.html.erb b/app/views/tuition_management/tuition_debts/index.html.erb index 9f978d36d..052067775 100644 --- a/app/views/tuition_management/tuition_debts/index.html.erb +++ b/app/views/tuition_management/tuition_debts/index.html.erb @@ -4,7 +4,7 @@
<%= fa_icon 'money', text: t('.card_header') %>
- + <%= link_to_new(t('.add_bulk_tuition_debt'), new_tuition_debt_path(type: 'bulk')) %>
@@ -36,4 +36,3 @@
- diff --git a/app/views/tuition_management/tuition_debts/new.html.erb b/app/views/tuition_management/tuition_debts/new.html.erb new file mode 100644 index 000000000..17888142a --- /dev/null +++ b/app/views/tuition_management/tuition_debts/new.html.erb @@ -0,0 +1,2 @@ +<%= render 'form_bulk', form_title: t('.form_bulk_title') %> + diff --git a/config/locales/controllers/tuition_management/tuition_debts.en.yml b/config/locales/controllers/tuition_management/tuition_debts.en.yml index 5136acba1..d6de39fe7 100644 --- a/config/locales/controllers/tuition_management/tuition_debts.en.yml +++ b/config/locales/controllers/tuition_management/tuition_debts.en.yml @@ -10,9 +10,13 @@ en: unit_ids: Units tuition_management: tuition_debts: + create_with_service: + will_update: Tuition debts will be created in a couple of seconds/minutes. destroy: success: Tuition debt successfully deleted. warning: Tuition debt can not be deleted! + form_bulk: + create_tuition_debts: Create Tuition Debts index: <<: *tuition_debt_attributes add_bulk_tuition_debt: Add Bulk Tuition Debt diff --git a/config/locales/controllers/tuition_management/tuition_debts.tr.yml b/config/locales/controllers/tuition_management/tuition_debts.tr.yml index ddaa3a321..e86853e3b 100644 --- a/config/locales/controllers/tuition_management/tuition_debts.tr.yml +++ b/config/locales/controllers/tuition_management/tuition_debts.tr.yml @@ -10,9 +10,13 @@ tr: unit_ids: Birimler tuition_management: tuition_debts: + create_with_service: + will_update: Harç borçları bir kaç saniye/dakika içerisinde oluşturulacaktır. destroy: success: Harç borcu silindi warning: Harç borcu silinemedi! + form_bulk: + create_tuition_debts: Harç Borçlarını Oluştur index: <<: *tuition_debt_attributes add_bulk_tuition_debt: Toplu Harç Borcu Ekle diff --git a/config/routes/tuition_management.rb b/config/routes/tuition_management.rb index 96d84ed1e..dc358ec3d 100644 --- a/config/routes/tuition_management.rb +++ b/config/routes/tuition_management.rb @@ -4,5 +4,7 @@ resources :tuitions, except: :show do get :units, on: :collection end - resources :tuition_debts, only: %i[index destroy] + resources :tuition_debts, only: %i[index new destroy] do + post :create_with_service, on: :collection + end end From ed0f33604220da18041dbf920895763f1fd8657e Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 31 Mar 2020 15:07:40 +0300 Subject: [PATCH 559/970] Check whether instruction type of unit is evening or not --- app/models/unit.rb | 6 +++++- app/models/unit_instruction_type.rb | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/models/unit.rb b/app/models/unit.rb index 618c3ec81..32230a16b 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -66,6 +66,7 @@ class Unit < ApplicationRecord scope :administratives, -> { where(unit_type: UnitType.administrative) } scope :committees, -> { where(unit_type: UnitType.committee) } scope :departments, -> { where(unit_type: UnitType.department) } + scope :evenings, -> { where(unit_instruction_type: UnitInstructionType.evening) } scope :faculties, -> { where(unit_type: UnitType.faculty) } scope :graduate_programs, -> { where(unit_type: UnitType.graduate_program) } scope :institutes, -> { where(unit_type: UnitType.institute) } @@ -74,7 +75,6 @@ class Unit < ApplicationRecord scope :partially_passive, -> { where(unit_status: UnitStatus.partially_passive) } scope :programs, -> { where(unit_type: UnitType.program) } scope :research_centers, -> { where(unit_type: UnitType.research_center) } - scope :secondary, -> { where(unit_instruction_type: UnitInstructionType.secondary) } scope :senates, -> { where(unit_type: UnitType.senate) } scope :undergraduate_programs, -> { where(unit_type: UnitType.undergraduate_program) } scope :without_programs, -> { where.not(unit_type: UnitType.program) } @@ -126,6 +126,10 @@ def program? UnitType.program.ids.include?(unit_type_id) end + def evening? + Unit.evenings.ids.include?(id) + end + # custom methods def subprograms descendants.programs diff --git a/app/models/unit_instruction_type.rb b/app/models/unit_instruction_type.rb index 32c6fc62a..cf74f0d62 100644 --- a/app/models/unit_instruction_type.rb +++ b/app/models/unit_instruction_type.rb @@ -9,8 +9,8 @@ class UnitInstructionType < ApplicationRecord has_many :units, dependent: :nullify # scopes + scope :daytime, -> { where(code: 1) } scope :distance, -> { where(code: 3) } - scope :normal, -> { where(code: 1) } + scope :evening, -> { where(code: 2) } scope :open, -> { where(code: 4) } - scope :secondary, -> { where(code: 2) } end From 8e67ad4f96f5f4f4e2e193cc0c5fcb6c3a1bd741 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 31 Mar 2020 15:16:38 +0300 Subject: [PATCH 560/970] Change process name --- app/services/debt/tuition/operation/creation.rb | 2 -- .../process/{secondary_education.rb => evening_education.rb} | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) rename app/services/debt/tuition/process/{secondary_education.rb => evening_education.rb} (89%) diff --git a/app/services/debt/tuition/operation/creation.rb b/app/services/debt/tuition/operation/creation.rb index 72f967a82..aafc3bf91 100644 --- a/app/services/debt/tuition/operation/creation.rb +++ b/app/services/debt/tuition/operation/creation.rb @@ -6,8 +6,6 @@ module Debt module Tuition module Operation module Creation - include ActiveSupport::Concern - def create_debt(params, description) ::TuitionDebt.create( student: params.student, diff --git a/app/services/debt/tuition/process/secondary_education.rb b/app/services/debt/tuition/process/evening_education.rb similarity index 89% rename from app/services/debt/tuition/process/secondary_education.rb rename to app/services/debt/tuition/process/evening_education.rb index 4cad88f24..c30ffc0de 100644 --- a/app/services/debt/tuition/process/secondary_education.rb +++ b/app/services/debt/tuition/process/evening_education.rb @@ -8,7 +8,7 @@ module Debt module Tuition module Process - class SecondaryEducation < TuitionHandler + class EveningEducation < TuitionHandler def self.chain Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) end From 413a8df4de88afe1033fa4bbb112f5f53a77553b Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 31 Mar 2020 15:18:28 +0300 Subject: [PATCH 561/970] Add process for daytime education --- .../debt/tuition/process/daytime_education.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/services/debt/tuition/process/daytime_education.rb diff --git a/app/services/debt/tuition/process/daytime_education.rb b/app/services/debt/tuition/process/daytime_education.rb new file mode 100644 index 000000000..aea4dce43 --- /dev/null +++ b/app/services/debt/tuition/process/daytime_education.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require_relative '../tuition_handler' +require_relative '../operation/scholarship' +require_relative '../operation/disability' +require_relative '../operation/no_discount' + +module Debt + module Tuition + module Process + class DaytimeEducation < TuitionHandler + def self.chain + Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) + end + end + end + end +end From c690b3df03553df8e46c31d15369fdb9c82200b0 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 31 Mar 2020 16:37:54 +0300 Subject: [PATCH 562/970] Remove inherite connection from processes --- app/services/debt/tuition/process/daytime_education.rb | 3 +-- app/services/debt/tuition/process/evening_education.rb | 3 +-- app/services/debt/tuition/process/from_abroad.rb | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/services/debt/tuition/process/daytime_education.rb b/app/services/debt/tuition/process/daytime_education.rb index aea4dce43..411b0efd1 100644 --- a/app/services/debt/tuition/process/daytime_education.rb +++ b/app/services/debt/tuition/process/daytime_education.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require_relative '../tuition_handler' require_relative '../operation/scholarship' require_relative '../operation/disability' require_relative '../operation/no_discount' @@ -8,7 +7,7 @@ module Debt module Tuition module Process - class DaytimeEducation < TuitionHandler + class DaytimeEducation def self.chain Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) end diff --git a/app/services/debt/tuition/process/evening_education.rb b/app/services/debt/tuition/process/evening_education.rb index c30ffc0de..dc65161f6 100644 --- a/app/services/debt/tuition/process/evening_education.rb +++ b/app/services/debt/tuition/process/evening_education.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require_relative '../tuition_handler' require_relative '../operation/scholarship' require_relative '../operation/disability' require_relative '../operation/no_discount' @@ -8,7 +7,7 @@ module Debt module Tuition module Process - class EveningEducation < TuitionHandler + class EveningEducation def self.chain Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) end diff --git a/app/services/debt/tuition/process/from_abroad.rb b/app/services/debt/tuition/process/from_abroad.rb index 4b8d8eb8b..d6ff35659 100644 --- a/app/services/debt/tuition/process/from_abroad.rb +++ b/app/services/debt/tuition/process/from_abroad.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require_relative '../tuition_handler' require_relative '../operation/scholarship' require_relative '../operation/disability' require_relative '../operation/no_discount' @@ -8,7 +7,7 @@ module Debt module Tuition module Process - class FromAbroad < TuitionHandler + class FromAbroad def self.chain Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) end From 0d4caa75d7a68b379ff86b3eb1178b9f6c4bae49 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 31 Mar 2020 16:38:17 +0300 Subject: [PATCH 563/970] Refactor tuition debt job --- app/jobs/debt/tuition_debt_job.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/jobs/debt/tuition_debt_job.rb b/app/jobs/debt/tuition_debt_job.rb index d93dfc6de..ec7a6deb6 100644 --- a/app/jobs/debt/tuition_debt_job.rb +++ b/app/jobs/debt/tuition_debt_job.rb @@ -5,19 +5,29 @@ class TuitionDebtJob < ApplicationJob queue_as :high def perform(unit_ids, term_id) - @chain = Debt::Tuition::Process::SecondaryEducation.chain @units = Unit.find(unit_ids.reject(&:empty?)) @term_id = term_id end after_perform do |debt| [@units].flatten.compact.each do |unit| + chain = set_chain(unit) unit.students.active.each do |student| tuition = unit.tuitions.find_by(academic_term_id: @term_id) debt = Debt::Tuition::TuitionDebt.new(student, tuition.unit_tuitions.first) - @chain.call(debt) + chain.call(debt) end end end + + # rubocop:disable Naming/AccessorMethodName + def set_chain(unit) + if unit.evening? + Debt::Tuition::Process::EveningEducation.chain + else + Debt::Tuition::Process::DaytimeEducation.chain + end + end + # rubocop:enable Naming/AccessorMethodName end end From e9005217075c9aca9e1de2f48c96719c9ad89f2f Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 31 Mar 2020 17:21:02 +0300 Subject: [PATCH 564/970] Configure daytime process for condition of exceeded education period --- app/jobs/debt/tuition_debt_job.rb | 12 +++++------- .../debt/tuition/process/daytime_education.rb | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/app/jobs/debt/tuition_debt_job.rb b/app/jobs/debt/tuition_debt_job.rb index ec7a6deb6..b5229c2e4 100644 --- a/app/jobs/debt/tuition_debt_job.rb +++ b/app/jobs/debt/tuition_debt_job.rb @@ -5,29 +5,27 @@ class TuitionDebtJob < ApplicationJob queue_as :high def perform(unit_ids, term_id) - @units = Unit.find(unit_ids.reject(&:empty?)) + @units = Unit.find(unit_ids.reject(&:empty?)) @term_id = term_id end after_perform do |debt| [@units].flatten.compact.each do |unit| - chain = set_chain(unit) unit.students.active.each do |student| + chain = set_chain(unit, student) tuition = unit.tuitions.find_by(academic_term_id: @term_id) - debt = Debt::Tuition::TuitionDebt.new(student, tuition.unit_tuitions.first) + debt = Debt::Tuition::TuitionDebt.new(student, tuition.unit_tuitions.first) chain.call(debt) end end end - # rubocop:disable Naming/AccessorMethodName - def set_chain(unit) + def set_chain(unit, student) if unit.evening? Debt::Tuition::Process::EveningEducation.chain else - Debt::Tuition::Process::DaytimeEducation.chain + Debt::Tuition::Process::DaytimeEducation.new(student).chain end end - # rubocop:enable Naming/AccessorMethodName end end diff --git a/app/services/debt/tuition/process/daytime_education.rb b/app/services/debt/tuition/process/daytime_education.rb index 411b0efd1..fb73f85b0 100644 --- a/app/services/debt/tuition/process/daytime_education.rb +++ b/app/services/debt/tuition/process/daytime_education.rb @@ -8,8 +8,20 @@ module Debt module Tuition module Process class DaytimeEducation - def self.chain - Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) + attr_reader :student + + delegate :exceeded_education_period, to: :student + + def initialize(student) + @student = student + end + + def chain + if student.exceeded_education_period + Operation::Disability.new(Operation::NoDiscount.new) + else + Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) + end end end end From 7c2389237105b5167a329c755317bf5ada28edf9 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 1 Apr 2020 22:10:49 +0300 Subject: [PATCH 565/970] Change outcome to learning_outcome --- .../accreditation_standards_controller.rb | 2 +- ...ler.rb => learning_outcomes_controller.rb} | 24 ++-- app/models/accreditation_standard.rb | 4 +- .../{outcome.rb => learning_outcome.rb} | 8 +- ...e_policy.rb => learning_outcome_policy.rb} | 2 +- ...dator.rb => learning_outcome_validator.rb} | 4 +- .../layouts/shared/menus/_admin.html.erb | 2 +- .../accreditation_standards/show.html.erb | 18 +-- .../_form.html.erb | 4 +- .../_micro_outcome_fields.html.erb | 0 .../learning_outcomes/edit.html.erb | 1 + .../index.html.erb | 10 +- .../learning_outcomes/new.html.erb | 1 + .../show.html.erb | 10 +- .../outcome_management/outcomes/edit.html.erb | 1 - .../outcome_management/outcomes/new.html.erb | 1 - .../accreditation_standards.en.yml | 6 +- .../accreditation_standards.tr.yml | 6 +- ...tcomes.en.yml => learning_outcomes.en.yml} | 8 +- ...tcomes.tr.yml => learning_outcomes.tr.yml} | 8 +- config/locales/layouts/shared/sidebar.en.yml | 2 +- config/locales/layouts/shared/sidebar.tr.yml | 2 +- config/locales/validators/en.yml | 2 +- config/locales/validators/tr.yml | 2 +- config/routes/outcome_management.rb | 2 +- ...20200319090221_create_learning_outcomes.rb | 20 +++ db/migrate/20200319090221_create_outcomes.rb | 20 --- db/structure.sql | 128 +++++++++--------- .../learning_outcomes_controller_test.rb | 83 ++++++++++++ .../outcomes_controller_test.rb | 83 ------------ .../{outcomes.yml => learning_outcomes.yml} | 0 test/models/accreditation_standard_test.rb | 4 +- ...tcome_test.rb => learning_outcome_test.rb} | 18 +-- ...est.rb => learning_outcome_policy_test.rb} | 2 +- 34 files changed, 244 insertions(+), 244 deletions(-) rename app/controllers/outcome_management/{outcomes_controller.rb => learning_outcomes_controller.rb} (50%) rename app/models/{outcome.rb => learning_outcome.rb} (69%) rename app/policies/outcome_management/{outcome_policy.rb => learning_outcome_policy.rb} (81%) rename app/validators/{outcome_validator.rb => learning_outcome_validator.rb} (87%) rename app/views/outcome_management/{outcomes => learning_outcomes}/_form.html.erb (95%) rename app/views/outcome_management/{outcomes => learning_outcomes}/_micro_outcome_fields.html.erb (100%) create mode 100644 app/views/outcome_management/learning_outcomes/edit.html.erb rename app/views/outcome_management/{outcomes => learning_outcomes}/index.html.erb (72%) create mode 100644 app/views/outcome_management/learning_outcomes/new.html.erb rename app/views/outcome_management/{outcomes => learning_outcomes}/show.html.erb (76%) delete mode 100644 app/views/outcome_management/outcomes/edit.html.erb delete mode 100644 app/views/outcome_management/outcomes/new.html.erb rename config/locales/controllers/outcome_management/{outcomes.en.yml => learning_outcomes.en.yml} (84%) rename config/locales/controllers/outcome_management/{outcomes.tr.yml => learning_outcomes.tr.yml} (85%) create mode 100644 db/migrate/20200319090221_create_learning_outcomes.rb delete mode 100644 db/migrate/20200319090221_create_outcomes.rb create mode 100644 test/controllers/outcome_management/learning_outcomes_controller_test.rb delete mode 100644 test/controllers/outcome_management/outcomes_controller_test.rb rename test/fixtures/{outcomes.yml => learning_outcomes.yml} (100%) rename test/models/{outcome_test.rb => learning_outcome_test.rb} (55%) rename test/policies/outcome_management/{outcome_policy_test.rb => learning_outcome_policy_test.rb} (86%) diff --git a/app/controllers/outcome_management/accreditation_standards_controller.rb b/app/controllers/outcome_management/accreditation_standards_controller.rb index 2fbdfaaa8..2205269d7 100644 --- a/app/controllers/outcome_management/accreditation_standards_controller.rb +++ b/app/controllers/outcome_management/accreditation_standards_controller.rb @@ -16,7 +16,7 @@ def index end def show - @outcomes = @accreditation_standard.macro_outcomes.ordered + @learning_outcomes = @accreditation_standard.macro_outcomes.ordered end def new diff --git a/app/controllers/outcome_management/outcomes_controller.rb b/app/controllers/outcome_management/learning_outcomes_controller.rb similarity index 50% rename from app/controllers/outcome_management/outcomes_controller.rb rename to app/controllers/outcome_management/learning_outcomes_controller.rb index 551f11a20..3d71ca194 100644 --- a/app/controllers/outcome_management/outcomes_controller.rb +++ b/app/controllers/outcome_management/learning_outcomes_controller.rb @@ -1,32 +1,32 @@ # frozen_string_literal: true module OutcomeManagement - class OutcomesController < ApplicationController + class LearningOutcomesController < ApplicationController include SearchableModule before_action :set_accreditation_standard - before_action :set_outcome, except: %i[new create] + before_action :set_learning_outcome, except: %i[new create] before_action :authorized? def show; end def new - @outcome = @accreditation_standard.outcomes.new + @learning_outcome = @accreditation_standard.learning_outcomes.new end def edit; end def create - @outcome = @accreditation_standard.outcomes.new(outcome_params) - @outcome.save ? redirect_with('success') : render(:new) + @learning_outcome = @accreditation_standard.learning_outcomes.new(learning_outcome_params) + @learning_outcome.save ? redirect_with('success') : render(:new) end def update - @outcome.update(outcome_params) ? redirect_with('success') : render(:edit) + @learning_outcome.update(learning_outcome_params) ? redirect_with('success') : render(:edit) end def destroy - message = @outcome.destroy ? 'success' : 'error' + message = @learning_outcome.destroy ? 'success' : 'error' redirect_with(message) end @@ -40,16 +40,16 @@ def set_accreditation_standard @accreditation_standard = AccreditationStandard.find(params[:accreditation_standard_id]) end - def set_outcome - @outcome = @accreditation_standard.macro_outcomes.find(params[:id]) + def set_learning_outcome + @learning_outcome = @accreditation_standard.macro_outcomes.find(params[:id]) end def authorized? - authorize([:outcome_management, @outcome || Outcome]) + authorize([:outcome_management, @learning_outcome || LearningOutcome]) end - def outcome_params - params.require(:outcome).permit( + def learning_outcome_params + params.require(:learning_outcome).permit( :code, :name, :accreditation_standard_id, micro_outcomes_attributes: %i[id code name accreditation_standard_id _destroy] ) diff --git a/app/models/accreditation_standard.rb b/app/models/accreditation_standard.rb index 5fffcfb74..3460b3ff7 100644 --- a/app/models/accreditation_standard.rb +++ b/app/models/accreditation_standard.rb @@ -12,8 +12,8 @@ class AccreditationStandard < ApplicationRecord # relations belongs_to :accreditation_institution - has_many :macro_outcomes, -> { where(parent_id: nil) }, class_name: 'Outcome', inverse_of: :accreditation_standard - has_many :outcomes, dependent: :destroy + has_many :macro_outcomes, -> { where(parent_id: nil) }, class_name: 'LearningOutcome', inverse_of: :accreditation_standard + has_many :learning_outcomes, dependent: :destroy has_many :unit_accreditation_standards, dependent: :destroy has_many :units, through: :unit_accreditation_standards diff --git a/app/models/outcome.rb b/app/models/learning_outcome.rb similarity index 69% rename from app/models/outcome.rb rename to app/models/learning_outcome.rb index 16714a246..1f1c68543 100644 --- a/app/models/outcome.rb +++ b/app/models/learning_outcome.rb @@ -1,18 +1,18 @@ # frozen_string_literal: true -class Outcome < ApplicationRecord +class LearningOutcome < ApplicationRecord # relations belongs_to :accreditation_standard - belongs_to :macro_outcome, class_name: 'Outcome', foreign_key: :parent_id, + belongs_to :macro_outcome, class_name: 'LearningOutcome', foreign_key: :parent_id, inverse_of: :micro_outcomes, optional: true - has_many :micro_outcomes, class_name: 'Outcome', foreign_key: :parent_id, + has_many :micro_outcomes, class_name: 'LearningOutcome', foreign_key: :parent_id, inverse_of: :macro_outcome, dependent: :destroy accepts_nested_attributes_for :micro_outcomes, reject_if: :all_blank, allow_destroy: true # validations validates :code, presence: true, uniqueness: { scope: :accreditation_standard_id }, length: { maximum: 10 } validates :name, presence: true, length: { maximum: 255 } - validates_with OutcomeValidator + validates_with LearningOutcomeValidator # scopes scope :ordered, -> { order(:code) } diff --git a/app/policies/outcome_management/outcome_policy.rb b/app/policies/outcome_management/learning_outcome_policy.rb similarity index 81% rename from app/policies/outcome_management/outcome_policy.rb rename to app/policies/outcome_management/learning_outcome_policy.rb index b75f4795d..5b70f2d17 100644 --- a/app/policies/outcome_management/outcome_policy.rb +++ b/app/policies/outcome_management/learning_outcome_policy.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module OutcomeManagement - class OutcomePolicy < ApplicationPolicy + class LearningOutcomePolicy < ApplicationPolicy include CrudPolicyMethods undef :index? diff --git a/app/validators/outcome_validator.rb b/app/validators/learning_outcome_validator.rb similarity index 87% rename from app/validators/outcome_validator.rb rename to app/validators/learning_outcome_validator.rb index e4871bef6..db892420c 100644 --- a/app/validators/outcome_validator.rb +++ b/app/validators/learning_outcome_validator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class OutcomeValidator < ActiveModel::Validator +class LearningOutcomeValidator < ActiveModel::Validator def validate(record) @record = record @micro_outcomes = record.micro_outcomes @@ -28,6 +28,6 @@ def add_error_message_to_invalid_records private def message(key) - I18n.t(key, scope: %i[validators outcome]) + I18n.t(key, scope: %i[validators learning_outcome]) end end diff --git a/app/views/layouts/shared/menus/_admin.html.erb b/app/views/layouts/shared/menus/_admin.html.erb index e52759287..33a748d07 100644 --- a/app/views/layouts/shared/menus/_admin.html.erb +++ b/app/views/layouts/shared/menus/_admin.html.erb @@ -62,7 +62,7 @@
- + - +
<%= t('.accreditation_standard') %>
<%= t('.accreditation_standard') %><%= t('.version') %> <%= t('.units') %> <%= t('.status') %> <%= t('actions') %>
<%= standard.name %><%= standard.version %> <%= standard.units.map(&:names_depth_cache).join(', ') %> <%= enum_t(standard, :status) %> <%= link_to_actions(standard) %><%= t('.accreditation_standard') %> <%= @standard.name %>
<%= t('.version') %><%= @standard.version %>
<%= t('.status') %><%= enum_t(@standard, :status) %><%= enum_t(@standard, :status) %>
<%= t('created_at') %>
<%= t('created_at') %><%= @accreditation_standard.created_at %><%= l(@accreditation_standard.created_at, format: :long) %>
<%= t('updated_at') %><%= @accreditation_standard.updated_at %><%= l(@accreditation_standard.updated_at, format: :long) %>
@@ -48,24 +48,24 @@
<%= fa_icon 'dot-circle-o', text: t('.card_header') %>
- <%= link_to_new(t('.new_outcome_link'), new_accreditation_standard_outcome_path(@accreditation_standard)) %> + <%= link_to_new(t('.new_learning_outcome_link'), new_accreditation_standard_learning_outcome_path(@accreditation_standard)) %>
- - + + - <% @outcomes.each do |outcome| %> + <% @learning_outcomes.each do |learning_outcome| %> - - - + + + <% end %> diff --git a/app/views/outcome_management/outcomes/_form.html.erb b/app/views/outcome_management/learning_outcomes/_form.html.erb similarity index 95% rename from app/views/outcome_management/outcomes/_form.html.erb rename to app/views/outcome_management/learning_outcomes/_form.html.erb index aaaf6996d..d770039a3 100644 --- a/app/views/outcome_management/outcomes/_form.html.erb +++ b/app/views/outcome_management/learning_outcomes/_form.html.erb @@ -24,7 +24,7 @@
<%= t('.outcome_code') %><%= t('.outcome_name') %><%= t('.learning_outcome_code') %><%= t('.learning_outcome_name') %> <%= t('actions') %>
<%= outcome.code %><%= outcome.name %><%= link_to_actions([@accreditation_standard, outcome]) %><%= learning_outcome.code %><%= learning_outcome.name %><%= link_to_actions([@accreditation_standard, learning_outcome]) %>

- <%= simple_form_for([@accreditation_standard, @outcome]) do |f| %> + <%= simple_form_for([@accreditation_standard, @learning_outcome]) do |f| %>
<%= f.error_notification %> @@ -41,7 +41,7 @@
<%= fa_icon 'dot-circle-o' %> - <%= t('outcomes', scope: %i[activerecord attributes outcome]) %> + <%= t('outcomes', scope: %i[activerecord attributes learning_outcome]) %>
diff --git a/app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb b/app/views/outcome_management/learning_outcomes/_micro_outcome_fields.html.erb similarity index 100% rename from app/views/outcome_management/outcomes/_micro_outcome_fields.html.erb rename to app/views/outcome_management/learning_outcomes/_micro_outcome_fields.html.erb diff --git a/app/views/outcome_management/learning_outcomes/edit.html.erb b/app/views/outcome_management/learning_outcomes/edit.html.erb new file mode 100644 index 000000000..02cc6e8d1 --- /dev/null +++ b/app/views/outcome_management/learning_outcomes/edit.html.erb @@ -0,0 +1 @@ +<%= render 'form', learning_outcome: @learning_outcome, form_title: t('.form_title') %> diff --git a/app/views/outcome_management/outcomes/index.html.erb b/app/views/outcome_management/learning_outcomes/index.html.erb similarity index 72% rename from app/views/outcome_management/outcomes/index.html.erb rename to app/views/outcome_management/learning_outcomes/index.html.erb index a5e1b2f38..94da43e30 100644 --- a/app/views/outcome_management/outcomes/index.html.erb +++ b/app/views/outcome_management/learning_outcomes/index.html.erb @@ -4,7 +4,7 @@
<%= fa_icon 'align-justify', text: t('.card_header') %>
- <%= link_to_new(t('.new_outcome_link'), new_accreditation_standard_outcome_path(@accreditation_standard)) %> + <%= link_to_new(t('.new_learning_outcome_link'), new_accreditation_standard_learning_outcome_path(@accreditation_standard)) %>
@@ -17,11 +17,11 @@ - <% @outcomes.each do |outcome| %> + <% @learning_outcomes.each do |learning_outcome| %> - <%= outcome.code %> - <%= outcome.name %> - <%= link_to_actions[@accreditation_standard, outcome]) %> + <%= learning_outcome.code %> + <%= learning_outcome.name %> + <%= link_to_actions[@accreditation_standard, learning_outcome]) %> <% end %> diff --git a/app/views/outcome_management/learning_outcomes/new.html.erb b/app/views/outcome_management/learning_outcomes/new.html.erb new file mode 100644 index 000000000..02cc6e8d1 --- /dev/null +++ b/app/views/outcome_management/learning_outcomes/new.html.erb @@ -0,0 +1 @@ +<%= render 'form', learning_outcome: @learning_outcome, form_title: t('.form_title') %> diff --git a/app/views/outcome_management/outcomes/show.html.erb b/app/views/outcome_management/learning_outcomes/show.html.erb similarity index 76% rename from app/views/outcome_management/outcomes/show.html.erb rename to app/views/outcome_management/learning_outcomes/show.html.erb index 32e5b8a52..7639ea8b5 100644 --- a/app/views/outcome_management/outcomes/show.html.erb +++ b/app/views/outcome_management/learning_outcomes/show.html.erb @@ -2,9 +2,9 @@
- <%= fa_icon 'dot-circle-o' %><%= @outcome.code %> + <%= fa_icon 'dot-circle-o' %><%= @learning_outcome.code %>
- <%= link_to_actions([@accreditation_standard, @outcome], except: :show) %> + <%= link_to_actions([@accreditation_standard, @learning_outcome], except: :show) %>
@@ -13,11 +13,11 @@ <%= t('.code') %> - <%= @outcome.code %> + <%= @learning_outcome.code %> <%= t('.name') %> - <%= @outcome.name %> + <%= @learning_outcome.name %> @@ -41,7 +41,7 @@ - <% @outcome.micro_outcomes.each do |outcome| %> + <% @learning_outcome.micro_outcomes.each do |outcome| %> <%= outcome.code %> <%= outcome.name %> diff --git a/app/views/outcome_management/outcomes/edit.html.erb b/app/views/outcome_management/outcomes/edit.html.erb deleted file mode 100644 index 47600f272..000000000 --- a/app/views/outcome_management/outcomes/edit.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render 'form', outcome: @outcome, form_title: t('.form_title') %> diff --git a/app/views/outcome_management/outcomes/new.html.erb b/app/views/outcome_management/outcomes/new.html.erb deleted file mode 100644 index 47600f272..000000000 --- a/app/views/outcome_management/outcomes/new.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render 'form', outcome: @outcome, form_title: t('.form_title') %> diff --git a/config/locales/controllers/outcome_management/accreditation_standards.en.yml b/config/locales/controllers/outcome_management/accreditation_standards.en.yml index 7414be19f..96e39d02a 100644 --- a/config/locales/controllers/outcome_management/accreditation_standards.en.yml +++ b/config/locales/controllers/outcome_management/accreditation_standards.en.yml @@ -37,8 +37,8 @@ en: show: <<: *accreditation_standard_attributes card_header: Learning Outcomes - new_outcome_link: Create a New Learning Outcome - outcome_code: Code - outcome_name: Name + new_learning_outcome_link: Create a New Learning Outcome + learning_outcome_code: Code + learning_outcome_name: Name update: success: Accreditation standard successfully updated. diff --git a/config/locales/controllers/outcome_management/accreditation_standards.tr.yml b/config/locales/controllers/outcome_management/accreditation_standards.tr.yml index 81123ca39..410483a7d 100644 --- a/config/locales/controllers/outcome_management/accreditation_standards.tr.yml +++ b/config/locales/controllers/outcome_management/accreditation_standards.tr.yml @@ -37,8 +37,8 @@ tr: show: <<: *accreditation_standard_attributes card_header: Öğrenim Çıktıları - new_outcome_link: Yeni Öğrenim Çıktısı Oluştur - outcome_code: Kodu - outcome_name: Adı + new_learning_outcome_link: Yeni Öğrenim Çıktısı Oluştur + learning_outcome_code: Kodu + learning_outcome_name: Adı update: success: Akreditasyon standardı başarıyla güncellendi. diff --git a/config/locales/controllers/outcome_management/outcomes.en.yml b/config/locales/controllers/outcome_management/learning_outcomes.en.yml similarity index 84% rename from config/locales/controllers/outcome_management/outcomes.en.yml rename to config/locales/controllers/outcome_management/learning_outcomes.en.yml index fd3ab5680..2435caa40 100644 --- a/config/locales/controllers/outcome_management/outcomes.en.yml +++ b/config/locales/controllers/outcome_management/learning_outcomes.en.yml @@ -1,17 +1,17 @@ tr: activerecord: attributes: - outcome: &outcome_attributes + learning_outcome: &learning_outcome_attributes code: Code name: Name outcomes: Sub Learning Outcomes helpers: submit: - outcome: + learning_outcome: create: Create Learning Outcome update: Update Learning Outcome outcome_management: - outcomes: + learning_outcomes: create: success: Learning outcome successfully created. destroy: @@ -26,6 +26,6 @@ tr: new: form_title: Create a New Learning Outcome show: - <<: *outcome_attributes + <<: *learning_outcome_attributes update: success: Learning outcome successfully updated. diff --git a/config/locales/controllers/outcome_management/outcomes.tr.yml b/config/locales/controllers/outcome_management/learning_outcomes.tr.yml similarity index 85% rename from config/locales/controllers/outcome_management/outcomes.tr.yml rename to config/locales/controllers/outcome_management/learning_outcomes.tr.yml index d9909f2fa..0a630b8ac 100644 --- a/config/locales/controllers/outcome_management/outcomes.tr.yml +++ b/config/locales/controllers/outcome_management/learning_outcomes.tr.yml @@ -1,17 +1,17 @@ tr: activerecord: attributes: - outcome: &outcome_attributes + learning_outcome: &learning_outcome_attributes code: Kod name: Adı outcomes: Alt Öğrenim Çıktıları helpers: submit: - outcome: + learning_outcome: create: Öğrenim Çıktısı Oluştur update: Öğrenim Çıktısını Güncelle outcome_management: - outcomes: + learning_outcomes: create: success: Öğrenim çıktısı başarıyla oluşturuldu. destroy: @@ -26,6 +26,6 @@ tr: new: form_title: Öğrenim Çıktısı Oluştur show: - <<: *outcome_attributes + <<: *learning_outcome_attributes update: success: Öğrenim çıktısı başarıyla güncellendi. diff --git a/config/locales/layouts/shared/sidebar.en.yml b/config/locales/layouts/shared/sidebar.en.yml index 49fa99ab4..492c61241 100644 --- a/config/locales/layouts/shared/sidebar.en.yml +++ b/config/locales/layouts/shared/sidebar.en.yml @@ -26,7 +26,7 @@ en: stats: University Stats title: Manager Pages meksis: MEKSIS - outcomes: Learning Outcomes + learning_outcomes: Learning Outcomes prospective_employees: Prospective Employees prospective_students: Prospective Students references: References diff --git a/config/locales/layouts/shared/sidebar.tr.yml b/config/locales/layouts/shared/sidebar.tr.yml index 38f0cf663..7d3360739 100644 --- a/config/locales/layouts/shared/sidebar.tr.yml +++ b/config/locales/layouts/shared/sidebar.tr.yml @@ -26,7 +26,7 @@ tr: stats: Üniversite İstatistikleri title: Yönetici Sayfaları meksis: MEKSİS - outcomes: Öğrenim Çıktıları + learning_outcomes: Öğrenim Çıktıları prospective_employees: Aday Personeller prospective_students: Aday Öğrenciler references: Tanımlar diff --git a/config/locales/validators/en.yml b/config/locales/validators/en.yml index f13e9df72..9d22a4cef 100644 --- a/config/locales/validators/en.yml +++ b/config/locales/validators/en.yml @@ -30,7 +30,7 @@ en: image: not_permitted: '%{mime_type} is not an allowed file type. You can upload files in %{extension_whitelist} formats.' size_not_satisfied: File size is not between the permitted range. You can upload files from minimum %{minimum} KBs to maximum %{maximum} MBs. - outcome: + learning_outcome: invalid_code: Multiple learning outcome have the same code, the code field must be unique. must_be_uniq: must be unique. prospective_student: diff --git a/config/locales/validators/tr.yml b/config/locales/validators/tr.yml index 47d4b0a53..f56745406 100644 --- a/config/locales/validators/tr.yml +++ b/config/locales/validators/tr.yml @@ -30,7 +30,7 @@ tr: image: not_permitted: '%{mime_type} izin verilen bir dosya türü değil. %{extension_whitelist} türlerinde bir dosya yükleyebilirsiniz' size_not_satisfied: Dosya boyutu izin verilen aralıkta değil. Yükleyeceğiniz dosya en az %{minimum} KB, en çok %{maximum} MB boyutunda olabilir. - outcome: + learning_outcome: invalid_code: Birden farklı öğrenim çıktısına aynı kod verilmiş, kod alanı benzersiz olmalıdır. must_be_uniq: benzersiz olmalıdır. prospective_student: diff --git a/config/routes/outcome_management.rb b/config/routes/outcome_management.rb index f6565b95e..4d4c2deb7 100644 --- a/config/routes/outcome_management.rb +++ b/config/routes/outcome_management.rb @@ -2,7 +2,7 @@ scope module: :outcome_management do resources :accreditation_standards do - resources :outcomes, except: :index + resources :learning_outcomes, except: :index get :units, on: :collection end diff --git a/db/migrate/20200319090221_create_learning_outcomes.rb b/db/migrate/20200319090221_create_learning_outcomes.rb new file mode 100644 index 000000000..4d08b2c1f --- /dev/null +++ b/db/migrate/20200319090221_create_learning_outcomes.rb @@ -0,0 +1,20 @@ +class CreateLearningOutcomes < ActiveRecord::Migration[6.0] + def change + create_table :learning_outcomes do |t| + t.references :accreditation_standard, null: false, foreign_key: true + t.references :parent, foreign_key: { to_table: :learning_outcomes } + t.string :code + t.string :name + + t.timestamps + end + + add_length_constraint :learning_outcomes, :code, less_than_or_equal_to: 10 + add_length_constraint :learning_outcomes, :name, less_than_or_equal_to: 255 + + add_presence_constraint :learning_outcomes, :code + add_presence_constraint :learning_outcomes, :name + + add_unique_constraint :learning_outcomes, [:accreditation_standard_id, :code] + end +end diff --git a/db/migrate/20200319090221_create_outcomes.rb b/db/migrate/20200319090221_create_outcomes.rb deleted file mode 100644 index c78574d34..000000000 --- a/db/migrate/20200319090221_create_outcomes.rb +++ /dev/null @@ -1,20 +0,0 @@ -class CreateOutcomes < ActiveRecord::Migration[6.0] - def change - create_table :outcomes do |t| - t.references :accreditation_standard, null: false, foreign_key: true - t.references :parent, foreign_key: { to_table: :outcomes } - t.string :code - t.string :name - - t.timestamps - end - - add_length_constraint :outcomes, :code, less_than_or_equal_to: 10 - add_length_constraint :outcomes, :name, less_than_or_equal_to: 255 - - add_presence_constraint :outcomes, :code - add_presence_constraint :outcomes, :name - - add_unique_constraint :outcomes, [:accreditation_standard_id, :code] - end -end diff --git a/db/structure.sql b/db/structure.sql index 0e5ee20a1..c5d6b5d50 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -2286,26 +2286,29 @@ ALTER SEQUENCE public.ldap_sync_errors_id_seq OWNED BY public.ldap_sync_errors.i -- --- Name: meeting_agendas; Type: TABLE; Schema: public; Owner: - +-- Name: learning_outcomes; Type: TABLE; Schema: public; Owner: - -- -CREATE TABLE public.meeting_agendas ( +CREATE TABLE public.learning_outcomes ( id bigint NOT NULL, - agenda_id bigint NOT NULL, - committee_meeting_id bigint NOT NULL, - sequence_no integer, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - CONSTRAINT meeting_agendas_sequence_no_null CHECK ((sequence_no IS NOT NULL)), - CONSTRAINT meeting_agendas_sequence_no_numericality CHECK ((sequence_no >= 0)) + accreditation_standard_id bigint NOT NULL, + parent_id bigint, + code character varying, + name character varying, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL, + CONSTRAINT learning_outcomes_code_length CHECK ((length((code)::text) <= 10)), + CONSTRAINT learning_outcomes_code_presence CHECK (((code IS NOT NULL) AND ((code)::text !~ '^\s*$'::text))), + CONSTRAINT learning_outcomes_name_length CHECK ((length((name)::text) <= 255)), + CONSTRAINT learning_outcomes_name_presence CHECK (((name IS NOT NULL) AND ((name)::text !~ '^\s*$'::text))) ); -- --- Name: meeting_agendas_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- Name: learning_outcomes_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- -CREATE SEQUENCE public.meeting_agendas_id_seq +CREATE SEQUENCE public.learning_outcomes_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE @@ -2314,36 +2317,33 @@ CREATE SEQUENCE public.meeting_agendas_id_seq -- --- Name: meeting_agendas_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- Name: learning_outcomes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- -ALTER SEQUENCE public.meeting_agendas_id_seq OWNED BY public.meeting_agendas.id; +ALTER SEQUENCE public.learning_outcomes_id_seq OWNED BY public.learning_outcomes.id; -- --- Name: outcomes; Type: TABLE; Schema: public; Owner: - +-- Name: meeting_agendas; Type: TABLE; Schema: public; Owner: - -- -CREATE TABLE public.outcomes ( +CREATE TABLE public.meeting_agendas ( id bigint NOT NULL, - accreditation_standard_id bigint NOT NULL, - parent_id bigint, - code character varying, - name character varying, - created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL, - CONSTRAINT outcomes_code_length CHECK ((length((code)::text) <= 10)), - CONSTRAINT outcomes_code_presence CHECK (((code IS NOT NULL) AND ((code)::text !~ '^\s*$'::text))), - CONSTRAINT outcomes_name_length CHECK ((length((name)::text) <= 255)), - CONSTRAINT outcomes_name_presence CHECK (((name IS NOT NULL) AND ((name)::text !~ '^\s*$'::text))) + agenda_id bigint NOT NULL, + committee_meeting_id bigint NOT NULL, + sequence_no integer, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + CONSTRAINT meeting_agendas_sequence_no_null CHECK ((sequence_no IS NOT NULL)), + CONSTRAINT meeting_agendas_sequence_no_numericality CHECK ((sequence_no >= 0)) ); -- --- Name: outcomes_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- Name: meeting_agendas_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- -CREATE SEQUENCE public.outcomes_id_seq +CREATE SEQUENCE public.meeting_agendas_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE @@ -2352,10 +2352,10 @@ CREATE SEQUENCE public.outcomes_id_seq -- --- Name: outcomes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- Name: meeting_agendas_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- -ALTER SEQUENCE public.outcomes_id_seq OWNED BY public.outcomes.id; +ALTER SEQUENCE public.meeting_agendas_id_seq OWNED BY public.meeting_agendas.id; -- @@ -4332,17 +4332,17 @@ ALTER TABLE ONLY public.ldap_sync_errors ALTER COLUMN id SET DEFAULT nextval('pu -- --- Name: meeting_agendas id; Type: DEFAULT; Schema: public; Owner: - +-- Name: learning_outcomes id; Type: DEFAULT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.meeting_agendas ALTER COLUMN id SET DEFAULT nextval('public.meeting_agendas_id_seq'::regclass); +ALTER TABLE ONLY public.learning_outcomes ALTER COLUMN id SET DEFAULT nextval('public.learning_outcomes_id_seq'::regclass); -- --- Name: outcomes id; Type: DEFAULT; Schema: public; Owner: - +-- Name: meeting_agendas id; Type: DEFAULT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.outcomes ALTER COLUMN id SET DEFAULT nextval('public.outcomes_id_seq'::regclass); +ALTER TABLE ONLY public.meeting_agendas ALTER COLUMN id SET DEFAULT nextval('public.meeting_agendas_id_seq'::regclass); -- @@ -5180,27 +5180,27 @@ ALTER TABLE ONLY public.ldap_sync_errors -- --- Name: meeting_agendas meeting_agendas_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: learning_outcomes learning_outcomes_accreditation_standard_id_code_unique; Type: CONSTRAINT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.meeting_agendas - ADD CONSTRAINT meeting_agendas_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.learning_outcomes + ADD CONSTRAINT learning_outcomes_accreditation_standard_id_code_unique UNIQUE (accreditation_standard_id, code) DEFERRABLE; -- --- Name: outcomes outcomes_accreditation_standard_id_code_unique; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: learning_outcomes learning_outcomes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.outcomes - ADD CONSTRAINT outcomes_accreditation_standard_id_code_unique UNIQUE (accreditation_standard_id, code) DEFERRABLE; +ALTER TABLE ONLY public.learning_outcomes + ADD CONSTRAINT learning_outcomes_pkey PRIMARY KEY (id); -- --- Name: outcomes outcomes_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: meeting_agendas meeting_agendas_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.outcomes - ADD CONSTRAINT outcomes_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.meeting_agendas + ADD CONSTRAINT meeting_agendas_pkey PRIMARY KEY (id); -- @@ -6281,31 +6281,31 @@ CREATE INDEX index_ldap_sync_errors_on_ldap_entity_id ON public.ldap_sync_errors -- --- Name: index_meeting_agendas_on_agenda_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_learning_outcomes_on_accreditation_standard_id; Type: INDEX; Schema: public; Owner: - -- -CREATE INDEX index_meeting_agendas_on_agenda_id ON public.meeting_agendas USING btree (agenda_id); +CREATE INDEX index_learning_outcomes_on_accreditation_standard_id ON public.learning_outcomes USING btree (accreditation_standard_id); -- --- Name: index_meeting_agendas_on_committee_meeting_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_learning_outcomes_on_parent_id; Type: INDEX; Schema: public; Owner: - -- -CREATE INDEX index_meeting_agendas_on_committee_meeting_id ON public.meeting_agendas USING btree (committee_meeting_id); +CREATE INDEX index_learning_outcomes_on_parent_id ON public.learning_outcomes USING btree (parent_id); -- --- Name: index_outcomes_on_accreditation_standard_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_meeting_agendas_on_agenda_id; Type: INDEX; Schema: public; Owner: - -- -CREATE INDEX index_outcomes_on_accreditation_standard_id ON public.outcomes USING btree (accreditation_standard_id); +CREATE INDEX index_meeting_agendas_on_agenda_id ON public.meeting_agendas USING btree (agenda_id); -- --- Name: index_outcomes_on_parent_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_meeting_agendas_on_committee_meeting_id; Type: INDEX; Schema: public; Owner: - -- -CREATE INDEX index_outcomes_on_parent_id ON public.outcomes USING btree (parent_id); +CREATE INDEX index_meeting_agendas_on_committee_meeting_id ON public.meeting_agendas USING btree (committee_meeting_id); -- @@ -6753,19 +6753,19 @@ ALTER TABLE ONLY public.addresses -- --- Name: unit_tuitions fk_rails_2b01e356e7; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: learning_outcomes fk_rails_233dbdf7c4; Type: FK CONSTRAINT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.unit_tuitions - ADD CONSTRAINT fk_rails_2b01e356e7 FOREIGN KEY (unit_id) REFERENCES public.units(id); +ALTER TABLE ONLY public.learning_outcomes + ADD CONSTRAINT fk_rails_233dbdf7c4 FOREIGN KEY (accreditation_standard_id) REFERENCES public.accreditation_standards(id); -- --- Name: outcomes fk_rails_2ea1d50d55; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: unit_tuitions fk_rails_2b01e356e7; Type: FK CONSTRAINT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.outcomes - ADD CONSTRAINT fk_rails_2ea1d50d55 FOREIGN KEY (accreditation_standard_id) REFERENCES public.accreditation_standards(id); +ALTER TABLE ONLY public.unit_tuitions + ADD CONSTRAINT fk_rails_2b01e356e7 FOREIGN KEY (unit_id) REFERENCES public.units(id); -- @@ -6856,14 +6856,6 @@ ALTER TABLE ONLY public.articles ADD CONSTRAINT fk_rails_3d31dad1cc FOREIGN KEY (user_id) REFERENCES public.users(id); --- --- Name: outcomes fk_rails_3ea0ff4a78; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.outcomes - ADD CONSTRAINT fk_rails_3ea0ff4a78 FOREIGN KEY (parent_id) REFERENCES public.outcomes(id); - - -- -- Name: duties fk_rails_3f1a2d48dd; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7264,6 +7256,14 @@ ALTER TABLE ONLY public.available_courses ADD CONSTRAINT fk_rails_a9099f01f5 FOREIGN KEY (coordinator_id) REFERENCES public.employees(id); +-- +-- Name: learning_outcomes fk_rails_ab9bdb6c0a; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.learning_outcomes + ADD CONSTRAINT fk_rails_ab9bdb6c0a FOREIGN KEY (parent_id) REFERENCES public.learning_outcomes(id); + + -- -- Name: classrooms fk_rails_b0064b7304; Type: FK CONSTRAINT; Schema: public; Owner: - -- diff --git a/test/controllers/outcome_management/learning_outcomes_controller_test.rb b/test/controllers/outcome_management/learning_outcomes_controller_test.rb new file mode 100644 index 000000000..aecbd18f8 --- /dev/null +++ b/test/controllers/outcome_management/learning_outcomes_controller_test.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +require 'test_helper' + +module OutcomeManagement + class LearningOutcomesControllerTest < ActionDispatch::IntegrationTest + setup do + sign_in users(:serhat) + @accreditation_standard = accreditation_standards(:one) + @learning_outcome = learning_outcomes(:one) + end + + test 'should get show' do + get accreditation_standard_learning_outcome_path(@accreditation_standard, @learning_outcome) + assert_response :success + end + + test 'should get new' do + get new_accreditation_standard_learning_outcome_path(@accreditation_standard) + assert_response :success + end + + test 'should create learning outcome' do + assert_difference('LearningOutcome.count', 2) do + post accreditation_standard_learning_outcomes_path(@accreditation_standard), params: { + learning_outcome: { + code: 'PÇ-3', name: 'Çözme ve uygulayabilme becerisi', + micro_outcomes_attributes: { + '0' => { accreditation_standard_id: @accreditation_standard.id, code: 'PÇ3-1', name: 'Çözme becerisi' } + } + } + } + end + + learning_outcome = @accreditation_standard.macro_outcomes.last + + assert_equal 'PÇ-3', learning_outcome.code + assert_equal 'Çözme ve uygulayabilme becerisi', learning_outcome.name + assert_equal 1, learning_outcome.micro_outcomes.count + assert_redirected_to accreditation_standard_path(@accreditation_standard) + end + + test 'should get edit' do + get edit_accreditation_standard_learning_outcome_path(@accreditation_standard, @learning_outcome) + assert_response :success + assert_select '.card-header strong', translate('.edit.form_title') + end + + test 'should update learning outcome' do + patch accreditation_standard_learning_outcome_path(@accreditation_standard, @learning_outcome), params: { + learning_outcome: { + code: 'PÇ1', name: 'Seçme ve uygulama becerisi.', + micro_outcomes_attributes: { + '0' => { accreditation_standard_id: @accreditation_standard.id, code: 'PÇ1-1', name: 'Seçme becerisi.' } + } + } + } + + @learning_outcome.reload + + assert_equal 'PÇ1', @learning_outcome.code + assert_equal 'Seçme ve uygulama becerisi.', @learning_outcome.name + assert_equal 'PÇ1-1', @learning_outcome.micro_outcomes.ordered.first.code + assert_redirected_to accreditation_standard_path(@accreditation_standard) + assert_equal translate('.update.success'), flash[:info] + end + + test 'should destroy learning outcome' do + assert_difference('LearningOutcome.count', -1) do + delete accreditation_standard_learning_outcome_path(@accreditation_standard, @learning_outcome) + end + + assert_redirected_to accreditation_standard_path(@accreditation_standard) + assert_equal translate('.destroy.success'), flash[:info] + end + + private + + def translate(key) + t("outcome_management.learning_outcomes#{key}") + end + end +end diff --git a/test/controllers/outcome_management/outcomes_controller_test.rb b/test/controllers/outcome_management/outcomes_controller_test.rb deleted file mode 100644 index f9cde5984..000000000 --- a/test/controllers/outcome_management/outcomes_controller_test.rb +++ /dev/null @@ -1,83 +0,0 @@ -# frozen_string_literal: true - -require 'test_helper' - -module OutcomeManagement - class OutcomesControllerTest < ActionDispatch::IntegrationTest - setup do - sign_in users(:serhat) - @accreditation_standard = accreditation_standards(:one) - @outcome = outcomes(:one) - end - - test 'should get show' do - get accreditation_standard_outcome_path(@accreditation_standard, @outcome) - assert_response :success - end - - test 'should get new' do - get new_accreditation_standard_outcome_path(@accreditation_standard) - assert_response :success - end - - test 'should create outcome' do - assert_difference('Outcome.count', 2) do - post accreditation_standard_outcomes_path(@accreditation_standard), params: { - outcome: { - code: 'PÇ-3', name: 'Çözme ve uygulayabilme becerisi', - micro_outcomes_attributes: { - '0' => { accreditation_standard_id: @accreditation_standard.id, code: 'PÇ3-1', name: 'Çözme becerisi' } - } - } - } - end - - outcome = @accreditation_standard.macro_outcomes.last - - assert_equal 'PÇ-3', outcome.code - assert_equal 'Çözme ve uygulayabilme becerisi', outcome.name - assert_equal 1, outcome.micro_outcomes.count - assert_redirected_to accreditation_standard_path(@accreditation_standard) - end - - test 'should get edit' do - get edit_accreditation_standard_outcome_path(@accreditation_standard, @outcome) - assert_response :success - assert_select '.card-header strong', translate('.edit.form_title') - end - - test 'should update outcome' do - patch accreditation_standard_outcome_path(@accreditation_standard, @outcome), params: { - outcome: { - code: 'PÇ1', name: 'Seçme ve uygulama becerisi.', - micro_outcomes_attributes: { - '0' => { accreditation_standard_id: @accreditation_standard.id, code: 'PÇ1-1', name: 'Seçme becerisi.' } - } - } - } - - @outcome.reload - - assert_equal 'PÇ1', @outcome.code - assert_equal 'Seçme ve uygulama becerisi.', @outcome.name - assert_equal 'PÇ1-1', @outcome.micro_outcomes.ordered.first.code - assert_redirected_to accreditation_standard_path(@accreditation_standard) - assert_equal translate('.update.success'), flash[:info] - end - - test 'should destroy outcome' do - assert_difference('Outcome.count', -1) do - delete accreditation_standard_outcome_path(@accreditation_standard, @outcome) - end - - assert_redirected_to accreditation_standard_path(@accreditation_standard) - assert_equal translate('.destroy.success'), flash[:info] - end - - private - - def translate(key) - t("outcome_management.outcomes#{key}") - end - end -end diff --git a/test/fixtures/outcomes.yml b/test/fixtures/learning_outcomes.yml similarity index 100% rename from test/fixtures/outcomes.yml rename to test/fixtures/learning_outcomes.yml diff --git a/test/models/accreditation_standard_test.rb b/test/models/accreditation_standard_test.rb index 16089979a..44d7e05d0 100644 --- a/test/models/accreditation_standard_test.rb +++ b/test/models/accreditation_standard_test.rb @@ -12,8 +12,8 @@ class AccreditationStandardTest < ActiveSupport::TestCase # relations belongs_to :accreditation_institution - has_many :macro_outcomes, class_name: 'Outcome', inverse_of: :accreditation_standard - has_many :outcomes, dependent: :destroy + has_many :macro_outcomes, class_name: 'LearningOutcome', inverse_of: :accreditation_standard + has_many :learning_outcomes, dependent: :destroy has_many :unit_accreditation_standards, dependent: :destroy has_many :units, through: :unit_accreditation_standards diff --git a/test/models/outcome_test.rb b/test/models/learning_outcome_test.rb similarity index 55% rename from test/models/outcome_test.rb rename to test/models/learning_outcome_test.rb index 351d13d5c..00e30ca17 100644 --- a/test/models/outcome_test.rb +++ b/test/models/learning_outcome_test.rb @@ -2,15 +2,15 @@ require 'test_helper' -class OutcomeTest < ActiveSupport::TestCase +class LearningOutcomeTest < ActiveSupport::TestCase extend Support::Minitest::AssociationHelper extend Support::Minitest::ValidationHelper # relations belongs_to :accreditation_standard - belongs_to :macro_outcome, class_name: 'Outcome', foreign_key: :parent_id, + belongs_to :macro_outcome, class_name: 'LearningOutcome', foreign_key: :parent_id, inverse_of: :micro_outcomes, optional: true - has_many :micro_outcomes, class_name: 'Outcome', foreign_key: :parent_id, + has_many :micro_outcomes, class_name: 'LearningOutcome', foreign_key: :parent_id, inverse_of: :macro_outcome, dependent: :destroy accepts_nested_attributes_for :micro_outcomes, allow_destroy: true @@ -23,16 +23,16 @@ class OutcomeTest < ActiveSupport::TestCase validates_length_of :name, maximum: 255 # validations: uniqueness - test 'uniqueness validations for code of a outcome' do - fake = outcomes(:one).dup + test 'uniqueness validations for code of a learning outcome' do + fake = learning_outcomes(:one).dup assert_not fake.valid? assert_not_empty fake.errors[:code] end # scopes - test 'ordered returns outcomes ordered by code' do - outcomes = accreditation_standards(:one).macro_outcomes.ordered - assert_equal outcomes(:one), outcomes.first - assert_equal outcomes(:four), outcomes.last + test 'ordered returns learning outcomes ordered by code' do + learning_outcomes = accreditation_standards(:one).macro_outcomes.ordered + assert_equal learning_outcomes(:one), learning_outcomes.first + assert_equal learning_outcomes(:four), learning_outcomes.last end end diff --git a/test/policies/outcome_management/outcome_policy_test.rb b/test/policies/outcome_management/learning_outcome_policy_test.rb similarity index 86% rename from test/policies/outcome_management/outcome_policy_test.rb rename to test/policies/outcome_management/learning_outcome_policy_test.rb index 83cd752ee..3d401c7aa 100644 --- a/test/policies/outcome_management/outcome_policy_test.rb +++ b/test/policies/outcome_management/learning_outcome_policy_test.rb @@ -3,7 +3,7 @@ require 'pundit_test_case' module OutcomeManagement - class OutcomePolicyTest < PunditTestCase + class LearningOutcomePolicyTest < PunditTestCase %w[ create? destroy? From afd41987d56dfced0e80fe55ca62bc991f0eca14 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 2 Apr 2020 09:17:47 +0300 Subject: [PATCH 566/970] Reach students of unit as json --- app/controllers/units_controller.rb | 6 +++++- app/policies/unit_policy.rb | 4 ++++ app/views/units/students.json.jbuilder | 6 ++++++ config/routes.rb | 3 ++- 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 app/views/units/students.json.jbuilder diff --git a/app/controllers/units_controller.rb b/app/controllers/units_controller.rb index d64b4e758..18322bea9 100644 --- a/app/controllers/units_controller.rb +++ b/app/controllers/units_controller.rb @@ -3,7 +3,7 @@ class UnitsController < ApplicationController include SearchableModule - before_action :set_unit, only: %i[edit update destroy show courses programs curriculums employees] + before_action :set_unit, only: %i[edit update destroy show courses programs curriculums employees students] before_action :authorized? def index @@ -58,6 +58,10 @@ def employees .where(units: { id: @unit.subtree.active.ids }) end + def students + @students = @unit.students.active + end + private def set_unit diff --git a/app/policies/unit_policy.rb b/app/policies/unit_policy.rb index f685f0ebc..9ddea273a 100644 --- a/app/policies/unit_policy.rb +++ b/app/policies/unit_policy.rb @@ -19,6 +19,10 @@ def programs? permitted? :read end + def students? + permitted? :read + end + private def permitted?(*privileges) diff --git a/app/views/units/students.json.jbuilder b/app/views/units/students.json.jbuilder new file mode 100644 index 000000000..22c4f6852 --- /dev/null +++ b/app/views/units/students.json.jbuilder @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +json.array!(@students) do |student| + json.id student.id + json.full_name full_name(student.user.identities.formal.first) +end diff --git a/config/routes.rb b/config/routes.rb index a2bbd6051..ee1d3cb57 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -36,9 +36,10 @@ resources :units do member do get :courses, defaults: { format: :json } - get :programs, defaults: { format: :json } get :curriculums, defaults: { format: :json } get :employees, default: { format: :json } + get :programs, defaults: { format: :json } + get :students, defaults: { format: :json } end end From c6923c8f0a24c8855c97d466a8b83ac10d95c0c1 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 2 Apr 2020 09:20:08 +0300 Subject: [PATCH 567/970] Remove null constraint --- app/models/tuition_debt.rb | 2 +- db/migrate/20200320114534_create_tuition_debts.rb | 2 +- db/structure.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/tuition_debt.rb b/app/models/tuition_debt.rb index cc760f00d..8c3433264 100644 --- a/app/models/tuition_debt.rb +++ b/app/models/tuition_debt.rb @@ -7,7 +7,7 @@ class TuitionDebt < ApplicationRecord # relations belongs_to :student belongs_to :academic_term - belongs_to :unit_tuition + belongs_to :unit_tuition, optional: true # validations validates :amount, numericality: { greater_than: 0 } diff --git a/db/migrate/20200320114534_create_tuition_debts.rb b/db/migrate/20200320114534_create_tuition_debts.rb index d1cc178fe..86e411492 100644 --- a/db/migrate/20200320114534_create_tuition_debts.rb +++ b/db/migrate/20200320114534_create_tuition_debts.rb @@ -5,7 +5,7 @@ def change create_table :tuition_debts do |t| t.references :student, null: false, foreign_key: true t.references :academic_term, null: false, foreign_key: true - t.references :unit_tuition, null: false, foreign_key: true + t.references :unit_tuition, foreign_key: true t.decimal :amount, precision: 8, scale: 3 t.text :description diff --git a/db/structure.sql b/db/structure.sql index c35ec0abc..52fd31d6d 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -3408,7 +3408,7 @@ CREATE TABLE public.tuition_debts ( id bigint NOT NULL, student_id bigint NOT NULL, academic_term_id bigint NOT NULL, - unit_tuition_id bigint NOT NULL, + unit_tuition_id bigint, amount numeric(8,3), description text, created_at timestamp(6) without time zone NOT NULL, From 5e1bcae69b5d3ce088287addd8a17aadc4d0208d Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 2 Apr 2020 09:24:39 +0300 Subject: [PATCH 568/970] Individual tuition debt can be create anymore --- .../tuition_debts_controller.rb | 17 +++++ .../tuition_debts/_form.html.erb | 62 +++++++++++++++++++ .../tuition_debts/_form_bulk.html.erb | 22 +------ .../tuition_debts/_js.html.erb | 21 +++++++ .../tuition_debts/edit.html.erb | 1 + .../tuition_debts/index.html.erb | 3 +- .../tuition_debts/new.html.erb | 7 ++- .../tuition_management/tuition_debts.en.yml | 9 +++ .../tuition_management/tuition_debts.tr.yml | 9 +++ config/routes/tuition_management.rb | 2 +- 10 files changed, 128 insertions(+), 25 deletions(-) create mode 100644 app/views/tuition_management/tuition_debts/_form.html.erb create mode 100644 app/views/tuition_management/tuition_debts/_js.html.erb create mode 100644 app/views/tuition_management/tuition_debts/edit.html.erb diff --git a/app/controllers/tuition_management/tuition_debts_controller.rb b/app/controllers/tuition_management/tuition_debts_controller.rb index 5722f6b9d..90e86296c 100644 --- a/app/controllers/tuition_management/tuition_debts_controller.rb +++ b/app/controllers/tuition_management/tuition_debts_controller.rb @@ -2,6 +2,8 @@ module TuitionManagement class TuitionDebtsController < ApplicationController + before_action :set_tuition_debt, only: %i[edit update destroy] + def index @tuition_debts = TuitionDebt.includes(:academic_term, student: %i[unit user]) end @@ -10,6 +12,17 @@ def new @tuition_debt = TuitionDebt.new end + def create + @tuition_debt = TuitionDebt.new(tuition_debt_params) + @tuition_debt.save ? redirect_to(:tuition_debts, notice: t('.success')) : render(:new) + end + + def edit; end + + def update + @tuition_debt.update(tuition_debt_params) ? redirect_to(:tuition_debts, notice: t('.success')) : render(:edit) + end + def create_with_service Debt::TuitionDebtJob.perform_later(params.dig(:tuition_debt, :unit_ids), params.dig(:tuition_debt, :academic_term_id)) @@ -25,6 +38,10 @@ def destroy private + def set_tuition_debt + @tuition_debt = TuitionDebt.find(params[:id]) + end + def tuition_debt_params params.require(:tuition_debt).permit(:student_id, :academic_term_id, :unit_tuition_id, :amount, :description) end diff --git a/app/views/tuition_management/tuition_debts/_form.html.erb b/app/views/tuition_management/tuition_debts/_form.html.erb new file mode 100644 index 000000000..691e2c148 --- /dev/null +++ b/app/views/tuition_management/tuition_debts/_form.html.erb @@ -0,0 +1,62 @@ +
+
+
+
+ <%= fa_icon 'money' %> + <%= form_title %> +
+
+ <%= simple_form_for(@tuition_debt) do |f| %> +
+
+ <%= f.error_notification %> +
+ <% if params[:action] == 'new' %> +
+ <%= f.input :unit_id, collection: Unit.programs.active, label_method: :name, required: true %> +
+ <% end %> +
+ <%= f.association :student, label_method: lambda { |student| full_name(student.user.identities.formal.first) } %> +
+
+ <%= f.association :academic_term, label_method: lambda { |academic_term| full_name(academic_term) } %> +
+
+ <%= f.input :amount %> +
+
+ <%= f.input :description %> +
+
+ <%= f.button :submit, t('save'), class: 'btn btn-outline-success btn-sm' %> +
+
+ <% end %> +
+ +
+
+
+ +<%= render 'js'%> + diff --git a/app/views/tuition_management/tuition_debts/_form_bulk.html.erb b/app/views/tuition_management/tuition_debts/_form_bulk.html.erb index 38c124b70..500985d99 100644 --- a/app/views/tuition_management/tuition_debts/_form_bulk.html.erb +++ b/app/views/tuition_management/tuition_debts/_form_bulk.html.erb @@ -30,24 +30,4 @@
- +<%= render 'js'%> diff --git a/app/views/tuition_management/tuition_debts/_js.html.erb b/app/views/tuition_management/tuition_debts/_js.html.erb new file mode 100644 index 000000000..088ac2bb2 --- /dev/null +++ b/app/views/tuition_management/tuition_debts/_js.html.erb @@ -0,0 +1,21 @@ + diff --git a/app/views/tuition_management/tuition_debts/edit.html.erb b/app/views/tuition_management/tuition_debts/edit.html.erb new file mode 100644 index 000000000..5abfb976b --- /dev/null +++ b/app/views/tuition_management/tuition_debts/edit.html.erb @@ -0,0 +1 @@ +<%= render 'form', form_title: t('.form_title') %> diff --git a/app/views/tuition_management/tuition_debts/index.html.erb b/app/views/tuition_management/tuition_debts/index.html.erb index 052067775..e72af3090 100644 --- a/app/views/tuition_management/tuition_debts/index.html.erb +++ b/app/views/tuition_management/tuition_debts/index.html.erb @@ -5,6 +5,7 @@ <%= fa_icon 'money', text: t('.card_header') %>
<%= link_to_new(t('.add_bulk_tuition_debt'), new_tuition_debt_path(type: 'bulk')) %> + <%= link_to_new(t('.add_personal_tuition_debt'), new_tuition_debt_path) %>
@@ -27,7 +28,7 @@ <%= full_name(debt.student.user.identities.formal.first)%> <%= number_to_currency(debt.amount) %> <%= debt.description %> - <%= link_to_actions(debt, except: %i[show edit]) %> + <%= link_to_actions(debt, except: %i[show]) %> <% end %> diff --git a/app/views/tuition_management/tuition_debts/new.html.erb b/app/views/tuition_management/tuition_debts/new.html.erb index 17888142a..fd17b6603 100644 --- a/app/views/tuition_management/tuition_debts/new.html.erb +++ b/app/views/tuition_management/tuition_debts/new.html.erb @@ -1,2 +1,5 @@ -<%= render 'form_bulk', form_title: t('.form_bulk_title') %> - +<% if params[:type] == 'bulk' %> + <%= render 'form_bulk', form_title: t('.form_bulk_title') %> +<% else %> + <%= render 'form', form_title: t('.form_title') %> +<% end %> diff --git a/config/locales/controllers/tuition_management/tuition_debts.en.yml b/config/locales/controllers/tuition_management/tuition_debts.en.yml index d6de39fe7..3688b1c71 100644 --- a/config/locales/controllers/tuition_management/tuition_debts.en.yml +++ b/config/locales/controllers/tuition_management/tuition_debts.en.yml @@ -7,19 +7,28 @@ en: description: Description student: Student unit: Unit + unit_id: Unit unit_ids: Units tuition_management: tuition_debts: + create: + success: Tuition debt successfully created. create_with_service: will_update: Tuition debts will be created in a couple of seconds/minutes. destroy: success: Tuition debt successfully deleted. warning: Tuition debt can not be deleted! + edit: + form_title: Edit Tuition Debt form_bulk: create_tuition_debts: Create Tuition Debts index: <<: *tuition_debt_attributes add_bulk_tuition_debt: Add Bulk Tuition Debt + add_personal_tuition_debt: Add Personal Tuition Debt card_header: Tuition Debts new: form_bulk_title: Create Bulk Tuition Debt + form_title: Create Personal Tuition Debt + update: + success: Tuition debt successfully updated. diff --git a/config/locales/controllers/tuition_management/tuition_debts.tr.yml b/config/locales/controllers/tuition_management/tuition_debts.tr.yml index e86853e3b..caf778d1e 100644 --- a/config/locales/controllers/tuition_management/tuition_debts.tr.yml +++ b/config/locales/controllers/tuition_management/tuition_debts.tr.yml @@ -7,19 +7,28 @@ tr: description: Açıklama student: Öğrenci unit: Birim + unit_id: Birim unit_ids: Birimler tuition_management: tuition_debts: + create: + success: Harç borcu başarıyla oluşturuldu. create_with_service: will_update: Harç borçları bir kaç saniye/dakika içerisinde oluşturulacaktır. destroy: success: Harç borcu silindi warning: Harç borcu silinemedi! + edit: + form_title: Harç Borcu Düzenleme form_bulk: create_tuition_debts: Harç Borçlarını Oluştur index: <<: *tuition_debt_attributes add_bulk_tuition_debt: Toplu Harç Borcu Ekle + add_personal_tuition_debt: Bireysel Harç Borcu Ekle card_header: Harç Borçları new: form_bulk_title: Toplu Harç Borcu Oluşturma + form_title: Kişiye Özel Harç Borcu Oluşturma + update: + success: Harç borcu başarıyla güncellendi. diff --git a/config/routes/tuition_management.rb b/config/routes/tuition_management.rb index dc358ec3d..c6965ad98 100644 --- a/config/routes/tuition_management.rb +++ b/config/routes/tuition_management.rb @@ -4,7 +4,7 @@ resources :tuitions, except: :show do get :units, on: :collection end - resources :tuition_debts, only: %i[index new destroy] do + resources :tuition_debts, except: :show do post :create_with_service, on: :collection end end From e5d5d6810e3154c9ff1e970349f93f0dd4dd81e9 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 2 Apr 2020 09:30:45 +0300 Subject: [PATCH 569/970] Add missing virtual attribute --- app/models/tuition_debt.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/tuition_debt.rb b/app/models/tuition_debt.rb index 8c3433264..747f1a342 100644 --- a/app/models/tuition_debt.rb +++ b/app/models/tuition_debt.rb @@ -2,7 +2,7 @@ class TuitionDebt < ApplicationRecord # virtual attributes - attr_accessor :unit_ids + attr_accessor :unit_ids, :unit_id # relations belongs_to :student From 591d0ffd3304173942eec40271e426c06c434e55 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 2 Apr 2020 12:51:07 +0300 Subject: [PATCH 570/970] Remove unneeded suffixes from relation names --- .../accreditation_standards_controller.rb | 2 +- .../learning_outcomes_controller.rb | 4 ++-- app/models/accreditation_standard.rb | 3 ++- app/models/learning_outcome.rb | 10 +++++----- app/validators/learning_outcome_validator.rb | 8 ++++---- .../learning_outcomes/_form.html.erb | 6 +++--- ...utcome_fields.html.erb => _micro_fields.html.erb} | 2 +- .../learning_outcomes/show.html.erb | 6 +++--- .../learning_outcomes_controller_test.rb | 10 +++++----- test/models/accreditation_standard_test.rb | 2 +- test/models/learning_outcome_test.rb | 12 ++++++------ 11 files changed, 33 insertions(+), 32 deletions(-) rename app/views/outcome_management/learning_outcomes/{_micro_outcome_fields.html.erb => _micro_fields.html.erb} (92%) diff --git a/app/controllers/outcome_management/accreditation_standards_controller.rb b/app/controllers/outcome_management/accreditation_standards_controller.rb index 2205269d7..f8a971789 100644 --- a/app/controllers/outcome_management/accreditation_standards_controller.rb +++ b/app/controllers/outcome_management/accreditation_standards_controller.rb @@ -16,7 +16,7 @@ def index end def show - @learning_outcomes = @accreditation_standard.macro_outcomes.ordered + @learning_outcomes = @accreditation_standard.macro_learning_outcomes.ordered end def new diff --git a/app/controllers/outcome_management/learning_outcomes_controller.rb b/app/controllers/outcome_management/learning_outcomes_controller.rb index 3d71ca194..b82614161 100644 --- a/app/controllers/outcome_management/learning_outcomes_controller.rb +++ b/app/controllers/outcome_management/learning_outcomes_controller.rb @@ -41,7 +41,7 @@ def set_accreditation_standard end def set_learning_outcome - @learning_outcome = @accreditation_standard.macro_outcomes.find(params[:id]) + @learning_outcome = @accreditation_standard.macro_learning_outcomes.find(params[:id]) end def authorized? @@ -51,7 +51,7 @@ def authorized? def learning_outcome_params params.require(:learning_outcome).permit( :code, :name, :accreditation_standard_id, - micro_outcomes_attributes: %i[id code name accreditation_standard_id _destroy] + micros_attributes: %i[id code name accreditation_standard_id _destroy] ) end end diff --git a/app/models/accreditation_standard.rb b/app/models/accreditation_standard.rb index 3460b3ff7..3e1bae5d8 100644 --- a/app/models/accreditation_standard.rb +++ b/app/models/accreditation_standard.rb @@ -12,8 +12,9 @@ class AccreditationStandard < ApplicationRecord # relations belongs_to :accreditation_institution - has_many :macro_outcomes, -> { where(parent_id: nil) }, class_name: 'LearningOutcome', inverse_of: :accreditation_standard has_many :learning_outcomes, dependent: :destroy + has_many :macro_learning_outcomes, -> { where(parent_id: nil) }, + class_name: 'LearningOutcome', inverse_of: :accreditation_standard has_many :unit_accreditation_standards, dependent: :destroy has_many :units, through: :unit_accreditation_standards diff --git a/app/models/learning_outcome.rb b/app/models/learning_outcome.rb index 1f1c68543..227396fff 100644 --- a/app/models/learning_outcome.rb +++ b/app/models/learning_outcome.rb @@ -3,11 +3,11 @@ class LearningOutcome < ApplicationRecord # relations belongs_to :accreditation_standard - belongs_to :macro_outcome, class_name: 'LearningOutcome', foreign_key: :parent_id, - inverse_of: :micro_outcomes, optional: true - has_many :micro_outcomes, class_name: 'LearningOutcome', foreign_key: :parent_id, - inverse_of: :macro_outcome, dependent: :destroy - accepts_nested_attributes_for :micro_outcomes, reject_if: :all_blank, allow_destroy: true + belongs_to :macro, class_name: 'LearningOutcome', foreign_key: :parent_id, + inverse_of: :micros, optional: true + has_many :micros, class_name: 'LearningOutcome', foreign_key: :parent_id, + inverse_of: :macro, dependent: :destroy + accepts_nested_attributes_for :micros, reject_if: :all_blank, allow_destroy: true # validations validates :code, presence: true, uniqueness: { scope: :accreditation_standard_id }, length: { maximum: 10 } diff --git a/app/validators/learning_outcome_validator.rb b/app/validators/learning_outcome_validator.rb index db892420c..0925e0c26 100644 --- a/app/validators/learning_outcome_validator.rb +++ b/app/validators/learning_outcome_validator.rb @@ -3,8 +3,8 @@ class LearningOutcomeValidator < ActiveModel::Validator def validate(record) @record = record - @micro_outcomes = record.micro_outcomes - @codes = @micro_outcomes.map(&:code).push(record.code) + @micros = record.micros + @codes = @micros.map(&:code).push(record.code) return if codes_unique? add_error_message_to_invalid_records @@ -18,8 +18,8 @@ def codes_unique? def add_error_message_to_invalid_records invalid_codes = @codes.select { |code| @codes.count(code) > 1 }.uniq - @micro_outcomes.each do |micro_outcome| - micro_outcome.errors.add(:code, message('must_be_uniq')) if invalid_codes.include?(micro_outcome.code) + @micros.each do |learning_outcome| + learning_outcome.errors.add(:code, message('must_be_uniq')) if invalid_codes.include?(learning_outcome.code) end @record.errors.add(:code, message('must_be_uniq')) if invalid_codes.include?(@record.code) diff --git a/app/views/outcome_management/learning_outcomes/_form.html.erb b/app/views/outcome_management/learning_outcomes/_form.html.erb index d770039a3..eddf6f42e 100644 --- a/app/views/outcome_management/learning_outcomes/_form.html.erb +++ b/app/views/outcome_management/learning_outcomes/_form.html.erb @@ -46,14 +46,14 @@
- <%= f.simple_fields_for :micro_outcomes do |outcome| %> - <%= render 'micro_outcome_fields', f: outcome %> + <%= f.simple_fields_for :micros do |learning_outcome| %> + <%= render 'micro_fields', f: learning_outcome %> <% end %>
diff --git a/app/views/outcome_management/learning_outcomes/_micro_outcome_fields.html.erb b/app/views/outcome_management/learning_outcomes/_micro_fields.html.erb similarity index 92% rename from app/views/outcome_management/learning_outcomes/_micro_outcome_fields.html.erb rename to app/views/outcome_management/learning_outcomes/_micro_fields.html.erb index 9739f8081..7683c967d 100644 --- a/app/views/outcome_management/learning_outcomes/_micro_outcome_fields.html.erb +++ b/app/views/outcome_management/learning_outcomes/_micro_fields.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/app/views/outcome_management/learning_outcomes/show.html.erb b/app/views/outcome_management/learning_outcomes/show.html.erb index 7639ea8b5..d5334ffcd 100644 --- a/app/views/outcome_management/learning_outcomes/show.html.erb +++ b/app/views/outcome_management/learning_outcomes/show.html.erb @@ -41,10 +41,10 @@ - <% @learning_outcome.micro_outcomes.each do |outcome| %> + <% @learning_outcome.micros.each do |learning_outcome| %> - <%= outcome.code %> - <%= outcome.name %> + <%= learning_outcome.code %> + <%= learning_outcome.name %> <% end %> diff --git a/test/controllers/outcome_management/learning_outcomes_controller_test.rb b/test/controllers/outcome_management/learning_outcomes_controller_test.rb index aecbd18f8..72a2d7ad7 100644 --- a/test/controllers/outcome_management/learning_outcomes_controller_test.rb +++ b/test/controllers/outcome_management/learning_outcomes_controller_test.rb @@ -25,18 +25,18 @@ class LearningOutcomesControllerTest < ActionDispatch::IntegrationTest post accreditation_standard_learning_outcomes_path(@accreditation_standard), params: { learning_outcome: { code: 'PÇ-3', name: 'Çözme ve uygulayabilme becerisi', - micro_outcomes_attributes: { + micros_attributes: { '0' => { accreditation_standard_id: @accreditation_standard.id, code: 'PÇ3-1', name: 'Çözme becerisi' } } } } end - learning_outcome = @accreditation_standard.macro_outcomes.last + learning_outcome = @accreditation_standard.macro_learning_outcomes.last assert_equal 'PÇ-3', learning_outcome.code assert_equal 'Çözme ve uygulayabilme becerisi', learning_outcome.name - assert_equal 1, learning_outcome.micro_outcomes.count + assert_equal 1, learning_outcome.micros.count assert_redirected_to accreditation_standard_path(@accreditation_standard) end @@ -50,7 +50,7 @@ class LearningOutcomesControllerTest < ActionDispatch::IntegrationTest patch accreditation_standard_learning_outcome_path(@accreditation_standard, @learning_outcome), params: { learning_outcome: { code: 'PÇ1', name: 'Seçme ve uygulama becerisi.', - micro_outcomes_attributes: { + micros_attributes: { '0' => { accreditation_standard_id: @accreditation_standard.id, code: 'PÇ1-1', name: 'Seçme becerisi.' } } } @@ -60,7 +60,7 @@ class LearningOutcomesControllerTest < ActionDispatch::IntegrationTest assert_equal 'PÇ1', @learning_outcome.code assert_equal 'Seçme ve uygulama becerisi.', @learning_outcome.name - assert_equal 'PÇ1-1', @learning_outcome.micro_outcomes.ordered.first.code + assert_equal 'PÇ1-1', @learning_outcome.micros.ordered.first.code assert_redirected_to accreditation_standard_path(@accreditation_standard) assert_equal translate('.update.success'), flash[:info] end diff --git a/test/models/accreditation_standard_test.rb b/test/models/accreditation_standard_test.rb index 44d7e05d0..636642c59 100644 --- a/test/models/accreditation_standard_test.rb +++ b/test/models/accreditation_standard_test.rb @@ -12,8 +12,8 @@ class AccreditationStandardTest < ActiveSupport::TestCase # relations belongs_to :accreditation_institution - has_many :macro_outcomes, class_name: 'LearningOutcome', inverse_of: :accreditation_standard has_many :learning_outcomes, dependent: :destroy + has_many :macro_learning_outcomes, class_name: 'LearningOutcome', inverse_of: :accreditation_standard has_many :unit_accreditation_standards, dependent: :destroy has_many :units, through: :unit_accreditation_standards diff --git a/test/models/learning_outcome_test.rb b/test/models/learning_outcome_test.rb index 00e30ca17..4dfbad0dd 100644 --- a/test/models/learning_outcome_test.rb +++ b/test/models/learning_outcome_test.rb @@ -8,11 +8,11 @@ class LearningOutcomeTest < ActiveSupport::TestCase # relations belongs_to :accreditation_standard - belongs_to :macro_outcome, class_name: 'LearningOutcome', foreign_key: :parent_id, - inverse_of: :micro_outcomes, optional: true - has_many :micro_outcomes, class_name: 'LearningOutcome', foreign_key: :parent_id, - inverse_of: :macro_outcome, dependent: :destroy - accepts_nested_attributes_for :micro_outcomes, allow_destroy: true + belongs_to :macro, class_name: 'LearningOutcome', foreign_key: :parent_id, + inverse_of: :micros, optional: true + has_many :micros, class_name: 'LearningOutcome', foreign_key: :parent_id, + inverse_of: :macro, dependent: :destroy + accepts_nested_attributes_for :micros, allow_destroy: true # validations: presence validates_presence_of :code @@ -31,7 +31,7 @@ class LearningOutcomeTest < ActiveSupport::TestCase # scopes test 'ordered returns learning outcomes ordered by code' do - learning_outcomes = accreditation_standards(:one).macro_outcomes.ordered + learning_outcomes = accreditation_standards(:one).macro_learning_outcomes.ordered assert_equal learning_outcomes(:one), learning_outcomes.first assert_equal learning_outcomes(:four), learning_outcomes.last end From 62f1713f6afd12996bb857daaeb88df164fd694a Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 2 Apr 2020 13:54:10 +0300 Subject: [PATCH 571/970] Change outcome_management to accreditation_management --- .../accreditation_standards_controller.rb | 4 ++-- .../learning_outcomes_controller.rb | 4 ++-- .../accreditation_standard_policy.rb | 4 ++-- .../learning_outcome_policy.rb | 4 ++-- .../accreditation_standards/_form.html.erb | 0 .../accreditation_standards/_search.html.erb | 0 .../accreditation_standards/_select2.html.erb | 0 .../accreditation_standards/edit.html.erb | 0 .../accreditation_standards/index.html.erb | 0 .../accreditation_standards/new.html.erb | 0 .../accreditation_standards/show.html.erb | 0 .../accreditation_standards/units.json.jbuilder | 0 .../learning_outcomes/_form.html.erb | 0 .../learning_outcomes/_micro_fields.html.erb | 0 .../learning_outcomes/edit.html.erb | 0 .../learning_outcomes/index.html.erb | 0 .../learning_outcomes/new.html.erb | 0 .../learning_outcomes/show.html.erb | 0 app/views/layouts/shared/menus/_admin.html.erb | 2 +- config/initializers/role_management.rb | 8 ++++---- .../accreditation_standards.en.yml | 2 +- .../accreditation_standards.tr.yml | 2 +- .../learning_outcomes.en.yml | 4 ++-- .../learning_outcomes.tr.yml | 2 +- config/routes.rb | 2 +- ...{outcome_management.rb => accreditation_management.rb} | 2 +- .../accreditation_standards_controller_test.rb | 4 ++-- .../learning_outcomes_controller_test.rb | 4 ++-- test/fixtures/patron/permissions.yml | 4 ++-- test/fixtures/patron/role_permissions.yml | 2 +- .../accreditation_standard_policy_test.rb | 2 +- .../learning_outcome_policy_test.rb | 2 +- 32 files changed, 29 insertions(+), 29 deletions(-) rename app/controllers/{outcome_management => accreditation_management}/accreditation_standards_controller.rb (93%) rename app/controllers/{outcome_management => accreditation_management}/learning_outcomes_controller.rb (93%) rename app/policies/{outcome_management => accreditation_management}/accreditation_standard_policy.rb (71%) rename app/policies/{outcome_management => accreditation_management}/learning_outcome_policy.rb (68%) rename app/views/{outcome_management => accreditation_management}/accreditation_standards/_form.html.erb (100%) rename app/views/{outcome_management => accreditation_management}/accreditation_standards/_search.html.erb (100%) rename app/views/{outcome_management => accreditation_management}/accreditation_standards/_select2.html.erb (100%) rename app/views/{outcome_management => accreditation_management}/accreditation_standards/edit.html.erb (100%) rename app/views/{outcome_management => accreditation_management}/accreditation_standards/index.html.erb (100%) rename app/views/{outcome_management => accreditation_management}/accreditation_standards/new.html.erb (100%) rename app/views/{outcome_management => accreditation_management}/accreditation_standards/show.html.erb (100%) rename app/views/{outcome_management => accreditation_management}/accreditation_standards/units.json.jbuilder (100%) rename app/views/{outcome_management => accreditation_management}/learning_outcomes/_form.html.erb (100%) rename app/views/{outcome_management => accreditation_management}/learning_outcomes/_micro_fields.html.erb (100%) rename app/views/{outcome_management => accreditation_management}/learning_outcomes/edit.html.erb (100%) rename app/views/{outcome_management => accreditation_management}/learning_outcomes/index.html.erb (100%) rename app/views/{outcome_management => accreditation_management}/learning_outcomes/new.html.erb (100%) rename app/views/{outcome_management => accreditation_management}/learning_outcomes/show.html.erb (100%) rename config/locales/controllers/{outcome_management => accreditation_management}/accreditation_standards.en.yml (98%) rename config/locales/controllers/{outcome_management => accreditation_management}/accreditation_standards.tr.yml (98%) rename config/locales/controllers/{outcome_management => accreditation_management}/learning_outcomes.en.yml (96%) rename config/locales/controllers/{outcome_management => accreditation_management}/learning_outcomes.tr.yml (97%) rename config/routes/{outcome_management.rb => accreditation_management.rb} (79%) rename test/controllers/{outcome_management => accreditation_management}/accreditation_standards_controller_test.rb (97%) rename test/controllers/{outcome_management => accreditation_management}/learning_outcomes_controller_test.rb (96%) rename test/policies/{outcome_management => accreditation_management}/accreditation_standard_policy_test.rb (92%) rename test/policies/{outcome_management => accreditation_management}/learning_outcome_policy_test.rb (91%) diff --git a/app/controllers/outcome_management/accreditation_standards_controller.rb b/app/controllers/accreditation_management/accreditation_standards_controller.rb similarity index 93% rename from app/controllers/outcome_management/accreditation_standards_controller.rb rename to app/controllers/accreditation_management/accreditation_standards_controller.rb index f8a971789..f50add428 100644 --- a/app/controllers/outcome_management/accreditation_standards_controller.rb +++ b/app/controllers/accreditation_management/accreditation_standards_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module OutcomeManagement +module AccreditationManagement class AccreditationStandardsController < ApplicationController include SearchableModule @@ -55,7 +55,7 @@ def set_accreditation_standard end def authorized? - authorize([:outcome_management, @accreditation_standard || AccreditationStandard]) + authorize([:accreditation_management, @accreditation_standard || AccreditationStandard]) end def accreditation_standard_params diff --git a/app/controllers/outcome_management/learning_outcomes_controller.rb b/app/controllers/accreditation_management/learning_outcomes_controller.rb similarity index 93% rename from app/controllers/outcome_management/learning_outcomes_controller.rb rename to app/controllers/accreditation_management/learning_outcomes_controller.rb index b82614161..2328ddf67 100644 --- a/app/controllers/outcome_management/learning_outcomes_controller.rb +++ b/app/controllers/accreditation_management/learning_outcomes_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module OutcomeManagement +module AccreditationManagement class LearningOutcomesController < ApplicationController include SearchableModule @@ -45,7 +45,7 @@ def set_learning_outcome end def authorized? - authorize([:outcome_management, @learning_outcome || LearningOutcome]) + authorize([:accreditation_management, @learning_outcome || LearningOutcome]) end def learning_outcome_params diff --git a/app/policies/outcome_management/accreditation_standard_policy.rb b/app/policies/accreditation_management/accreditation_standard_policy.rb similarity index 71% rename from app/policies/outcome_management/accreditation_standard_policy.rb rename to app/policies/accreditation_management/accreditation_standard_policy.rb index 826f56bd4..100f4ee05 100644 --- a/app/policies/outcome_management/accreditation_standard_policy.rb +++ b/app/policies/accreditation_management/accreditation_standard_policy.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module OutcomeManagement +module AccreditationManagement class AccreditationStandardPolicy < ApplicationPolicy include CrudPolicyMethods @@ -11,7 +11,7 @@ def units? private def permitted?(*privileges) - user.privilege? :outcome_management, privileges + user.privilege? :accreditation_management, privileges end end end diff --git a/app/policies/outcome_management/learning_outcome_policy.rb b/app/policies/accreditation_management/learning_outcome_policy.rb similarity index 68% rename from app/policies/outcome_management/learning_outcome_policy.rb rename to app/policies/accreditation_management/learning_outcome_policy.rb index 5b70f2d17..7809a068f 100644 --- a/app/policies/outcome_management/learning_outcome_policy.rb +++ b/app/policies/accreditation_management/learning_outcome_policy.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module OutcomeManagement +module AccreditationManagement class LearningOutcomePolicy < ApplicationPolicy include CrudPolicyMethods @@ -9,7 +9,7 @@ class LearningOutcomePolicy < ApplicationPolicy private def permitted?(*privileges) - user.privilege? :outcome_management, privileges + user.privilege? :accreditation_management, privileges end end end diff --git a/app/views/outcome_management/accreditation_standards/_form.html.erb b/app/views/accreditation_management/accreditation_standards/_form.html.erb similarity index 100% rename from app/views/outcome_management/accreditation_standards/_form.html.erb rename to app/views/accreditation_management/accreditation_standards/_form.html.erb diff --git a/app/views/outcome_management/accreditation_standards/_search.html.erb b/app/views/accreditation_management/accreditation_standards/_search.html.erb similarity index 100% rename from app/views/outcome_management/accreditation_standards/_search.html.erb rename to app/views/accreditation_management/accreditation_standards/_search.html.erb diff --git a/app/views/outcome_management/accreditation_standards/_select2.html.erb b/app/views/accreditation_management/accreditation_standards/_select2.html.erb similarity index 100% rename from app/views/outcome_management/accreditation_standards/_select2.html.erb rename to app/views/accreditation_management/accreditation_standards/_select2.html.erb diff --git a/app/views/outcome_management/accreditation_standards/edit.html.erb b/app/views/accreditation_management/accreditation_standards/edit.html.erb similarity index 100% rename from app/views/outcome_management/accreditation_standards/edit.html.erb rename to app/views/accreditation_management/accreditation_standards/edit.html.erb diff --git a/app/views/outcome_management/accreditation_standards/index.html.erb b/app/views/accreditation_management/accreditation_standards/index.html.erb similarity index 100% rename from app/views/outcome_management/accreditation_standards/index.html.erb rename to app/views/accreditation_management/accreditation_standards/index.html.erb diff --git a/app/views/outcome_management/accreditation_standards/new.html.erb b/app/views/accreditation_management/accreditation_standards/new.html.erb similarity index 100% rename from app/views/outcome_management/accreditation_standards/new.html.erb rename to app/views/accreditation_management/accreditation_standards/new.html.erb diff --git a/app/views/outcome_management/accreditation_standards/show.html.erb b/app/views/accreditation_management/accreditation_standards/show.html.erb similarity index 100% rename from app/views/outcome_management/accreditation_standards/show.html.erb rename to app/views/accreditation_management/accreditation_standards/show.html.erb diff --git a/app/views/outcome_management/accreditation_standards/units.json.jbuilder b/app/views/accreditation_management/accreditation_standards/units.json.jbuilder similarity index 100% rename from app/views/outcome_management/accreditation_standards/units.json.jbuilder rename to app/views/accreditation_management/accreditation_standards/units.json.jbuilder diff --git a/app/views/outcome_management/learning_outcomes/_form.html.erb b/app/views/accreditation_management/learning_outcomes/_form.html.erb similarity index 100% rename from app/views/outcome_management/learning_outcomes/_form.html.erb rename to app/views/accreditation_management/learning_outcomes/_form.html.erb diff --git a/app/views/outcome_management/learning_outcomes/_micro_fields.html.erb b/app/views/accreditation_management/learning_outcomes/_micro_fields.html.erb similarity index 100% rename from app/views/outcome_management/learning_outcomes/_micro_fields.html.erb rename to app/views/accreditation_management/learning_outcomes/_micro_fields.html.erb diff --git a/app/views/outcome_management/learning_outcomes/edit.html.erb b/app/views/accreditation_management/learning_outcomes/edit.html.erb similarity index 100% rename from app/views/outcome_management/learning_outcomes/edit.html.erb rename to app/views/accreditation_management/learning_outcomes/edit.html.erb diff --git a/app/views/outcome_management/learning_outcomes/index.html.erb b/app/views/accreditation_management/learning_outcomes/index.html.erb similarity index 100% rename from app/views/outcome_management/learning_outcomes/index.html.erb rename to app/views/accreditation_management/learning_outcomes/index.html.erb diff --git a/app/views/outcome_management/learning_outcomes/new.html.erb b/app/views/accreditation_management/learning_outcomes/new.html.erb similarity index 100% rename from app/views/outcome_management/learning_outcomes/new.html.erb rename to app/views/accreditation_management/learning_outcomes/new.html.erb diff --git a/app/views/outcome_management/learning_outcomes/show.html.erb b/app/views/accreditation_management/learning_outcomes/show.html.erb similarity index 100% rename from app/views/outcome_management/learning_outcomes/show.html.erb rename to app/views/accreditation_management/learning_outcomes/show.html.erb diff --git a/app/views/layouts/shared/menus/_admin.html.erb b/app/views/layouts/shared/menus/_admin.html.erb index 33a748d07..e0d0b9721 100644 --- a/app/views/layouts/shared/menus/_admin.html.erb +++ b/app/views/layouts/shared/menus/_admin.html.erb @@ -65,7 +65,7 @@ <%= fa_icon('dot-circle-o', class: 'nav-icon') %><%= t('.learning_outcomes') %> diff --git a/config/locales/layouts/shared/sidebar.en.yml b/config/locales/layouts/shared/sidebar.en.yml index e781d6e64..a77597e30 100644 --- a/config/locales/layouts/shared/sidebar.en.yml +++ b/config/locales/layouts/shared/sidebar.en.yml @@ -29,6 +29,7 @@ en: prospective_students: Prospective Students references: References registration_documents: Registration Documents + tuition_debts: Tuition Debts tuition_management: Tuition Management units: Units unit_tuitions: Unit Tuitions diff --git a/config/locales/layouts/shared/sidebar.tr.yml b/config/locales/layouts/shared/sidebar.tr.yml index 946b07a70..a9ee7b431 100644 --- a/config/locales/layouts/shared/sidebar.tr.yml +++ b/config/locales/layouts/shared/sidebar.tr.yml @@ -29,6 +29,7 @@ tr: prospective_students: Aday Öğrenciler references: Tanımlar registration_documents: İstenen Belgeler + tuition_debts: Harç Borçları tuition_management: Harç Yönetimi units: Birimler unit_tuitions: Birim Harç Ücretleri From 9215de8d14d9c99b944f389cdebacedd5fec47dc Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 7 Apr 2020 13:04:57 +0300 Subject: [PATCH 586/970] Refactor evening education chain --- app/jobs/debt/tuition_debt_job.rb | 2 +- .../debt/tuition/process/evening_education.rb | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/jobs/debt/tuition_debt_job.rb b/app/jobs/debt/tuition_debt_job.rb index b5229c2e4..ff1eeac71 100644 --- a/app/jobs/debt/tuition_debt_job.rb +++ b/app/jobs/debt/tuition_debt_job.rb @@ -22,7 +22,7 @@ def perform(unit_ids, term_id) def set_chain(unit, student) if unit.evening? - Debt::Tuition::Process::EveningEducation.chain + Debt::Tuition::Process::EveningEducation.new(student).chain else Debt::Tuition::Process::DaytimeEducation.new(student).chain end diff --git a/app/services/debt/tuition/process/evening_education.rb b/app/services/debt/tuition/process/evening_education.rb index dc65161f6..2964ee0e3 100644 --- a/app/services/debt/tuition/process/evening_education.rb +++ b/app/services/debt/tuition/process/evening_education.rb @@ -8,8 +8,20 @@ module Debt module Tuition module Process class EveningEducation - def self.chain - Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) + attr_reader :student + + delegate :exceeded_education_period, to: :student + + def initialize(student) + @student = student + end + + def chain + if student.exceeded_education_period + Operation::Disability.new(Operation::NoDiscount.new) + else + Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) + end end end end From 4a080628ca10c5e78a44971026739ee47446bc03 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 7 Apr 2020 14:10:15 +0300 Subject: [PATCH 587/970] Check other studentship status in daytime education process --- app/models/student.rb | 4 ++++ .../debt/tuition/process/daytime_education.rb | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/models/student.rb b/app/models/student.rb index 7ff8f11e1..9ced572a2 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -71,6 +71,10 @@ def scholarship? scholarship_type_id? end + def prospective_student + user.prospective_students.find_by(unit_id: unit_id) + end + private def build_identity_information diff --git a/app/services/debt/tuition/process/daytime_education.rb b/app/services/debt/tuition/process/daytime_education.rb index fb73f85b0..ceb401b2a 100644 --- a/app/services/debt/tuition/process/daytime_education.rb +++ b/app/services/debt/tuition/process/daytime_education.rb @@ -17,12 +17,25 @@ def initialize(student) end def chain - if student.exceeded_education_period + if exceeded? || other_studentship? Operation::Disability.new(Operation::NoDiscount.new) else Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) end end + + private + + def exceeded? + student.exceeded_education_period + end + + def other_studentship? + status = student.prospective_student&.obs_status + return true if status.nil? + + !status + end end end end From f36cd362a89d71ac9c83fbb6aed8d82352657c2e Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 7 Apr 2020 16:32:23 +0300 Subject: [PATCH 588/970] Add search form for tuition debts --- .../tuition_debts_controller.rb | 9 ++- app/models/tuition_debt.rb | 7 ++ .../tuition_debts/_search.html.erb | 79 +++++++++++++++++++ .../tuition_debts/index.html.erb | 8 +- .../tuitions/index.html.erb | 2 +- .../tuition_management/tuition_debts.en.yml | 2 + .../tuition_management/tuition_debts.tr.yml | 2 + 7 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 app/views/tuition_management/tuition_debts/_search.html.erb diff --git a/app/controllers/tuition_management/tuition_debts_controller.rb b/app/controllers/tuition_management/tuition_debts_controller.rb index a96017b5c..973909bd2 100644 --- a/app/controllers/tuition_management/tuition_debts_controller.rb +++ b/app/controllers/tuition_management/tuition_debts_controller.rb @@ -2,10 +2,17 @@ module TuitionManagement class TuitionDebtsController < ApplicationController + include SearchableModule + before_action :set_tuition_debt, only: %i[edit update destroy] def index - @tuition_debts = TuitionDebt.includes(:academic_term, student: %i[unit user]) + tuition_debts = + TuitionDebt.includes(:academic_term, unit_tuition: :unit, student: :user).joins(:unit).where( + params[:unit_id].present? ? { units: { id: params[:unit_id] } } : {} + ) + + @pagy, @tuition_debts = pagy(tuition_debts.dynamic_search(search_params(TuitionDebt))) end def new diff --git a/app/models/tuition_debt.rb b/app/models/tuition_debt.rb index 20517a6a5..4f199aba2 100644 --- a/app/models/tuition_debt.rb +++ b/app/models/tuition_debt.rb @@ -6,6 +6,12 @@ class TuitionDebt < ApplicationRecord # virtual attributes attr_accessor :unit_ids, :unit_id + # search + include DynamicSearch + + # dynamic_search + search_keys :academic_term_id, :student_id + # enums enum type: { personal: 1, bulk: 2 } @@ -13,6 +19,7 @@ class TuitionDebt < ApplicationRecord belongs_to :student belongs_to :academic_term belongs_to :unit_tuition, optional: true + has_one :unit, through: :unit_tuition # validations validates :amount, numericality: { greater_than: 0 } diff --git a/app/views/tuition_management/tuition_debts/_search.html.erb b/app/views/tuition_management/tuition_debts/_search.html.erb new file mode 100644 index 000000000..ad3152966 --- /dev/null +++ b/app/views/tuition_management/tuition_debts/_search.html.erb @@ -0,0 +1,79 @@ +
+
+ +
+
+ <%= form_tag tuition_debts_path, method: :get do %> +
+
+ <%= label_tag(:unit_id, t('.unit')) %> + <%= select_tag(:unit_id, + options_from_collection_for_select(Unit.active.programs.order(:name), :id, :names_depth_cache, params[:unit_id]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %> +
+
+ <%= label_tag(:student_id, t('.student')) %> + <%= select_tag(:student_id, + include_blank: true, + class: 'form-control', + style: 'width: 100%') %> +
+
+ <%= label_tag(:academic_term_id, t('.academic_term')) %> + <%= select_tag(:academic_term_id, + options_from_collection_for_select(AcademicTerm.all, :id, lambda { |term| full_name(term) }, params[:academic_term_id]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %> +
+
+
+
+ <%= submit_tag t('search'), class: 'btn btn-primary' %> +
+
+ <% end %> +
+
+
+
+ + diff --git a/app/views/tuition_management/tuition_debts/index.html.erb b/app/views/tuition_management/tuition_debts/index.html.erb index 1f63bae24..6f92cd0df 100644 --- a/app/views/tuition_management/tuition_debts/index.html.erb +++ b/app/views/tuition_management/tuition_debts/index.html.erb @@ -9,6 +9,7 @@
+ <%= render 'search' %> @@ -25,7 +26,7 @@ <% @tuition_debts.each do |debt| %> - + @@ -37,5 +38,10 @@
<%= full_name(debt.academic_term) %><%= debt.student.unit.name %><%= debt.unit_tuition.unit.name %> <%= full_name(debt.student.user.identities.formal.first)%> <%= number_to_currency(debt.amount) %> <%= debt.description %>
+
diff --git a/app/views/tuition_management/tuitions/index.html.erb b/app/views/tuition_management/tuitions/index.html.erb index 2814c7eb5..1e9acd41c 100644 --- a/app/views/tuition_management/tuitions/index.html.erb +++ b/app/views/tuition_management/tuitions/index.html.erb @@ -8,7 +8,7 @@
- <%= render 'search' %> + <%= render 'search' %> diff --git a/config/locales/controllers/tuition_management/tuition_debts.en.yml b/config/locales/controllers/tuition_management/tuition_debts.en.yml index 93fd40b4e..c99774104 100644 --- a/config/locales/controllers/tuition_management/tuition_debts.en.yml +++ b/config/locales/controllers/tuition_management/tuition_debts.en.yml @@ -31,5 +31,7 @@ en: new: form_bulk_title: Create Bulk Tuition Debt form_title: Create Personal Tuition Debt + search: + <<: *tuition_debt_attributes update: success: Tuition debt successfully updated. diff --git a/config/locales/controllers/tuition_management/tuition_debts.tr.yml b/config/locales/controllers/tuition_management/tuition_debts.tr.yml index 3cc36573d..ca20dc3ee 100644 --- a/config/locales/controllers/tuition_management/tuition_debts.tr.yml +++ b/config/locales/controllers/tuition_management/tuition_debts.tr.yml @@ -31,5 +31,7 @@ tr: new: form_bulk_title: Toplu Harç Borcu Oluşturma form_title: Kişiye Özel Harç Borcu Oluşturma + search: + <<: *tuition_debt_attributes update: success: Harç borcu başarıyla güncellendi. From eacce63d184d56b65c46686fd4158c416853c4c7 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 7 Apr 2020 16:40:36 +0300 Subject: [PATCH 589/970] Minor changes --- app/controllers/tuition_management/tuition_debts_controller.rb | 2 +- app/views/tuition_management/tuition_debts/_search.html.erb | 2 +- app/views/tuition_management/tuition_debts/index.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/tuition_management/tuition_debts_controller.rb b/app/controllers/tuition_management/tuition_debts_controller.rb index 973909bd2..bf26bf241 100644 --- a/app/controllers/tuition_management/tuition_debts_controller.rb +++ b/app/controllers/tuition_management/tuition_debts_controller.rb @@ -8,7 +8,7 @@ class TuitionDebtsController < ApplicationController def index tuition_debts = - TuitionDebt.includes(:academic_term, unit_tuition: :unit, student: :user).joins(:unit).where( + TuitionDebt.includes(:academic_term, :unit, student: :user).joins(:unit).where( params[:unit_id].present? ? { units: { id: params[:unit_id] } } : {} ) diff --git a/app/views/tuition_management/tuition_debts/_search.html.erb b/app/views/tuition_management/tuition_debts/_search.html.erb index ad3152966..14b98b331 100644 --- a/app/views/tuition_management/tuition_debts/_search.html.erb +++ b/app/views/tuition_management/tuition_debts/_search.html.erb @@ -38,7 +38,7 @@ class: 'form-control', style: 'width: 100%') %> -
+
<%= label_tag(:academic_term_id, t('.academic_term')) %> <%= select_tag(:academic_term_id, options_from_collection_for_select(AcademicTerm.all, :id, lambda { |term| full_name(term) }, params[:academic_term_id]), diff --git a/app/views/tuition_management/tuition_debts/index.html.erb b/app/views/tuition_management/tuition_debts/index.html.erb index 6f92cd0df..1a1483a65 100644 --- a/app/views/tuition_management/tuition_debts/index.html.erb +++ b/app/views/tuition_management/tuition_debts/index.html.erb @@ -26,7 +26,7 @@ <% @tuition_debts.each do |debt| %>
- + From 35fbfb0b7e950ed7e87a217edc65efe45a369a12 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 8 Apr 2020 13:27:04 +0300 Subject: [PATCH 590/970] Fix method in daytime education process --- app/services/debt/tuition/process/daytime_education.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/debt/tuition/process/daytime_education.rb b/app/services/debt/tuition/process/daytime_education.rb index ceb401b2a..e823e3011 100644 --- a/app/services/debt/tuition/process/daytime_education.rb +++ b/app/services/debt/tuition/process/daytime_education.rb @@ -30,9 +30,10 @@ def exceeded? student.exceeded_education_period end + # TODO: This information shouldn't be obtained from prospective student def other_studentship? status = student.prospective_student&.obs_status - return true if status.nil? + return false if status.nil? !status end From 575f3958cba9cbc0094814eb73afbcc146feb385 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 9 Apr 2020 09:40:41 +0300 Subject: [PATCH 591/970] Remove redundant relative path --- app/services/debt/tuition/operation/creation.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/services/debt/tuition/operation/creation.rb b/app/services/debt/tuition/operation/creation.rb index e8306c880..f67fe9b4b 100644 --- a/app/services/debt/tuition/operation/creation.rb +++ b/app/services/debt/tuition/operation/creation.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require_relative '../tuition_handler' - module Debt module Tuition module Operation From 994d0f609f6f3ce193a1ac66a094da743250cc56 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 9 Apr 2020 09:41:51 +0300 Subject: [PATCH 592/970] Add description translates for tuition debt service --- app/services/debt/tuition/operation/disability.rb | 2 +- app/services/debt/tuition/operation/no_discount.rb | 2 +- .../controllers/tuition_management/tuition_debts.en.yml | 3 +++ .../controllers/tuition_management/tuition_debts.tr.yml | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/services/debt/tuition/operation/disability.rb b/app/services/debt/tuition/operation/disability.rb index 5f81fec97..f398109cd 100644 --- a/app/services/debt/tuition/operation/disability.rb +++ b/app/services/debt/tuition/operation/disability.rb @@ -24,7 +24,7 @@ def compute(params) end def description - 'Engel durumu göz önünde bulundurularak harç borcu oluşturulmuştur.' + I18n.t('.tuition_management.tuition_debts.descriptions.disability') end end end diff --git a/app/services/debt/tuition/operation/no_discount.rb b/app/services/debt/tuition/operation/no_discount.rb index 29bd4eec8..b3fc3ff5d 100644 --- a/app/services/debt/tuition/operation/no_discount.rb +++ b/app/services/debt/tuition/operation/no_discount.rb @@ -19,7 +19,7 @@ def fulfill?(_params) private def description - 'Hiç bir indirim yapılmadan harç borcu oluşturulmuştur.' + I18n.t('.tuition_management.tuition_debts.descriptions.no_discount') end end end diff --git a/config/locales/controllers/tuition_management/tuition_debts.en.yml b/config/locales/controllers/tuition_management/tuition_debts.en.yml index c99774104..979ebb613 100644 --- a/config/locales/controllers/tuition_management/tuition_debts.en.yml +++ b/config/locales/controllers/tuition_management/tuition_debts.en.yml @@ -16,6 +16,9 @@ en: success: Tuition debt successfully created. create_with_service: will_update: Tuition debts will be created in a couple of seconds/minutes. + descriptions: + disability: It was created with calculating the disability rate. + no_discount: It was created without any discount. destroy: success: Tuition debt successfully deleted. warning: Tuition debt can not be deleted! diff --git a/config/locales/controllers/tuition_management/tuition_debts.tr.yml b/config/locales/controllers/tuition_management/tuition_debts.tr.yml index ca20dc3ee..70986de24 100644 --- a/config/locales/controllers/tuition_management/tuition_debts.tr.yml +++ b/config/locales/controllers/tuition_management/tuition_debts.tr.yml @@ -16,6 +16,9 @@ tr: success: Harç borcu başarıyla oluşturuldu. create_with_service: will_update: Harç borçları bir kaç saniye/dakika içerisinde oluşturulacaktır. + descriptions: + disability: Engel oranı hesaba katılarak oluşturulmuştur. + no_discount: Hiç bir indirim yapılmadan oluşturulmuştur. destroy: success: Harç borcu silindi warning: Harç borcu silinemedi! From 8724594b4d99a5baa7915d2ae5f0e3c5ea6b80ce Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 9 Apr 2020 09:42:46 +0300 Subject: [PATCH 593/970] Don't anything if student have scholarship --- .../debt/tuition/operation/scholarship.rb | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/app/services/debt/tuition/operation/scholarship.rb b/app/services/debt/tuition/operation/scholarship.rb index a4885be6b..6511316ec 100644 --- a/app/services/debt/tuition/operation/scholarship.rb +++ b/app/services/debt/tuition/operation/scholarship.rb @@ -6,26 +6,13 @@ module Debt module Tuition module Operation class Scholarship < TuitionHandler - include Creation - - def operate(params) - compute(params) - create_debt(params, description) + def operate(_params) + nil end def fulfill?(params) params.student.scholarship? end - - private - - def compute(params) - params.amount = 1 - end - - def description - 'Burslu olduğu sembolik 1 lira borçlandırılmıştır.' - end end end end From 0de810beb113b01575c754ca6fe6e1115308fe53 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 9 Apr 2020 13:02:30 +0300 Subject: [PATCH 594/970] Check if tuition exists --- app/jobs/debt/tuition_debt_job.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/jobs/debt/tuition_debt_job.rb b/app/jobs/debt/tuition_debt_job.rb index ff1eeac71..7a6e10c67 100644 --- a/app/jobs/debt/tuition_debt_job.rb +++ b/app/jobs/debt/tuition_debt_job.rb @@ -14,7 +14,9 @@ def perform(unit_ids, term_id) unit.students.active.each do |student| chain = set_chain(unit, student) tuition = unit.tuitions.find_by(academic_term_id: @term_id) - debt = Debt::Tuition::TuitionDebt.new(student, tuition.unit_tuitions.first) + next if tuition.nil? + + debt = Debt::Tuition::TuitionDebt.new(student, tuition.unit_tuitions.first) chain.call(debt) end end From 18df809b9a3a5561620934a2fed24f67e95a31c0 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 9 Apr 2020 14:41:15 +0300 Subject: [PATCH 595/970] Create dispatch module --- app/jobs/debt/tuition_debt_job.rb | 24 ++----------------- app/services/debt/tuition/dispatch.rb | 33 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 22 deletions(-) create mode 100644 app/services/debt/tuition/dispatch.rb diff --git a/app/jobs/debt/tuition_debt_job.rb b/app/jobs/debt/tuition_debt_job.rb index 7a6e10c67..927df2352 100644 --- a/app/jobs/debt/tuition_debt_job.rb +++ b/app/jobs/debt/tuition_debt_job.rb @@ -5,29 +5,9 @@ class TuitionDebtJob < ApplicationJob queue_as :high def perform(unit_ids, term_id) - @units = Unit.find(unit_ids.reject(&:empty?)) - @term_id = term_id - end - - after_perform do |debt| - [@units].flatten.compact.each do |unit| - unit.students.active.each do |student| - chain = set_chain(unit, student) - tuition = unit.tuitions.find_by(academic_term_id: @term_id) - next if tuition.nil? - - debt = Debt::Tuition::TuitionDebt.new(student, tuition.unit_tuitions.first) - chain.call(debt) - end - end - end + units = Unit.find(unit_ids.reject(&:empty?)) - def set_chain(unit, student) - if unit.evening? - Debt::Tuition::Process::EveningEducation.new(student).chain - else - Debt::Tuition::Process::DaytimeEducation.new(student).chain - end + Debt::Tuition::Dispatch.perform([units].flatten.compact, term_id) end end end diff --git a/app/services/debt/tuition/dispatch.rb b/app/services/debt/tuition/dispatch.rb new file mode 100644 index 000000000..84ab352e3 --- /dev/null +++ b/app/services/debt/tuition/dispatch.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require_relative 'process/daytime_education' +require_relative 'process/evening_education' + +module Debt + module Tuition + module Dispatch + module_function + + def perform(units, academic_term) + units.each do |unit| + unit.students.active.each do |student| + chain = set_chain(unit, student) + tuition = unit.tuitions.find_by(academic_term_id: academic_term) + next if tuition.nil? + + debt = TuitionDebt.new(student, tuition.unit_tuitions.first) + chain.call(debt) + end + end + end + + def set_chain(unit, student) + if unit.evening? + Process::EveningEducation.new(student).chain + else + Process::DaytimeEducation.new(student).chain + end + end + end + end +end From 1ece251c807c8a9ed5fe7f0c4a0443a7fe12bf8d Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 9 Apr 2020 16:16:26 +0300 Subject: [PATCH 596/970] Add free process to debt --- app/services/debt/tuition/operation/free.rb | 19 +++++++++++++++++++ .../debt/tuition/process/daytime_education.rb | 5 +++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 app/services/debt/tuition/operation/free.rb diff --git a/app/services/debt/tuition/operation/free.rb b/app/services/debt/tuition/operation/free.rb new file mode 100644 index 000000000..91b0e4766 --- /dev/null +++ b/app/services/debt/tuition/operation/free.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative '../tuition_handler' + +module Debt + module Tuition + module Operation + class Free < TuitionHandler + def operate(_params) + nil + end + + def fulfill?(_params) + true + end + end + end + end +end diff --git a/app/services/debt/tuition/process/daytime_education.rb b/app/services/debt/tuition/process/daytime_education.rb index e823e3011..0949094e7 100644 --- a/app/services/debt/tuition/process/daytime_education.rb +++ b/app/services/debt/tuition/process/daytime_education.rb @@ -1,8 +1,9 @@ # frozen_string_literal: true -require_relative '../operation/scholarship' require_relative '../operation/disability' +require_relative '../operation/free' require_relative '../operation/no_discount' +require_relative '../operation/scholarship' module Debt module Tuition @@ -20,7 +21,7 @@ def chain if exceeded? || other_studentship? Operation::Disability.new(Operation::NoDiscount.new) else - Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) + Operation::Free.new end end From 0ff58ef7b9845f8acf9826890ef17b203b0b75ba Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 9 Apr 2020 16:28:07 +0300 Subject: [PATCH 597/970] Remove redundant delegates --- app/services/debt/tuition/process/daytime_education.rb | 2 -- app/services/debt/tuition/process/evening_education.rb | 2 -- 2 files changed, 4 deletions(-) diff --git a/app/services/debt/tuition/process/daytime_education.rb b/app/services/debt/tuition/process/daytime_education.rb index 0949094e7..96bd2b808 100644 --- a/app/services/debt/tuition/process/daytime_education.rb +++ b/app/services/debt/tuition/process/daytime_education.rb @@ -11,8 +11,6 @@ module Process class DaytimeEducation attr_reader :student - delegate :exceeded_education_period, to: :student - def initialize(student) @student = student end diff --git a/app/services/debt/tuition/process/evening_education.rb b/app/services/debt/tuition/process/evening_education.rb index 2964ee0e3..f507b0ff0 100644 --- a/app/services/debt/tuition/process/evening_education.rb +++ b/app/services/debt/tuition/process/evening_education.rb @@ -10,8 +10,6 @@ module Process class EveningEducation attr_reader :student - delegate :exceeded_education_period, to: :student - def initialize(student) @student = student end From bc5bed6eaedf93650f18641e3181ae58bbd43fc6 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 9 Apr 2020 16:34:57 +0300 Subject: [PATCH 598/970] Remove tuition debt process for foreign students --- .../debt/tuition/process/from_abroad.rb | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 app/services/debt/tuition/process/from_abroad.rb diff --git a/app/services/debt/tuition/process/from_abroad.rb b/app/services/debt/tuition/process/from_abroad.rb deleted file mode 100644 index d6ff35659..000000000 --- a/app/services/debt/tuition/process/from_abroad.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -require_relative '../operation/scholarship' -require_relative '../operation/disability' -require_relative '../operation/no_discount' - -module Debt - module Tuition - module Process - class FromAbroad - def self.chain - Operation::Scholarship.new(Operation::Disability.new(Operation::NoDiscount.new)) - end - end - end - end -end From 66a241eaab58679c0c6cec1f4bcbacc354dd1051 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 9 Apr 2020 17:16:06 +0300 Subject: [PATCH 599/970] Refactor tuition debt job --- app/jobs/debt/tuition_debt_job.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/jobs/debt/tuition_debt_job.rb b/app/jobs/debt/tuition_debt_job.rb index 927df2352..6cd6f26a2 100644 --- a/app/jobs/debt/tuition_debt_job.rb +++ b/app/jobs/debt/tuition_debt_job.rb @@ -5,9 +5,9 @@ class TuitionDebtJob < ApplicationJob queue_as :high def perform(unit_ids, term_id) - units = Unit.find(unit_ids.reject(&:empty?)) + units = Unit.where(id: unit_ids.reject(&:empty?)).joins(:students).select { |u| u.students.exists? } - Debt::Tuition::Dispatch.perform([units].flatten.compact, term_id) + Debt::Tuition::Dispatch.perform(units.flatten, term_id) end end end From 79e9c2150b47fafc32904d69d54fafc07c3918e1 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 10 Apr 2020 10:32:07 +0300 Subject: [PATCH 600/970] Add due date --- .../tuition_management/tuition_debts_controller.rb | 11 +++++++---- app/jobs/debt/tuition_debt_job.rb | 4 ++-- app/models/tuition_debt.rb | 1 + app/services/debt/tuition/dispatch.rb | 4 ++-- app/services/debt/tuition/operation/creation.rb | 3 ++- app/services/debt/tuition/tuition_debt.rb | 5 +++-- .../tuition_management/tuition_debts/_form.html.erb | 3 +++ .../tuition_debts/_form_bulk.html.erb | 3 +++ .../tuition_management/tuition_debts/_js.html.erb | 1 + .../tuition_management/tuition_debts/index.html.erb | 4 +++- .../tuition_management/tuition_debts.en.yml | 1 + .../tuition_management/tuition_debts.tr.yml | 1 + db/migrate/20200320114534_create_tuition_debts.rb | 1 + db/structure.sql | 1 + test/models/tuition_debt_test.rb | 2 ++ 15 files changed, 33 insertions(+), 12 deletions(-) diff --git a/app/controllers/tuition_management/tuition_debts_controller.rb b/app/controllers/tuition_management/tuition_debts_controller.rb index bf26bf241..8e16b85a7 100644 --- a/app/controllers/tuition_management/tuition_debts_controller.rb +++ b/app/controllers/tuition_management/tuition_debts_controller.rb @@ -8,8 +8,8 @@ class TuitionDebtsController < ApplicationController def index tuition_debts = - TuitionDebt.includes(:academic_term, :unit, student: :user).joins(:unit).where( - params[:unit_id].present? ? { units: { id: params[:unit_id] } } : {} + TuitionDebt.includes(:academic_term, student: %i[unit user]).joins(:student).where( + params[:unit_id].present? ? { students: { unit_id: params[:unit_id] } } : {} ) @pagy, @tuition_debts = pagy(tuition_debts.dynamic_search(search_params(TuitionDebt))) @@ -32,7 +32,8 @@ def update def create_with_service Debt::TuitionDebtJob.perform_later(params.dig(:tuition_debt, :unit_ids), - params.dig(:tuition_debt, :academic_term_id)) + params.dig(:tuition_debt, :academic_term_id), + params.dig(:tuition_debt, :due_date)) redirect_to(tuition_debts_path, notice: t('.will_update')) end @@ -50,7 +51,9 @@ def set_tuition_debt end def tuition_debt_params - params.require(:tuition_debt).permit(:student_id, :academic_term_id, :amount, :description, :type, :paid) + params.require(:tuition_debt).permit( + :student_id, :academic_term_id, :amount, :description, :type, :paid, :due_date + ) end end end diff --git a/app/jobs/debt/tuition_debt_job.rb b/app/jobs/debt/tuition_debt_job.rb index 6cd6f26a2..aec93059b 100644 --- a/app/jobs/debt/tuition_debt_job.rb +++ b/app/jobs/debt/tuition_debt_job.rb @@ -4,10 +4,10 @@ module Debt class TuitionDebtJob < ApplicationJob queue_as :high - def perform(unit_ids, term_id) + def perform(unit_ids, term_id, due_date) units = Unit.where(id: unit_ids.reject(&:empty?)).joins(:students).select { |u| u.students.exists? } - Debt::Tuition::Dispatch.perform(units.flatten, term_id) + Debt::Tuition::Dispatch.perform(units.flatten, term_id, due_date) end end end diff --git a/app/models/tuition_debt.rb b/app/models/tuition_debt.rb index 4f199aba2..7908c60ce 100644 --- a/app/models/tuition_debt.rb +++ b/app/models/tuition_debt.rb @@ -24,6 +24,7 @@ class TuitionDebt < ApplicationRecord # validations validates :amount, numericality: { greater_than: 0 } validates :description, length: { maximum: 65_535 } + validates :due_date, presence: true validates :paid, inclusion: { in: [true, false] } validates :type, inclusion: { in: types.keys } end diff --git a/app/services/debt/tuition/dispatch.rb b/app/services/debt/tuition/dispatch.rb index 84ab352e3..4fc007b3e 100644 --- a/app/services/debt/tuition/dispatch.rb +++ b/app/services/debt/tuition/dispatch.rb @@ -8,14 +8,14 @@ module Tuition module Dispatch module_function - def perform(units, academic_term) + def perform(units, academic_term, due_date) units.each do |unit| unit.students.active.each do |student| chain = set_chain(unit, student) tuition = unit.tuitions.find_by(academic_term_id: academic_term) next if tuition.nil? - debt = TuitionDebt.new(student, tuition.unit_tuitions.first) + debt = TuitionDebt.new(student, tuition.unit_tuitions.first, due_date) chain.call(debt) end end diff --git a/app/services/debt/tuition/operation/creation.rb b/app/services/debt/tuition/operation/creation.rb index f67fe9b4b..4a05df453 100644 --- a/app/services/debt/tuition/operation/creation.rb +++ b/app/services/debt/tuition/operation/creation.rb @@ -11,7 +11,8 @@ def create_debt(params, description) unit_tuition: params.unit_tuition, amount: params.amount, description: description, - type: :bulk + type: :bulk, + due_date: params.due_date ) end end diff --git a/app/services/debt/tuition/tuition_debt.rb b/app/services/debt/tuition/tuition_debt.rb index 27c82bdd5..e77f8bb7c 100644 --- a/app/services/debt/tuition/tuition_debt.rb +++ b/app/services/debt/tuition/tuition_debt.rb @@ -3,15 +3,16 @@ module Debt module Tuition class TuitionDebt - attr_reader :student, :user, :academic_term, :unit_tuition + attr_reader :academic_term, :due_date, :student, :user, :unit_tuition attr_accessor :amount - def initialize(student, unit_tuition) + def initialize(student, unit_tuition, due_date) @student = student @user = student.user @unit_tuition = unit_tuition @amount = unit_tuition.fee @academic_term = unit_tuition.academic_term + @due_date = due_date end end end diff --git a/app/views/tuition_management/tuition_debts/_form.html.erb b/app/views/tuition_management/tuition_debts/_form.html.erb index 99b1c8c38..59ba4d676 100644 --- a/app/views/tuition_management/tuition_debts/_form.html.erb +++ b/app/views/tuition_management/tuition_debts/_form.html.erb @@ -28,6 +28,9 @@
<%= f.input :description %>
+
+ <%= f.input :due_date, as: :date_time_picker %> +
<%= f.input :paid %>
diff --git a/app/views/tuition_management/tuition_debts/_form_bulk.html.erb b/app/views/tuition_management/tuition_debts/_form_bulk.html.erb index 500985d99..ef836174f 100644 --- a/app/views/tuition_management/tuition_debts/_form_bulk.html.erb +++ b/app/views/tuition_management/tuition_debts/_form_bulk.html.erb @@ -17,6 +17,9 @@
<%= f.association :academic_term, label_method: lambda { |academic_term| full_name(academic_term) } %>
+
+ <%= f.input :due_date, as: :date_time_picker %> +
<%= f.button :submit, t('.create_tuition_debts'), class: 'btn btn-outline-success btn-sm' %>
diff --git a/app/views/tuition_management/tuition_debts/_js.html.erb b/app/views/tuition_management/tuition_debts/_js.html.erb index 088ac2bb2..b078d46d7 100644 --- a/app/views/tuition_management/tuition_debts/_js.html.erb +++ b/app/views/tuition_management/tuition_debts/_js.html.erb @@ -1,5 +1,6 @@ diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index a2cc8c78e..0c7682775 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -28,6 +28,14 @@ en: student_number: Student Number unit: Unit year: Year + student_history: + entrance_type: Entrance Type + graduation_date: Graduation Date + graduation_term: Graduation Term + other_studentship: There Is Other Studentship + preparatory_class: Preparatory Class + registration_date: Registration Date + registration_term: Registration Term user: &user_attributes activated: Account Activation activated_at: Account Activation Date diff --git a/config/locales/models/user/tr.yml b/config/locales/models/user/tr.yml index 2924b29ff..aef4f74a6 100644 --- a/config/locales/models/user/tr.yml +++ b/config/locales/models/user/tr.yml @@ -28,6 +28,14 @@ tr: student_number: Öğrenci Numarası unit: Birim year: Yıl + student_history: + entrance_type: Giriş Türü + graduation_date: Mezuniyet Tarihi + graduation_term: Mezuniyet Dönemi + other_studentship: Başka Öğrenciliği Var + preparatory_class: Hazırlık Sınıfı + registration_date: Kayıt Tarihi + registration_term: Kayıt Dönemi user: &user_attributes activated: Hesap Aktifleştirme activated_at: Hesap Aktifleştirme Tarihi From c5a0a6039d08d3d42da51d75a335d718cc5398a9 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 29 Apr 2020 13:50:30 +0300 Subject: [PATCH 701/970] Make it visible that history fields --- app/models/student.rb | 2 ++ .../user_management/users/_students.html.erb | 25 ++++++++++++++++++- config/locales/models/user/en.yml | 3 ++- config/locales/models/user/tr.yml | 3 ++- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/app/models/student.rb b/app/models/student.rb index 81c51a251..3f86a2fd4 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -49,6 +49,8 @@ class Student < ApplicationRecord delegate :name, to: :stage, prefix: true, allow_nil: true delegate :name, to: :unit, prefix: true delegate :name, to: :scholarship_type, prefix: true, allow_nil: true + delegate :entrance_type, :graduation_term, :other_studentship, :preparatory_class, + :registration_date, :registration_term, :graduation_date, to: :history # background jobs after_create_commit :build_identity_information, if: proc { identity.nil? } diff --git a/app/views/user_management/users/_students.html.erb b/app/views/user_management/users/_students.html.erb index f2a72def5..022c31434 100644 --- a/app/views/user_management/users/_students.html.erb +++ b/app/views/user_management/users/_students.html.erb @@ -28,7 +28,30 @@
- + + + + + + + + + + + + + + + + + + + + + + + +
<%= full_name(debt.academic_term) %><%= debt.unit_tuition.unit.name %><%= debt.unit.name %> <%= full_name(debt.student.user.identities.formal.first)%> <%= number_to_currency(debt.amount) %> <%= debt.description %><%= student.semester %> <%= student.scholarship_type_name %> <%= student.stage_name %><%= icon_for_check(student.exceeded_education_period) %><%= student.exceeded_education_period ? t('yes') : t('no') %>
<%= t('.entrance_type') %><%= t('.registration_date') %><%= t('.registration_term') %><%= t('.graduation_date') %><%= t('.graduation_term') %><%= t('.other_studentship') %><%= t('.preparatory_class') %>
<%= student.entrance_type.name %><%= l(student.registration_date, format: '%d %b %Y') %><%= full_name(student.registration_term) %><%= l(student.graduation_date, format: '%d %b %Y') %><%= full_name(student.graduation_term) %><%= student.other_studentship ? t('yes') : t('no') %><%= student.preparatory_class %>
diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index 0c7682775..a415343c8 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -28,7 +28,7 @@ en: student_number: Student Number unit: Unit year: Year - student_history: + student_history: &student_history_attributes entrance_type: Entrance Type graduation_date: Graduation Date graduation_term: Graduation Term @@ -124,5 +124,6 @@ en: students: Student Information students: <<: *student_attributes + <<: *student_history_attributes update: success: User successfully updated. diff --git a/config/locales/models/user/tr.yml b/config/locales/models/user/tr.yml index aef4f74a6..8b807c863 100644 --- a/config/locales/models/user/tr.yml +++ b/config/locales/models/user/tr.yml @@ -28,7 +28,7 @@ tr: student_number: Öğrenci Numarası unit: Birim year: Yıl - student_history: + student_history: &student_history_attributes entrance_type: Giriş Türü graduation_date: Mezuniyet Tarihi graduation_term: Mezuniyet Dönemi @@ -137,5 +137,6 @@ tr: students: Öğrenci Bilgileri students: <<: *student_attributes + <<: *student_history_attributes update: success: Kullanıcı başarıyla güncellendi. From 4d1ec81b6a9a244e1c092277842d42e0bb33a55c Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 29 Apr 2020 14:19:18 +0300 Subject: [PATCH 702/970] Fix integration test --- app/controllers/user_management/users_controller.rb | 2 +- app/views/user_management/users/_students.html.erb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/user_management/users_controller.rb b/app/controllers/user_management/users_controller.rb index 9d07697e4..df5c7cd61 100644 --- a/app/controllers/user_management/users_controller.rb +++ b/app/controllers/user_management/users_controller.rb @@ -20,7 +20,7 @@ def show @addresses = @user.addresses.includes(district: :city) @employees = @user.employees.includes(:title).order(active: :desc) @duties = @user.duties.includes(:unit) - @students = @user.students.includes(:unit, :scholarship_type) + @students = @user.students.includes(:unit, :scholarship_type, :history, :stage) @positions = @user.positions.includes(:administrative_function, :duty) end diff --git a/app/views/user_management/users/_students.html.erb b/app/views/user_management/users/_students.html.erb index 022c31434..2f00afcb6 100644 --- a/app/views/user_management/users/_students.html.erb +++ b/app/views/user_management/users/_students.html.erb @@ -45,10 +45,10 @@ - <%= student.entrance_type.name %> - <%= l(student.registration_date, format: '%d %b %Y') %> + <%= student.entrance_type&.name %> + <%= l(student.registration_date, format: '%d %b %Y') if student.registration_date %> <%= full_name(student.registration_term) %> - <%= l(student.graduation_date, format: '%d %b %Y') %> + <%= l(student.graduation_date, format: '%d %b %Y') if student.graduation_date %> <%= full_name(student.graduation_term) %> <%= student.other_studentship ? t('yes') : t('no') %> <%= student.preparatory_class %> From 394ab9de7330720a5c79787ded863b951bd879f4 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 29 Apr 2020 23:43:13 +0300 Subject: [PATCH 703/970] Add unit calendar fixture for department --- test/fixtures/unit_calendars.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/fixtures/unit_calendars.yml b/test/fixtures/unit_calendars.yml index f8e6b6357..924019d0d 100644 --- a/test/fixtures/unit_calendars.yml +++ b/test/fixtures/unit_calendars.yml @@ -4,6 +4,9 @@ uzem_calendar: egitim_bilimleri_calendar: calendar: graduate_calendar unit: egitim_bilimleri_enstitusu -bilgisayar_muhendisligi_calendar: +bilgisayar_muhendisligi_programi_calendar: calendar: bm_calendar unit: bilgisayar_muhendisligi_programi +bilgisayar_muhendisligi_calendar: + calendar: bm_calendar + unit: bilgisayar_muhendisligi From 899f0c0c781edcbf66aa3bd4054d3a47866342b3 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 29 Apr 2020 23:44:04 +0300 Subject: [PATCH 704/970] Add new calendar event fixture --- test/fixtures/calendar_event_types.yml | 4 ++++ test/fixtures/calendar_events.yml | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/test/fixtures/calendar_event_types.yml b/test/fixtures/calendar_event_types.yml index ffc9ac20d..4f86f17ab 100644 --- a/test/fixtures/calendar_event_types.yml +++ b/test/fixtures/calendar_event_types.yml @@ -14,6 +14,10 @@ excused_mid_term_applications: name: Ara Sınav Mazeret Başvuruları identifier: excused_mid_term_applications category: applications +mid_term_results_announcement: + name: Ara Sınav + identifier: mid_term_results_announcement + category: announcement calendar_event_type_to_delete: name: This event type will be deleted in tests identifier: some_event_type_to_delete diff --git a/test/fixtures/calendar_events.yml b/test/fixtures/calendar_events.yml index 903997532..d76b2b9fa 100644 --- a/test/fixtures/calendar_events.yml +++ b/test/fixtures/calendar_events.yml @@ -12,3 +12,10 @@ online_course_registrations: end_time: <%= Time.current + 5.days %> location: Online timezone: Istanbul +mid_term_results_announcement: + calendar: bm_calendar + calendar_event_type: mid_term_results_announcement + start_time: <%= Time.current - 5.days %> + end_time: <%= Time.current + 5.days %> + location: Online + timezone: Istanbul From 2a54d0b271e585f3295775675122644925c5219b Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 30 Apr 2020 09:48:23 +0300 Subject: [PATCH 705/970] Create calendar event decorator & add locales --- app/decorators/calendar_event_decorator.rb | 25 +++++++++++++++++++ .../calendar_events.en.yml | 2 ++ .../calendar_events.tr.yml | 2 ++ 3 files changed, 29 insertions(+) create mode 100644 app/decorators/calendar_event_decorator.rb diff --git a/app/decorators/calendar_event_decorator.rb b/app/decorators/calendar_event_decorator.rb new file mode 100644 index 000000000..3e0e74dc3 --- /dev/null +++ b/app/decorators/calendar_event_decorator.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class CalendarEventDecorator < SimpleDelegator + def active_now? + return unless presence + + end_time ? Time.current.between?(start_time, end_time) : start_time.past? + end + + def date_range + return translate('undefined_date_range') unless presence + + translate( + 'date_range', + start_time: start_time&.strftime('%F %R'), + end_time: end_time&.strftime('%F %R') + ) + end + + private + + def translate(key, params = {}) + I18n.t("calendar_management.calendars.#{key}", **params) + end +end diff --git a/config/locales/controllers/calendar_management/calendar_events.en.yml b/config/locales/controllers/calendar_management/calendar_events.en.yml index 0f11f3e8c..d953da6d0 100644 --- a/config/locales/controllers/calendar_management/calendar_events.en.yml +++ b/config/locales/controllers/calendar_management/calendar_events.en.yml @@ -12,3 +12,5 @@ en: calendars: calendar_event_fields: <<: *calendar_event_attributes + date_range: "Event Dates: %{start_time} - %{end_time}" + undefined_date_range: Event dates are not defined. diff --git a/config/locales/controllers/calendar_management/calendar_events.tr.yml b/config/locales/controllers/calendar_management/calendar_events.tr.yml index 43273f035..e044364ab 100644 --- a/config/locales/controllers/calendar_management/calendar_events.tr.yml +++ b/config/locales/controllers/calendar_management/calendar_events.tr.yml @@ -12,3 +12,5 @@ tr: calendars: calendar_event_fields: <<: *calendar_event_attributes + date_range: "Ekinlik Tarihleri: %{start_time} - %{end_time}" + undefined_date_range: Etkinlik tarihleri tanımlanmamış. From 4c7e07273dcfcca1b3d8e3ed34d5168eac97462e Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 30 Apr 2020 10:31:03 +0300 Subject: [PATCH 706/970] Refactor studentship method of daytime education process --- app/models/student.rb | 2 +- app/services/debt/tuition/process/daytime_education.rb | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/models/student.rb b/app/models/student.rb index 3f86a2fd4..8a0a848ca 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -50,7 +50,7 @@ class Student < ApplicationRecord delegate :name, to: :unit, prefix: true delegate :name, to: :scholarship_type, prefix: true, allow_nil: true delegate :entrance_type, :graduation_term, :other_studentship, :preparatory_class, - :registration_date, :registration_term, :graduation_date, to: :history + :registration_date, :registration_term, :graduation_date, to: :history, allow_nil: true # background jobs after_create_commit :build_identity_information, if: proc { identity.nil? } diff --git a/app/services/debt/tuition/process/daytime_education.rb b/app/services/debt/tuition/process/daytime_education.rb index 8c5a40148..0c927eb62 100644 --- a/app/services/debt/tuition/process/daytime_education.rb +++ b/app/services/debt/tuition/process/daytime_education.rb @@ -24,12 +24,8 @@ def exceeded? student.exceeded_education_period end - # TODO: This information shouldn't be obtained from prospective student def other_studentship? - status = student.prospective_student&.obs_status - return false if status.nil? - - !status + student.other_studentship end end end From 0ca3970892a0e679a6230bb90110bf1b9ff211d5 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 30 Apr 2020 11:13:06 +0300 Subject: [PATCH 707/970] Set calendar event decorator obj as event --- app/decorators/assessment_decorator.rb | 24 ++++--------------- .../prospective_student_decorator.rb | 4 ++-- app/decorators/student_decorator.rb | 20 ++-------------- 3 files changed, 8 insertions(+), 40 deletions(-) diff --git a/app/decorators/assessment_decorator.rb b/app/decorators/assessment_decorator.rb index 3efecc2dd..6f151af71 100644 --- a/app/decorators/assessment_decorator.rb +++ b/app/decorators/assessment_decorator.rb @@ -1,18 +1,6 @@ # frozen_string_literal: true class AssessmentDecorator < SimpleDelegator - def results_announcement_active? - event_results_announcement.try(:active_now?) - end - - def date_range - translate( - 'index.results_announcement_date_range', - start_time: event_results_announcement&.start_time&.strftime('%F %R'), - end_time: event_results_announcement&.end_time&.strftime('%F %R') - ) - end - def editable? !saved? && saved_enrollments.any? end @@ -21,6 +9,10 @@ def saveable? draft? && fully_graded? end + def results_announcement_event + @results_announcement_event ||= CalendarEventDecorator.new(calendar&.event(identifier)) + end + private def calendar @@ -37,12 +29,4 @@ def identifier 'retake_results_announcement' end end - - def event_results_announcement - calendar&.event(identifier) - end - - def translate(key, params = {}) - I18n.t("instructiveness.assessments.#{key}", **params) - end end diff --git a/app/decorators/prospective_student_decorator.rb b/app/decorators/prospective_student_decorator.rb index 6754adeae..2a1556766 100644 --- a/app/decorators/prospective_student_decorator.rb +++ b/app/decorators/prospective_student_decorator.rb @@ -14,11 +14,11 @@ def registration_documents end def permanent_registrable? - calendar&.check_events('permanent_registration_applications') + CalendarEventDecorator.new(calendar&.event('permanent_registration_applications')).active_now? end def temporary_registrable? - calendar&.check_events('temporary_registration_applications') + CalendarEventDecorator.new(calendar&.event('temporary_registration_applications')).active_now? end def document_required? diff --git a/app/decorators/student_decorator.rb b/app/decorators/student_decorator.rb index 7e32d2670..522cccfda 100644 --- a/app/decorators/student_decorator.rb +++ b/app/decorators/student_decorator.rb @@ -1,16 +1,8 @@ # frozen_string_literal: true class StudentDecorator < SimpleDelegator - def registrable_for_online_course? - event_online_course_registrations.try(:active_now?) - end - - def registation_date_range - translate( - 'index.registration_date_range', - start_time: event_online_course_registrations&.start_time&.strftime('%F %R'), - end_time: event_online_course_registrations&.end_time&.strftime('%F %R') - ) + def event_online_course_registrations + @event_online_course_registrations ||= CalendarEventDecorator.new(calendar&.event('online_course_registrations')) end private @@ -18,12 +10,4 @@ def registation_date_range def calendar calendars.last end - - def event_online_course_registrations - calendar&.event('online_course_registrations') - end - - def translate(key, params = {}) - I18n.t("studentship.course_enrollments.#{key}", **params) - end end From ac3a2b36d53b7c531116c4d153cb769b7c927d5c Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 30 Apr 2020 11:23:10 +0300 Subject: [PATCH 708/970] Refactor controllers & views using event decorator --- app/controllers/instructiveness/assessments_controller.rb | 6 +++--- .../studentship/course_enrollments_controller.rb | 6 +++--- app/views/instructiveness/assessments/show.html.erb | 5 +++-- app/views/studentship/course_enrollments/index.html.erb | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/controllers/instructiveness/assessments_controller.rb b/app/controllers/instructiveness/assessments_controller.rb index a2e80e64b..97d828bee 100644 --- a/app/controllers/instructiveness/assessments_controller.rb +++ b/app/controllers/instructiveness/assessments_controller.rb @@ -6,7 +6,7 @@ class AssessmentsController < ApplicationController before_action :set_course before_action :set_assessment before_action :authorized? - before_action :check_date_range, except: :show + before_action :event_active?, except: :show before_action :coordinator?, only: %i[save draft] before_action :set_enrollments before_action :editable?, only: %i[edit update] @@ -61,8 +61,8 @@ def authorized? authorize(@employee, policy_class: Instructiveness::AssessmentPolicy) end - def check_date_range - redirect_with('.errors.not_proper_event_range') unless @assessment.results_announcement_active? + def event_active? + redirect_with('.errors.not_proper_event_range') unless @assessment.results_announcement_event.active_now? end def coordinator? diff --git a/app/controllers/studentship/course_enrollments_controller.rb b/app/controllers/studentship/course_enrollments_controller.rb index 456d86dac..e9f150fca 100644 --- a/app/controllers/studentship/course_enrollments_controller.rb +++ b/app/controllers/studentship/course_enrollments_controller.rb @@ -6,7 +6,7 @@ class CourseEnrollmentsController < ApplicationController before_action :authorized? before_action :set_service, except: :index before_action :set_course_enrollment, only: :destroy - before_action :check_registrability, except: :index + before_action :event_active?, except: :index before_action :check_registration_status, except: %i[index list] def index @@ -63,8 +63,8 @@ def authorized? authorize(@student, policy_class: Studentship::CourseEnrollmentPolicy) end - def check_registrability - return if @student.registrable_for_online_course? + def event_active? + return if @student.event_online_course_registrations.active_now? redirect_to(student_course_enrollments_path(@student), alert: t('.errors.not_proper_register_event_range')) end diff --git a/app/views/instructiveness/assessments/show.html.erb b/app/views/instructiveness/assessments/show.html.erb index 16dc243b9..c2cf8e381 100644 --- a/app/views/instructiveness/assessments/show.html.erb +++ b/app/views/instructiveness/assessments/show.html.erb @@ -14,10 +14,11 @@ <%= link_to(t('.save'), save_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.saveable? %> <% end %> - <% if @assessment.results_announcement_active? %> + <% event = @assessment.results_announcement_event %> + <% if event.active_now? %> <%= link_to_edit(t('action_group.edit'), edit_given_course_assessment_path(@course, @assessment), class: 'btn btn-outline-success btn-sm') if @assessment.editable? %> <% else %> - <%= @assessment.date_range %> + <%= event.date_range %> <% end %>
diff --git a/app/views/studentship/course_enrollments/index.html.erb b/app/views/studentship/course_enrollments/index.html.erb index 93efebe64..e2c32fcd3 100644 --- a/app/views/studentship/course_enrollments/index.html.erb +++ b/app/views/studentship/course_enrollments/index.html.erb @@ -20,7 +20,7 @@
<%= @student.unit.name %>
-

<%= @student.registation_date_range %>

+

<%= @student.event_online_course_registrations.date_range %>

<%= "#{t('.registration_status')}: #{enum_t(@student.current_registration, :status)}" %> <% end %>
From ea75a1156a51e3ab37f54c27eeedd5b0bae33f40 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 30 Apr 2020 11:44:06 +0300 Subject: [PATCH 709/970] Remove redundant methods --- app/models/calendar.rb | 4 ---- app/models/calendar_event.rb | 4 ---- 2 files changed, 8 deletions(-) diff --git a/app/models/calendar.rb b/app/models/calendar.rb index b95ebb3b4..2c6074e9d 100644 --- a/app/models/calendar.rb +++ b/app/models/calendar.rb @@ -57,10 +57,6 @@ def event(identifier) calendar_events.find_by(calendar_event_type: type) end - def check_events(identifier) - event(identifier).try(:active_now?) - end - private def event_type(identifier) diff --git a/app/models/calendar_event.rb b/app/models/calendar_event.rb index 457c90fdd..91c65dac1 100644 --- a/app/models/calendar_event.rb +++ b/app/models/calendar_event.rb @@ -21,8 +21,4 @@ class CalendarEvent < ApplicationRecord # delegations delegate :name, to: :calendar_event_type, prefix: :type - - def active_now? - end_time ? Time.current.between?(start_time, end_time) : start_time.past? - end end From 2b5e69587e5693ec4208720248b877e1f9bbdef0 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 30 Apr 2020 11:50:06 +0300 Subject: [PATCH 710/970] Remove redundant locales --- config/locales/controllers/instructiveness/assessments.en.yml | 1 - config/locales/controllers/instructiveness/assessments.tr.yml | 1 - config/locales/controllers/studentship/course_enrollments.en.yml | 1 - config/locales/controllers/studentship/course_enrollments.tr.yml | 1 - 4 files changed, 4 deletions(-) diff --git a/config/locales/controllers/instructiveness/assessments.en.yml b/config/locales/controllers/instructiveness/assessments.en.yml index 5272d42c0..3f171d929 100644 --- a/config/locales/controllers/instructiveness/assessments.en.yml +++ b/config/locales/controllers/instructiveness/assessments.en.yml @@ -43,7 +43,6 @@ en: draft: Draft group_name: Group Name name: Name - results_announcement_date_range: "Evaluation Results Announcement Dates: %{start_time} - %{end_time}" save: Save Permanently students: 'Students Enrolled in %{course_name} Course' student_number: Student Number diff --git a/config/locales/controllers/instructiveness/assessments.tr.yml b/config/locales/controllers/instructiveness/assessments.tr.yml index d24036ba8..aed26bc67 100644 --- a/config/locales/controllers/instructiveness/assessments.tr.yml +++ b/config/locales/controllers/instructiveness/assessments.tr.yml @@ -43,7 +43,6 @@ tr: draft: Taslak Durumuna Getir group_name: Grup Adı name: Adı - results_announcement_date_range: "Değerlendirme Sonuçları İlan Tarihleri: %{start_time} - %{end_time}" save: Kalıcı Olarak Kaydet students: '%{course_name} Dersine Kayıtlanan Öğrenciler' student_number: Öğrenci Numarası diff --git a/config/locales/controllers/studentship/course_enrollments.en.yml b/config/locales/controllers/studentship/course_enrollments.en.yml index 8892c20c4..dabd7fa5b 100644 --- a/config/locales/controllers/studentship/course_enrollments.en.yml +++ b/config/locales/controllers/studentship/course_enrollments.en.yml @@ -40,7 +40,6 @@ en: index: course_enrollments: Course Enrollments registration_status: Enrollment Status - registration_date_range: "Online Course Registration Dates: %{start_time} - %{end_time}" list: <<: *course_attributes sequence: Sequence diff --git a/config/locales/controllers/studentship/course_enrollments.tr.yml b/config/locales/controllers/studentship/course_enrollments.tr.yml index 21e871b3c..fba985b78 100644 --- a/config/locales/controllers/studentship/course_enrollments.tr.yml +++ b/config/locales/controllers/studentship/course_enrollments.tr.yml @@ -40,7 +40,6 @@ tr: index: course_enrollments: Ders Kayıtları registration_status: Kayıt Durumu - registration_date_range: "Çevrimiçi Ders Kayıt Tarihleri: %{start_time} - %{end_time}" list: <<: *course_attributes sequence: Dönem From c573d97bf3e40c83bbbd518721b7743ee3aa37b1 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 30 Apr 2020 15:36:32 +0300 Subject: [PATCH 711/970] Remove forgotten tests --- test/decorators/student_decorator_test.rb | 21 --------------------- test/models/calendar_test.rb | 4 ---- 2 files changed, 25 deletions(-) diff --git a/test/decorators/student_decorator_test.rb b/test/decorators/student_decorator_test.rb index 24497a3df..aad699c2d 100644 --- a/test/decorators/student_decorator_test.rb +++ b/test/decorators/student_decorator_test.rb @@ -6,25 +6,4 @@ class StudentDecoratorTest < ActiveSupport::TestCase setup do @student = StudentDecorator.new(students(:serhat)) end - - test 'registrable_for_online_course? method' do - assert_not StudentDecorator.new(students(:serhat_omu)).registrable_for_online_course? - assert StudentDecorator.new(@student).registrable_for_online_course? - end - - test 'registation_date_range method' do - event = calendar_events(:online_course_registrations) - assert_equal StudentDecorator.new(@student).registation_date_range, - translate( - 'index.registration_date_range', - start_time: event.start_time&.strftime('%F %R'), - end_time: event.end_time&.strftime('%F %R') - ) - end - - private - - def translate(key, params = {}) - t("studentship.course_enrollments.#{key}", params) - end end diff --git a/test/models/calendar_test.rb b/test/models/calendar_test.rb index b53fd9cd7..03e8d4a16 100644 --- a/test/models/calendar_test.rb +++ b/test/models/calendar_test.rb @@ -37,8 +37,4 @@ class CalendarTest < ActiveSupport::TestCase event = calendar_events(:online_course_registrations) assert_equal calendars(:bm_calendar).event('online_course_registrations'), event end - - test 'check if events exists' do - assert calendars(:bm_calendar).check_events('online_course_registrations') - end end From e2e32b6d1678ea84618bfc43f3ad350ea4ad3dac Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 30 Apr 2020 15:58:04 +0300 Subject: [PATCH 712/970] Add assessment decorator test --- test/decorators/assessment_decorator_test.rb | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/decorators/assessment_decorator_test.rb diff --git a/test/decorators/assessment_decorator_test.rb b/test/decorators/assessment_decorator_test.rb new file mode 100644 index 000000000..c080376df --- /dev/null +++ b/test/decorators/assessment_decorator_test.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'test_helper' + +class AssessmentDecoratorTest < ActiveSupport::TestCase + setup do + @assessment = AssessmentDecorator.new(course_assessment_methods(:elective_midterm_exam_assessment)) + end + + test 'editable? method' do + assert @assessment.editable? + end + + test 'saveable? method' do + assert_not @assessment.saveable? + end + + test 'results_announcement_event method' do + assert @assessment.results_announcement_event + end +end From d105e5d6907a0137723a1a9e495af2b5bf414d80 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 30 Apr 2020 16:00:44 +0300 Subject: [PATCH 713/970] Add calendar event decorator test --- .../calendar_event_decorator_test.rb | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/decorators/calendar_event_decorator_test.rb diff --git a/test/decorators/calendar_event_decorator_test.rb b/test/decorators/calendar_event_decorator_test.rb new file mode 100644 index 000000000..fe834a996 --- /dev/null +++ b/test/decorators/calendar_event_decorator_test.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +require 'test_helper' + +class CalendarEventDecoratorTest < ActiveSupport::TestCase + setup do + @calendar_event = CalendarEventDecorator.new(calendar_events(:mid_term_results_announcement)) + end + + test 'active_now? method' do + assert_not CalendarEventDecorator.new(calendar_events(:add_drop_fall_2018_grad)).active_now? + assert @calendar_event.active_now? + end + + test 'date_range? method' do + assert_equal @calendar_event.date_range, + translate( + 'date_range', + start_time: @calendar_event.start_time&.strftime('%F %R'), + end_time: @calendar_event.end_time&.strftime('%F %R') + ) + end + + private + + def translate(key, params = {}) + t("calendar_management.calendars.#{key}", params) + end +end From 786647d8edbe58739cc491e9e3de98b580a1f7fa Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:32:24 +0000 Subject: [PATCH 714/970] chore(deps): bump twilio-ruby from 5.33.1 to 5.34.0 Bumps [twilio-ruby](https://github.com/twilio/twilio-ruby) from 5.33.1 to 5.34.0. - [Release notes](https://github.com/twilio/twilio-ruby/releases) - [Changelog](https://github.com/twilio/twilio-ruby/blob/master/CHANGES.md) - [Commits](https://github.com/twilio/twilio-ruby/compare/5.33.1...5.34.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index c65aea97f..cdda5e297 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -413,7 +413,7 @@ GEM thor (0.20.3) thread_safe (0.3.6) tilt (2.0.10) - twilio-ruby (5.33.1) + twilio-ruby (5.34.0) faraday (>= 0.9, < 2.0) jwt (>= 1.5, <= 2.5) nokogiri (>= 1.6, < 2.0) From c86da802ce3f4f09504a9bac0406e5f892c43653 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:33:09 +0000 Subject: [PATCH 715/970] chore(deps): bump rack-attack from 6.2.2 to 6.3.0 Bumps [rack-attack](https://github.com/kickstarter/rack-attack) from 6.2.2 to 6.3.0. - [Release notes](https://github.com/kickstarter/rack-attack/releases) - [Changelog](https://github.com/kickstarter/rack-attack/blob/master/CHANGELOG.md) - [Commits](https://github.com/kickstarter/rack-attack/compare/v6.2.2...v6.3.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index c65aea97f..731cad30e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -284,7 +284,7 @@ GEM pwned (2.0.1) raabro (1.1.6) rack (2.0.9) - rack-attack (6.2.2) + rack-attack (6.3.0) rack (>= 1.0, < 3) rack-mini-profiler (2.0.1) rack (>= 1.2.0) From 6248b6205dec9139bf396df6a730661223f83683 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:33:58 +0000 Subject: [PATCH 716/970] chore(deps): bump aws-sigv4 from 1.1.2 to 1.1.3 Bumps [aws-sigv4](https://github.com/aws/aws-sdk-ruby) from 1.1.2 to 1.1.3. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sigv4/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/compare/1.1.2...1.1.3) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index c65aea97f..b5a4e9ce4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -107,7 +107,7 @@ GEM aws-sdk-core (~> 3, >= 3.83.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) - aws-sigv4 (1.1.2) + aws-sigv4 (1.1.3) aws-eventstream (~> 1.0, >= 1.0.2) bcrypt (3.1.13) better_html (1.0.14) From f97656c7ca659922c9feb673925b1ae43c89b58e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:34:27 +0000 Subject: [PATCH 717/970] chore(deps-dev): bump byebug from 11.1.2 to 11.1.3 Bumps [byebug](https://github.com/deivid-rodriguez/byebug) from 11.1.2 to 11.1.3. - [Release notes](https://github.com/deivid-rodriguez/byebug/releases) - [Changelog](https://github.com/deivid-rodriguez/byebug/blob/master/CHANGELOG.md) - [Commits](https://github.com/deivid-rodriguez/byebug/compare/v11.1.2...v11.1.3) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index c65aea97f..7b9e69a88 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -130,7 +130,7 @@ GEM bundler-audit (0.6.1) bundler (>= 1.2.0, < 3) thor (~> 0.18) - byebug (11.1.2) + byebug (11.1.3) capybara (3.32.1) addressable mini_mime (>= 0.1.3) From ff18a46e5297700d63596ec0bac811cfa304c940 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:35:05 +0000 Subject: [PATCH 718/970] chore(deps-dev): bump rubocop-minitest from 0.8.1 to 0.9.0 Bumps [rubocop-minitest](https://github.com/rubocop-hq/rubocop-minitest) from 0.8.1 to 0.9.0. - [Release notes](https://github.com/rubocop-hq/rubocop-minitest/releases) - [Changelog](https://github.com/rubocop-hq/rubocop-minitest/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop-hq/rubocop-minitest/compare/v0.8.1...v0.9.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c65aea97f..142ec3fce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -263,7 +263,7 @@ GEM orm_adapter (0.5.0) pagy (3.8.0) parallel (1.19.1) - parser (2.7.1.1) + parser (2.7.1.2) ast (~> 2.4.0) pg (1.2.3) pg_search (2.3.2) @@ -351,7 +351,7 @@ GEM rexml ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) - rubocop-minitest (0.8.1) + rubocop-minitest (0.9.0) rubocop (>= 0.74) rubocop-performance (1.5.2) rubocop (>= 0.71.0) From aceec626c3f1658109e7185335778a7ef960b831 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:35:43 +0000 Subject: [PATCH 719/970] chore(deps): bump parser from 2.7.1.1 to 2.7.1.2 Bumps [parser](https://github.com/whitequark/parser) from 2.7.1.1 to 2.7.1.2. - [Release notes](https://github.com/whitequark/parser/releases) - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v2.7.1.1...v2.7.1.2) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index c65aea97f..7b482727f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -263,7 +263,7 @@ GEM orm_adapter (0.5.0) pagy (3.8.0) parallel (1.19.1) - parser (2.7.1.1) + parser (2.7.1.2) ast (~> 2.4.0) pg (1.2.3) pg_search (2.3.2) From d29e5dd77e48fd2fb1fab031981a3e509cd2c413 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:36:13 +0000 Subject: [PATCH 720/970] chore(deps): bump aws-partitions from 1.303.0 to 1.308.0 Bumps [aws-partitions](https://github.com/aws/aws-sdk-ruby) from 1.303.0 to 1.308.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-partitions/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index c65aea97f..a102c6d67 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,7 +94,7 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.1.0) - aws-partitions (1.303.0) + aws-partitions (1.308.0) aws-sdk-core (3.94.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) From 543988e6c192e26172c9d999c9c0bffc8823da9e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:36:49 +0000 Subject: [PATCH 721/970] chore(deps): bump rb-fsevent from 0.10.3 to 0.10.4 Bumps [rb-fsevent](https://github.com/thibaudgg/rb-fsevent) from 0.10.3 to 0.10.4. - [Release notes](https://github.com/thibaudgg/rb-fsevent/releases) - [Commits](https://github.com/thibaudgg/rb-fsevent/compare/0.10.3...v0.10.4) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index c65aea97f..6b2031b8f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -328,7 +328,7 @@ GEM thor (>= 0.20.3, < 2.0) rainbow (3.0.0) rake (13.0.1) - rb-fsevent (0.10.3) + rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) redis (4.1.3) From 14cfd51b5effcc0177383e58a67486963e043edc Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:37:25 +0000 Subject: [PATCH 722/970] chore(deps): bump redis from 4.1.3 to 4.1.4 Bumps [redis](https://github.com/redis/redis-rb) from 4.1.3 to 4.1.4. - [Release notes](https://github.com/redis/redis-rb/releases) - [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md) - [Commits](https://github.com/redis/redis-rb/compare/v4.1.3...v4.1.4) Signed-off-by: dependabot-preview[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index e4c891124..fbb223da2 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem 'bootsnap', require: false gem 'puma' gem 'rails', '~> 6.0' -gem 'redis', '~> 4.0' +gem 'redis', '~> 4.1' gem 'sidekiq' # database diff --git a/Gemfile.lock b/Gemfile.lock index c65aea97f..8897313da 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -331,7 +331,7 @@ GEM rb-fsevent (0.10.3) rb-inotify (0.10.1) ffi (~> 1.0) - redis (4.1.3) + redis (4.1.4) regexp_parser (1.7.0) rein (5.1.0) activerecord (>= 4.0.0) @@ -513,7 +513,7 @@ DEPENDENCIES rack-attack rack-mini-profiler rails (~> 6.0) - redis (~> 4.0) + redis (~> 4.1) rein rollbar rubocop From aeda42d6d5c1e0aa47956552c9b00f188c5f3861 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:41:58 +0000 Subject: [PATCH 723/970] chore(deps): bump string.prototype.trimstart from 1.0.0 to 1.0.1 Bumps [string.prototype.trimstart](https://github.com/es-shims/String.prototype.trimStart) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/es-shims/String.prototype.trimStart/releases) - [Changelog](https://github.com/es-shims/String.prototype.trimStart/blob/master/CHANGELOG.md) - [Commits](https://github.com/es-shims/String.prototype.trimStart/compare/v1.0.0...v1.0.1) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 10136e704..d7f025b34 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1218,7 +1218,7 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.0: +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2: version "6.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== @@ -1228,7 +1228,7 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.0: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.12.0: +ajv@^6.12.0, ajv@^6.5.5: version "6.12.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.2.tgz#c629c5eced17baf314437918d2da88c99d5958cd" integrity sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ== @@ -7905,9 +7905,9 @@ string-width@^4.1.0: strip-ansi "^6.0.0" string.prototype.trimend@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.0.tgz#ee497fd29768646d84be2c9b819e292439614373" - integrity sha512-EEJnGqa/xNfIg05SxiPSqRS7S9qwDhYts1TSLR1BQfYUfPe1stofgGKvwERK9+9yf+PpfBMlpBaCHucXGPQfUA== + version "1.0.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz#85812a6b847ac002270f5808146064c995fb6913" + integrity sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g== dependencies: define-properties "^1.1.3" es-abstract "^1.17.5" @@ -7931,9 +7931,9 @@ string.prototype.trimright@^2.1.1: string.prototype.trimend "^1.0.0" string.prototype.trimstart@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.0.tgz#afe596a7ce9de905496919406c9734845f01a2f2" - integrity sha512-iCP8g01NFYiiBOnwG1Xc3WZLyoo+RuBymwIlWncShXDDJYWN6DbnM3odslBJdgCdRlq94B5s63NWAZlcn2CS4w== + version "1.0.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz#14af6d9f34b053f7cfc89b72f8f2ee14b9039a54" + integrity sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw== dependencies: define-properties "^1.1.3" es-abstract "^1.17.5" From 4ffce481d36ebd1d6953a663743120aff53a4cf6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:42:28 +0000 Subject: [PATCH 724/970] chore(deps): bump inquirer from 7.0.4 to 7.1.0 Bumps [inquirer](https://github.com/SBoudrias/Inquirer.js) from 7.0.4 to 7.1.0. - [Release notes](https://github.com/SBoudrias/Inquirer.js/releases) - [Commits](https://github.com/SBoudrias/Inquirer.js/compare/inquirer@7.0.4...inquirer@7.1.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 55 ++++++++++++++++++++++++------------------------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/yarn.lock b/yarn.lock index 10136e704..0dc815c3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1218,7 +1218,7 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.0: +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2: version "6.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== @@ -1228,7 +1228,7 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.0: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.12.0: +ajv@^6.12.0, ajv@^6.5.5: version "6.12.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.2.tgz#c629c5eced17baf314437918d2da88c99d5958cd" integrity sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ== @@ -1298,9 +1298,9 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: color-convert "^1.9.0" ansi-styles@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.0.tgz#5681f0dcf7ae5880a7841d8831c4724ed9cc0172" - integrity sha512-7kFQgnEaMdRtwf6uSfUnVr9gSGC7faurn+J/Mv90/W+iTtN0405/nLdopfMWwchyxhbGYl6TC4Sccn9TUkGAgg== + version "4.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" + integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== dependencies: "@types/color-name" "^1.1.1" color-convert "^2.0.1" @@ -2041,9 +2041,9 @@ cli-cursor@^3.1.0: restore-cursor "^3.1.0" cli-width@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" + integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== cli@~1.0.0: version "1.0.1" @@ -4260,22 +4260,22 @@ ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== inquirer@^7.0.0: - version "7.0.4" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.0.4.tgz#99af5bde47153abca23f5c7fc30db247f39da703" - integrity sha512-Bu5Td5+j11sCkqfqmUTiwv+tWisMtP0L7Q8WrqA2C/BbBhy1YTdFrvjjlrKq8oagA/tLQBski2Gcx/Sqyi2qSQ== + version "7.1.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.1.0.tgz#1298a01859883e17c7264b82870ae1034f92dd29" + integrity sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg== dependencies: ansi-escapes "^4.2.1" - chalk "^2.4.2" + chalk "^3.0.0" cli-cursor "^3.1.0" cli-width "^2.0.0" external-editor "^3.0.3" figures "^3.0.0" lodash "^4.17.15" mute-stream "0.0.8" - run-async "^2.2.0" + run-async "^2.4.0" rxjs "^6.5.3" string-width "^4.1.0" - strip-ansi "^5.1.0" + strip-ansi "^6.0.0" through "^2.3.6" internal-ip@^4.3.0: @@ -4556,11 +4556,6 @@ is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-promise@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= - is-regex@^1.0.4, is-regex@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" @@ -7334,12 +7329,10 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -run-async@^2.2.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.0.tgz#e59054a5b86876cfae07f431d18cbaddc594f1e8" - integrity sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg== - dependencies: - is-promise "^2.1.0" +run-async@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" + integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" @@ -7349,9 +7342,9 @@ run-queue@^1.0.0, run-queue@^1.0.3: aproba "^1.1.1" rxjs@^6.5.3: - version "6.5.4" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.4.tgz#e0777fe0d184cec7872df147f303572d414e211c" - integrity sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q== + version "6.5.5" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.5.tgz#c5c884e3094c8cfee31bf27eb87e54ccfc87f9ec" + integrity sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ== dependencies: tslib "^1.9.0" @@ -8277,9 +8270,9 @@ ts-pnp@^1.1.6: integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw== tslib@^1.9.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" - integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + version "1.11.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" + integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== tty-browserify@0.0.0: version "0.0.0" From 1bd3a7989bff6b02379b6c1eb4c3628f5f86b545 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:48:24 +0000 Subject: [PATCH 725/970] chore(deps): bump highcharts from 8.0.0 to 8.0.4 Bumps [highcharts](https://github.com/highcharts/highcharts-dist) from 8.0.0 to 8.0.4. - [Release notes](https://github.com/highcharts/highcharts-dist/releases) - [Commits](https://github.com/highcharts/highcharts-dist/compare/v8.0.0...v8.0.4) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index c749e552c..e25fb16c7 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "chalk": "^3.0.0", "echarts": "^4.5.0", "flatpickr": "^4.6.3", - "highcharts": "^8.0.0", + "highcharts": "^8.0.4", "intl-tel-input": "^16.0.8", "jquery.maskedinput": "^1.4.1", "select2": "^4.0.12", diff --git a/yarn.lock b/yarn.lock index 10136e704..4a899d459 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1218,7 +1218,7 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.0: +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2: version "6.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== @@ -1228,7 +1228,7 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.0: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.12.0: +ajv@^6.12.0, ajv@^6.5.5: version "6.12.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.2.tgz#c629c5eced17baf314437918d2da88c99d5958cd" integrity sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ== @@ -3967,10 +3967,10 @@ hex-color-regex@^1.1.0: resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== -highcharts@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/highcharts/-/highcharts-8.0.0.tgz#fcf77a511d6ea477b9d8447afd9dedbfc85e2727" - integrity sha512-jRKLiP0i29zKSEgMDASyrfpivrM3e8V8yTv8YUZtRzB2mXR+hsBNHWZw2hNRZVxqq1QCVmW/9Z/BLFvYlJELqA== +highcharts@^8.0.4: + version "8.0.4" + resolved "https://registry.yarnpkg.com/highcharts/-/highcharts-8.0.4.tgz#a717434012bd5f9b82b94b737d62acec501d360c" + integrity sha512-RD86/w7VNwuY96c2Pv16dtZujJ4vg5viiVjbFF/TCrvFpmtQRzBIECG90ww0JtiK6+6TKlwCYf0an+kgQshnRw== hmac-drbg@^1.0.0: version "1.0.1" From fc706749ace6613ee632fc64c00a64cc100b4363 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:49:15 +0000 Subject: [PATCH 726/970] chore(deps): bump esquery from 1.2.0 to 1.3.1 Bumps [esquery](https://github.com/estools/esquery) from 1.2.0 to 1.3.1. - [Release notes](https://github.com/estools/esquery/releases) - [Commits](https://github.com/estools/esquery/compare/v1.2.0...v1.3.1) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/yarn.lock b/yarn.lock index 10136e704..5e953f084 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1218,7 +1218,7 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.0: +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2: version "6.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== @@ -1228,7 +1228,7 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.0: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.12.0: +ajv@^6.12.0, ajv@^6.5.5: version "6.12.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.2.tgz#c629c5eced17baf314437918d2da88c99d5958cd" integrity sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ== @@ -3196,11 +3196,11 @@ esprima@^4.0.0: integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.2.0.tgz#a010a519c0288f2530b3404124bfb5f02e9797fe" - integrity sha512-weltsSqdeWIX9G2qQZz7KlTRJdkkOCTPgLYJUz1Hacf48R4YOwGPHO3+ORfWedqJKbq5WQmsgK90n+pFLIKt/Q== + version "1.3.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" + integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ== dependencies: - estraverse "^5.0.0" + estraverse "^5.1.0" esrecurse@^4.1.0: version "4.2.1" @@ -3214,10 +3214,10 @@ estraverse@^4.1.0, estraverse@^4.1.1: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -estraverse@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.0.0.tgz#ac81750b482c11cca26e4b07e83ed8f75fbcdc22" - integrity sha512-j3acdrMzqrxmJTNj5dbr1YbjacrYgAxVMeF0gK16E3j494mOe7xygM/ZLIguEQ0ETwAg2hlJCtHRGav+y0Ny5A== +estraverse@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.1.0.tgz#374309d39fd935ae500e7b92e8a6b4c720e59642" + integrity sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw== esutils@^2.0.2: version "2.0.3" From 9f287d9753aadebf0f323b28009409afdc0d2925 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 00:49:28 +0000 Subject: [PATCH 727/970] chore(deps): bump hash-base from 3.0.4 to 3.1.0 Bumps [hash-base](https://github.com/crypto-browserify/hash-base) from 3.0.4 to 3.1.0. - [Release notes](https://github.com/crypto-browserify/hash-base/releases) - [Commits](https://github.com/crypto-browserify/hash-base/compare/v3.0.4...v3.1.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/yarn.lock b/yarn.lock index 10136e704..ebda81c3a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1218,7 +1218,7 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.0: +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2: version "6.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== @@ -1228,7 +1228,7 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.0: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.12.0: +ajv@^6.12.0, ajv@^6.5.5: version "6.12.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.2.tgz#c629c5eced17baf314437918d2da88c99d5958cd" integrity sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ== @@ -3947,12 +3947,13 @@ has@^1.0.0, has@^1.0.3: function-bind "^1.1.1" hash-base@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" - integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" @@ -4239,7 +4240,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -7009,7 +7010,7 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -7032,23 +7033,10 @@ readable-stream@1.1: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@^2.0.2, readable-stream@^2.3.3: - version "2.3.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@^3.0.6: - version "3.4.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" - integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== +readable-stream@^3.0.6, readable-stream@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== dependencies: inherits "^2.0.3" string_decoder "^1.1.1" @@ -7360,7 +7348,7 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0: +safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== From 48cf80adaaba7c72c9f1a14eaeb6c8c1f9a7ed50 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 4 May 2020 09:41:11 +0300 Subject: [PATCH 728/970] Minor changes --- app/models/student.rb | 4 ++-- app/views/students/edit.html.erb | 2 +- app/views/user_management/users/_students.html.erb | 1 - config/locales/models/user/tr.yml | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/models/student.rb b/app/models/student.rb index 8a0a848ca..7d29b920b 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -80,6 +80,8 @@ def prospective_student user.prospective_students.find_by(unit_id: unit_id) end + private + def create_student_history create_history( entrance_type_id: prospective_student&.student_entrance_type_id, @@ -89,8 +91,6 @@ def create_student_history ) end - private - def build_identity_information Kps::IdentitySaveJob.perform_later(user, id) end diff --git a/app/views/students/edit.html.erb b/app/views/students/edit.html.erb index 4a09853b7..8d02bc4c8 100644 --- a/app/views/students/edit.html.erb +++ b/app/views/students/edit.html.erb @@ -79,7 +79,7 @@ diff --git a/app/views/user_management/users/_students.html.erb b/app/views/user_management/users/_students.html.erb index 2f00afcb6..8c206e82f 100644 --- a/app/views/user_management/users/_students.html.erb +++ b/app/views/user_management/users/_students.html.erb @@ -31,7 +31,6 @@ <%= student.exceeded_education_period ? t('yes') : t('no') %> - <%= t('.entrance_type') %> diff --git a/config/locales/models/user/tr.yml b/config/locales/models/user/tr.yml index 8b807c863..da297e02e 100644 --- a/config/locales/models/user/tr.yml +++ b/config/locales/models/user/tr.yml @@ -20,7 +20,7 @@ tr: end_date: Bitiş Tarihi start_date: Başlangıç Tarihi student: &student_attributes - exceeded_education_period: Eğitim süresi içerisinde mezun olamadı + exceeded_education_period: Okulu Uzattı scholarship_type: Burs Türü semester: Yarıyıl stage: Aşama From e18d6195beb658f949e03d5d9c33e4b88c3a77e5 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 4 May 2020 09:45:21 +0300 Subject: [PATCH 729/970] Add numericality validation test --- test/models/student_history_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/models/student_history_test.rb b/test/models/student_history_test.rb index b78621b9f..276bb5379 100644 --- a/test/models/student_history_test.rb +++ b/test/models/student_history_test.rb @@ -18,4 +18,5 @@ class StudentHistoryTest < ActiveSupport::TestCase # validations: numericality validates_numericality_of :preparatory_class + validates_numerical_range :preparatory_class, greater_than_or_equal_to: 0, less_than_or_equal_to: 2 end From 555b59b577ad43722c7ce18dfff99f93801b764c Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 4 May 2020 12:14:03 +0300 Subject: [PATCH 730/970] Add condition to daytime education for preparatory class --- app/models/student.rb | 4 ++++ app/services/debt/tuition/process/daytime_education.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/student.rb b/app/models/student.rb index 7d29b920b..0e0558d0e 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -76,6 +76,10 @@ def scholarship? scholarship_type_id? end + def preparatory_class_repetition? + preparatory_class.to_i >= 2 + end + def prospective_student user.prospective_students.find_by(unit_id: unit_id) end diff --git a/app/services/debt/tuition/process/daytime_education.rb b/app/services/debt/tuition/process/daytime_education.rb index 0c927eb62..e45d9762f 100644 --- a/app/services/debt/tuition/process/daytime_education.rb +++ b/app/services/debt/tuition/process/daytime_education.rb @@ -11,7 +11,7 @@ def initialize(student) end def chain - if exceeded? || other_studentship? + if exceeded? || other_studentship? || student.preparatory_class_repetition? Operation::Disability.new(Operation::NoDiscount.new) else Operation::Free.new From d7a9915ba71595b4b6e4f8b49f911937132cefe7 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Mon, 4 May 2020 16:39:52 +0300 Subject: [PATCH 731/970] Add identifier field to evaluation types --- ...00430130429_add_identifier_to_evaluation_type.rb | 9 +++++++++ db/structure.sql | 13 ++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20200430130429_add_identifier_to_evaluation_type.rb diff --git a/db/migrate/20200430130429_add_identifier_to_evaluation_type.rb b/db/migrate/20200430130429_add_identifier_to_evaluation_type.rb new file mode 100644 index 000000000..ebe1cd32f --- /dev/null +++ b/db/migrate/20200430130429_add_identifier_to_evaluation_type.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddIdentifierToEvaluationType < ActiveRecord::Migration[6.0] + def change + add_column :evaluation_types, :identifier, :string + add_length_constraint :evaluation_types, :identifier, less_than_or_equal_to: 255 + add_unique_constraint :evaluation_types, :identifier + end +end diff --git a/db/structure.sql b/db/structure.sql index 22b74c74c..7dee3ec3a 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1955,6 +1955,8 @@ ALTER SEQUENCE public.employees_id_seq OWNED BY public.employees.id; CREATE TABLE public.evaluation_types ( id bigint NOT NULL, name character varying, + identifier character varying, + CONSTRAINT evaluation_types_identifier_length CHECK ((length((identifier)::text) <= 255)), CONSTRAINT evaluation_types_name_length CHECK ((length((name)::text) <= 255)), CONSTRAINT evaluation_types_name_presence CHECK (((name IS NOT NULL) AND ((name)::text !~ '^\s*$'::text))) ); @@ -5134,6 +5136,14 @@ ALTER TABLE ONLY public.employees ADD CONSTRAINT employees_pkey PRIMARY KEY (id); +-- +-- Name: evaluation_types evaluation_types_identifier_unique; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.evaluation_types + ADD CONSTRAINT evaluation_types_identifier_unique UNIQUE (identifier) DEFERRABLE; + + -- -- Name: evaluation_types evaluation_types_name_unique; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -7803,6 +7813,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200319082359'), ('20200319085939'), ('20200319090221'), -('20200320114534'); +('20200320114534'), +('20200430130429'); From e6cd517a2241268e7eb28bb52bb95b5f5ad75d43 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Mon, 4 May 2020 16:40:36 +0300 Subject: [PATCH 732/970] Add validations for identifer field --- app/models/evaluation_type.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/evaluation_type.rb b/app/models/evaluation_type.rb index 664994e91..1689e15fb 100644 --- a/app/models/evaluation_type.rb +++ b/app/models/evaluation_type.rb @@ -13,6 +13,7 @@ class EvaluationType < ApplicationRecord # validations validates :name, presence: true, uniqueness: true, length: { maximum: 255 } + validates :identifier, uniqueness: true, length: { maximum: 255 } private From ef8938f213132257c41e3588cff3bbe83cec1e8f Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Mon, 4 May 2020 16:43:01 +0300 Subject: [PATCH 733/970] Add identifier to controller & views & locales --- app/controllers/reference/evaluation_types_controller.rb | 2 +- app/views/reference/evaluation_types/_form.html.erb | 4 ++++ app/views/reference/evaluation_types/index.html.erb | 2 +- config/locales/controllers/reference/evaluation_types.en.yml | 1 + config/locales/controllers/reference/evaluation_types.tr.yml | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/reference/evaluation_types_controller.rb b/app/controllers/reference/evaluation_types_controller.rb index 6e3bdccff..1a8322d3b 100644 --- a/app/controllers/reference/evaluation_types_controller.rb +++ b/app/controllers/reference/evaluation_types_controller.rb @@ -7,7 +7,7 @@ class EvaluationTypesController < ApplicationController private def secure_params - params.require(:evaluation_type).permit(:name) + params.require(:evaluation_type).permit(:identifier, :name) end end end diff --git a/app/views/reference/evaluation_types/_form.html.erb b/app/views/reference/evaluation_types/_form.html.erb index cc175940c..1724045d9 100644 --- a/app/views/reference/evaluation_types/_form.html.erb +++ b/app/views/reference/evaluation_types/_form.html.erb @@ -2,6 +2,10 @@ namespace: 'reference', klass: @evaluation_type, params: [ + { + field: 'identifier', + width: 12 + }, { field: 'name', width: 12, diff --git a/app/views/reference/evaluation_types/index.html.erb b/app/views/reference/evaluation_types/index.html.erb index c928d43eb..34823f4cc 100644 --- a/app/views/reference/evaluation_types/index.html.erb +++ b/app/views/reference/evaluation_types/index.html.erb @@ -4,5 +4,5 @@ collection: @evaluation_types, pagy: @pagy, card_header: t('.card_header'), - params: ['name'], + params: ['identifier', 'name'], actions: %w[edit destroy] %> diff --git a/config/locales/controllers/reference/evaluation_types.en.yml b/config/locales/controllers/reference/evaluation_types.en.yml index 3bc81aa47..322b8f424 100644 --- a/config/locales/controllers/reference/evaluation_types.en.yml +++ b/config/locales/controllers/reference/evaluation_types.en.yml @@ -3,6 +3,7 @@ en: attributes: evaluation_type: &evaluation_type_attributes name: Name of Evaluation Type + identifier: Type Identifier helpers: submit: evaluation_type: diff --git a/config/locales/controllers/reference/evaluation_types.tr.yml b/config/locales/controllers/reference/evaluation_types.tr.yml index e4674a5f4..ee3b8a262 100644 --- a/config/locales/controllers/reference/evaluation_types.tr.yml +++ b/config/locales/controllers/reference/evaluation_types.tr.yml @@ -3,6 +3,7 @@ tr: attributes: evaluation_type: &evaluation_type_attributes name: Değerlendirme Türü + identifier: Tür Tanımlayıcısı helpers: submit: evaluation_type: From aa0e599eaff8c96de3768df03b9d57a11c05834d Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Mon, 4 May 2020 16:44:30 +0300 Subject: [PATCH 734/970] Delegate identifier to course assessment method --- app/models/course_assessment_method.rb | 2 +- app/models/course_evaluation_type.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/course_assessment_method.rb b/app/models/course_assessment_method.rb index 9a5f77327..a5ecc0330 100644 --- a/app/models/course_assessment_method.rb +++ b/app/models/course_assessment_method.rb @@ -20,7 +20,7 @@ class CourseAssessmentMethod < ApplicationRecord validates :assessment_method, uniqueness: { scope: :course_evaluation_type } # delegates - delegate :available_course, to: :course_evaluation_type + delegate :available_course, :identifier, to: :course_evaluation_type delegate :name, to: :assessment_method # custom methods diff --git a/app/models/course_evaluation_type.rb b/app/models/course_evaluation_type.rb index d861a1e69..a42864943 100644 --- a/app/models/course_evaluation_type.rb +++ b/app/models/course_evaluation_type.rb @@ -20,5 +20,5 @@ class CourseEvaluationType < ApplicationRecord validates_with CourseEvaluationTypeValidator # delegations - delegate :name, to: :evaluation_type + delegate :identifier, :name, to: :evaluation_type end From a8065b532c6ff9c6eee0c299fccb718ebc0081cf Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Mon, 4 May 2020 16:44:57 +0300 Subject: [PATCH 735/970] Remove redundant method --- app/decorators/assessment_decorator.rb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/decorators/assessment_decorator.rb b/app/decorators/assessment_decorator.rb index 6f151af71..9c5d906f3 100644 --- a/app/decorators/assessment_decorator.rb +++ b/app/decorators/assessment_decorator.rb @@ -18,15 +18,4 @@ def results_announcement_event def calendar course_evaluation_type.available_course.unit.calendars.last end - - def identifier - case course_evaluation_type.name - when 'Dönem İçi Değerlendirme' - 'mid_term_results_announcement' - when 'Dönem Sonu Değerlendirme' - 'final_results_announcement' - when 'Bütünleme Değerlendirme' - 'retake_results_announcement' - end - end end From 0d9eae49b3ee0480e8f8e7eb17becc13de1ebd5c Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Mon, 4 May 2020 16:45:49 +0300 Subject: [PATCH 736/970] Add a task to fill evaluation types' identifier --- lib/tasks/fix_data.rake | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/tasks/fix_data.rake b/lib/tasks/fix_data.rake index 86793dfcc..da37df04f 100644 --- a/lib/tasks/fix_data.rake +++ b/lib/tasks/fix_data.rake @@ -9,4 +9,21 @@ namespace :fix_data do end end end + + desc "Fills evaluation types' identifier field" + task evaluation_types: :environment do + EvaluationType.where(identifier: nil).each do |evaluation_type| + identifier = + case evaluation_type.name + when 'Dönem İçi Değerlendirme' + 'mid_term_results_announcement' + when 'Dönem Sonu Değerlendirme' + 'final_results_announcement' + when 'Bütünleme Değerlendirme' + 'retake_results_announcement' + end + + evaluation_type.update(identifier: identifier) + end + end end From c2049d5eebcceba1fae313dc82dd347cbdc8ca13 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Mon, 4 May 2020 16:47:56 +0300 Subject: [PATCH 737/970] Edit evaluation type tests & fixtures --- .../controllers/reference/evaluation_types_controller_test.rb | 4 ++-- test/fixtures/evaluation_types.yml | 4 ++++ test/models/evaluation_type_test.rb | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/controllers/reference/evaluation_types_controller_test.rb b/test/controllers/reference/evaluation_types_controller_test.rb index bc094f932..3ea1829bd 100644 --- a/test/controllers/reference/evaluation_types_controller_test.rb +++ b/test/controllers/reference/evaluation_types_controller_test.rb @@ -8,7 +8,7 @@ class EvaluationTypesControllerTest < ActionDispatch::IntegrationTest setup do @target_path = 'reference' - @create_params = { name: 'Test Create' } - @update_params = { name: 'Test Update' } + @create_params = { identifier: 'test_identifier', name: 'Test Create' } + @update_params = { identifier: 'test_identifier', name: 'Test Update' } end end diff --git a/test/fixtures/evaluation_types.yml b/test/fixtures/evaluation_types.yml index 797fa8471..f1b507ec0 100644 --- a/test/fixtures/evaluation_types.yml +++ b/test/fixtures/evaluation_types.yml @@ -1,11 +1,15 @@ undergraduate_midterm: name: Dönem İçi Değerlendirme + identifier: mid_term_results_announcement undergraduate_final: name: Dönem Sonu Değerlendirme + identifier: final_results_announcement undergraduate_retake: name: Bütünleme Değerlendirme + identifier: retake_results_announcement evaluation_type_to_delete: name: This evaluation type will be deleted + identifier: retake_results_announcement diff --git a/test/models/evaluation_type_test.rb b/test/models/evaluation_type_test.rb index c907b88f1..f76184769 100644 --- a/test/models/evaluation_type_test.rb +++ b/test/models/evaluation_type_test.rb @@ -16,9 +16,11 @@ class EvaluationTypeTest < ActiveSupport::TestCase # validations: uniqueness validates_uniqueness_of :name + validates_uniqueness_of :identifier # validations: length validates_length_of :name + validates_length_of :identifier # callbacks before_validation :capitalize_attributes From 13da704cda272c0db66fda3a9d5c1c7425ab2962 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Mon, 4 May 2020 16:49:17 +0300 Subject: [PATCH 738/970] Remove redundant task --- lib/tasks/fix_data.rake | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/tasks/fix_data.rake b/lib/tasks/fix_data.rake index da37df04f..b0d391bbc 100644 --- a/lib/tasks/fix_data.rake +++ b/lib/tasks/fix_data.rake @@ -1,15 +1,6 @@ # frozen_string_literal: true namespace :fix_data do - desc 'Creates missing unit calendar data for departments' - task department_calendars: :environment do - UnitCalendar.all.each do |unit_calendar| - unit_calendar.unit.descendants.active.departments.each do |descendant| - UnitCalendar.create(calendar: unit_calendar.calendar, unit: descendant) - end - end - end - desc "Fills evaluation types' identifier field" task evaluation_types: :environment do EvaluationType.where(identifier: nil).each do |evaluation_type| From ebb5a8645482387583d346c682f2fb551406a29f Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 5 May 2020 15:11:25 +0300 Subject: [PATCH 739/970] Fix typo --- .../controllers/calendar_management/calendar_events.tr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/controllers/calendar_management/calendar_events.tr.yml b/config/locales/controllers/calendar_management/calendar_events.tr.yml index e044364ab..0a651eb83 100644 --- a/config/locales/controllers/calendar_management/calendar_events.tr.yml +++ b/config/locales/controllers/calendar_management/calendar_events.tr.yml @@ -12,5 +12,5 @@ tr: calendars: calendar_event_fields: <<: *calendar_event_attributes - date_range: "Ekinlik Tarihleri: %{start_time} - %{end_time}" + date_range: "Etkinlik Tarihleri: %{start_time} - %{end_time}" undefined_date_range: Etkinlik tarihleri tanımlanmamış. From 072c8ef861bab9b1d3ad19e78ab727b3de9e5bbf Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 5 May 2020 15:14:16 +0300 Subject: [PATCH 740/970] Add active calendars relation to available course --- app/decorators/assessment_decorator.rb | 2 +- app/models/available_course.rb | 1 + test/models/available_course_test.rb | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/decorators/assessment_decorator.rb b/app/decorators/assessment_decorator.rb index 9c5d906f3..d698172f2 100644 --- a/app/decorators/assessment_decorator.rb +++ b/app/decorators/assessment_decorator.rb @@ -16,6 +16,6 @@ def results_announcement_event private def calendar - course_evaluation_type.available_course.unit.calendars.last + course_evaluation_type.available_course.calendars.last end end diff --git a/app/models/available_course.rb b/app/models/available_course.rb index 61dcc1d73..5ca745eea 100644 --- a/app/models/available_course.rb +++ b/app/models/available_course.rb @@ -24,6 +24,7 @@ class AvailableCourse < ApplicationRecord belongs_to :curriculum belongs_to :unit has_many :evaluation_types, class_name: 'CourseEvaluationType', dependent: :destroy + has_many :calendars, -> { Calendar.active }, through: :unit has_many :course_assessment_methods, through: :evaluation_types has_many :groups, class_name: 'AvailableCourseGroup', dependent: :destroy has_many :lecturers, through: :groups diff --git a/test/models/available_course_test.rb b/test/models/available_course_test.rb index 7629d5a13..69ae7f410 100644 --- a/test/models/available_course_test.rb +++ b/test/models/available_course_test.rb @@ -13,6 +13,7 @@ class AvailableCourseTest < ActiveSupport::TestCase belongs_to :curriculum belongs_to :unit has_many :evaluation_types, class_name: 'CourseEvaluationType', dependent: :destroy + has_many :calendars, through: :unit has_many :course_assessment_methods, through: :evaluation_types has_many :groups, class_name: 'AvailableCourseGroup', dependent: :destroy has_many :lecturers, through: :groups From 55560c21db6a91e0d0d01ef602c6c9421a8e6e06 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 5 May 2020 16:05:21 +0300 Subject: [PATCH 741/970] Show date range only --- app/decorators/calendar_event_decorator.rb | 14 ++------------ test/decorators/calendar_event_decorator_test.rb | 12 +----------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/app/decorators/calendar_event_decorator.rb b/app/decorators/calendar_event_decorator.rb index 3e0e74dc3..30e452c9b 100644 --- a/app/decorators/calendar_event_decorator.rb +++ b/app/decorators/calendar_event_decorator.rb @@ -8,18 +8,8 @@ def active_now? end def date_range - return translate('undefined_date_range') unless presence + return I18n.t('calendar_management.calendar_events.undefined_date_range') unless presence - translate( - 'date_range', - start_time: start_time&.strftime('%F %R'), - end_time: end_time&.strftime('%F %R') - ) - end - - private - - def translate(key, params = {}) - I18n.t("calendar_management.calendars.#{key}", **params) + "#{start_time&.strftime('%F %R')} - #{end_time&.strftime('%F %R')}" end end diff --git a/test/decorators/calendar_event_decorator_test.rb b/test/decorators/calendar_event_decorator_test.rb index fe834a996..194412145 100644 --- a/test/decorators/calendar_event_decorator_test.rb +++ b/test/decorators/calendar_event_decorator_test.rb @@ -14,16 +14,6 @@ class CalendarEventDecoratorTest < ActiveSupport::TestCase test 'date_range? method' do assert_equal @calendar_event.date_range, - translate( - 'date_range', - start_time: @calendar_event.start_time&.strftime('%F %R'), - end_time: @calendar_event.end_time&.strftime('%F %R') - ) - end - - private - - def translate(key, params = {}) - t("calendar_management.calendars.#{key}", params) + "#{@calendar_event.start_time&.strftime('%F %R')} - #{@calendar_event.end_time&.strftime('%F %R')}" end end From b289f4d70aaf1d42c06e070c357e3211d4d20d6b Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 5 May 2020 16:05:51 +0300 Subject: [PATCH 742/970] Update calendar event locales --- .../controllers/calendar_management/calendar_events.en.yml | 2 +- .../controllers/calendar_management/calendar_events.tr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/controllers/calendar_management/calendar_events.en.yml b/config/locales/controllers/calendar_management/calendar_events.en.yml index d953da6d0..db704c2d6 100644 --- a/config/locales/controllers/calendar_management/calendar_events.en.yml +++ b/config/locales/controllers/calendar_management/calendar_events.en.yml @@ -12,5 +12,5 @@ en: calendars: calendar_event_fields: <<: *calendar_event_attributes - date_range: "Event Dates: %{start_time} - %{end_time}" + calendar_events: undefined_date_range: Event dates are not defined. diff --git a/config/locales/controllers/calendar_management/calendar_events.tr.yml b/config/locales/controllers/calendar_management/calendar_events.tr.yml index 0a651eb83..2bd7548fe 100644 --- a/config/locales/controllers/calendar_management/calendar_events.tr.yml +++ b/config/locales/controllers/calendar_management/calendar_events.tr.yml @@ -12,5 +12,5 @@ tr: calendars: calendar_event_fields: <<: *calendar_event_attributes - date_range: "Etkinlik Tarihleri: %{start_time} - %{end_time}" + calendar_events: undefined_date_range: Etkinlik tarihleri tanımlanmamış. From 7ccff14b9a5b2e05c162a092d46b25cb7c7531a8 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 5 May 2020 16:06:46 +0300 Subject: [PATCH 743/970] Show date range properly --- app/views/studentship/course_enrollments/index.html.erb | 2 +- .../locales/controllers/studentship/course_enrollments.en.yml | 1 + .../locales/controllers/studentship/course_enrollments.tr.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/studentship/course_enrollments/index.html.erb b/app/views/studentship/course_enrollments/index.html.erb index e2c32fcd3..ca568db33 100644 --- a/app/views/studentship/course_enrollments/index.html.erb +++ b/app/views/studentship/course_enrollments/index.html.erb @@ -20,7 +20,7 @@
<%= @student.unit.name %>
-

<%= @student.event_online_course_registrations.date_range %>

+

<%= "#{t('.registration_date_range')}: #{@student.event_online_course_registrations.date_range}" %>

<%= "#{t('.registration_status')}: #{enum_t(@student.current_registration, :status)}" %> <% end %>
diff --git a/config/locales/controllers/studentship/course_enrollments.en.yml b/config/locales/controllers/studentship/course_enrollments.en.yml index dabd7fa5b..7871dfa47 100644 --- a/config/locales/controllers/studentship/course_enrollments.en.yml +++ b/config/locales/controllers/studentship/course_enrollments.en.yml @@ -40,6 +40,7 @@ en: index: course_enrollments: Course Enrollments registration_status: Enrollment Status + registration_date_range: Course Registration Date Range list: <<: *course_attributes sequence: Sequence diff --git a/config/locales/controllers/studentship/course_enrollments.tr.yml b/config/locales/controllers/studentship/course_enrollments.tr.yml index fba985b78..9f311e958 100644 --- a/config/locales/controllers/studentship/course_enrollments.tr.yml +++ b/config/locales/controllers/studentship/course_enrollments.tr.yml @@ -40,6 +40,7 @@ tr: index: course_enrollments: Ders Kayıtları registration_status: Kayıt Durumu + registration_date_range: Ders Kayıt Tarih Aralığı list: <<: *course_attributes sequence: Dönem From 1ec550850f9cc6b6ad5459d4c49031656246ff8f Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 5 May 2020 16:07:58 +0300 Subject: [PATCH 744/970] Show number of students & date range --- .../instructiveness/assessments/_assessment_info.html.erb | 6 ++++++ .../locales/controllers/instructiveness/assessments.en.yml | 2 ++ .../locales/controllers/instructiveness/assessments.tr.yml | 2 ++ 3 files changed, 10 insertions(+) diff --git a/app/views/instructiveness/assessments/_assessment_info.html.erb b/app/views/instructiveness/assessments/_assessment_info.html.erb index db0c54197..0d5802bb8 100644 --- a/app/views/instructiveness/assessments/_assessment_info.html.erb +++ b/app/views/instructiveness/assessments/_assessment_info.html.erb @@ -14,8 +14,14 @@ <%= t('.assessment') %> <%= @assessment.name %> + <%= t('.number_of_students') %> + <%= @enrollments.count %> + + <%= t('.status') %> <%= enum_t(@assessment, :status) %> + <%= t('.date_range') %> + <%= @assessment.results_announcement_event.date_range %> diff --git a/config/locales/controllers/instructiveness/assessments.en.yml b/config/locales/controllers/instructiveness/assessments.en.yml index 3f171d929..b34ec2137 100644 --- a/config/locales/controllers/instructiveness/assessments.en.yml +++ b/config/locales/controllers/instructiveness/assessments.en.yml @@ -16,7 +16,9 @@ en: assessment_info: evaluation_type: Evaluation Type assessment: Assessment Method + date_range: Evaluation Date Range grade_entry: Grade Entry + number_of_students: Number of Students percentage: Percentage status: Status draft: diff --git a/config/locales/controllers/instructiveness/assessments.tr.yml b/config/locales/controllers/instructiveness/assessments.tr.yml index aed26bc67..589626de3 100644 --- a/config/locales/controllers/instructiveness/assessments.tr.yml +++ b/config/locales/controllers/instructiveness/assessments.tr.yml @@ -16,7 +16,9 @@ tr: assessment_info: evaluation_type: Değerlendirme Türü assessment: Ölçme Kriteri + date_range: Değerlendirme Tarih Aralığı grade_entry: Not Girişi + number_of_students: Öğrenci Sayısı percentage: Yüzde status: Durum draft: From 0a21b41b526a38ba6f7c120fa8ddc8d2d6f2e6b5 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Tue, 5 May 2020 16:10:37 +0300 Subject: [PATCH 745/970] Rearrange assessment action links' logic --- app/views/instructiveness/assessments/show.html.erb | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/views/instructiveness/assessments/show.html.erb b/app/views/instructiveness/assessments/show.html.erb index c2cf8e381..5478fb2d4 100644 --- a/app/views/instructiveness/assessments/show.html.erb +++ b/app/views/instructiveness/assessments/show.html.erb @@ -9,16 +9,13 @@ <%= fa_icon 'users' %><%= t('.students', course_name: @course.name) %>
- <% if @employee.coordinatorships.include?(@course) %> - <%= link_to(t('.draft'), draft_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.saved? %> - <%= link_to(t('.save'), save_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.saveable? %> - <% end %> + <% if @assessment.results_announcement_event.active_now? %> + <% if @employee.coordinatorships.include?(@course) %> + <%= link_to(t('.draft'), draft_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.saved? %> + <%= link_to(t('.save'), save_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.saveable? %> + <% end %> - <% event = @assessment.results_announcement_event %> - <% if event.active_now? %> <%= link_to_edit(t('action_group.edit'), edit_given_course_assessment_path(@course, @assessment), class: 'btn btn-outline-success btn-sm') if @assessment.editable? %> - <% else %> - <%= event.date_range %> <% end %>
From 45f8246269280b636f2f147695099ca9c6715f15 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 6 May 2020 15:14:51 +0300 Subject: [PATCH 746/970] Update fixture name --- test/fixtures/calendar_event_types.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/calendar_event_types.yml b/test/fixtures/calendar_event_types.yml index 4f86f17ab..1bc2d0727 100644 --- a/test/fixtures/calendar_event_types.yml +++ b/test/fixtures/calendar_event_types.yml @@ -15,7 +15,7 @@ excused_mid_term_applications: identifier: excused_mid_term_applications category: applications mid_term_results_announcement: - name: Ara Sınav + name: Ara Sınav Sonuçlarının İlanı identifier: mid_term_results_announcement category: announcement calendar_event_type_to_delete: From d99d816bbc1e525f2e144ca2ee6891d0bcd05607 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 6 May 2020 15:33:16 +0300 Subject: [PATCH 747/970] Create relation instead of delegation --- app/models/course_assessment_method.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/course_assessment_method.rb b/app/models/course_assessment_method.rb index a5ecc0330..e091b7d03 100644 --- a/app/models/course_assessment_method.rb +++ b/app/models/course_assessment_method.rb @@ -9,6 +9,7 @@ class CourseAssessmentMethod < ApplicationRecord belongs_to :course_evaluation_type has_many :grades, dependent: :destroy has_many :saved_enrollments, through: :course_evaluation_type + has_one :available_course, through: :course_evaluation_type accepts_nested_attributes_for :grades # validations @@ -20,7 +21,7 @@ class CourseAssessmentMethod < ApplicationRecord validates :assessment_method, uniqueness: { scope: :course_evaluation_type } # delegates - delegate :available_course, :identifier, to: :course_evaluation_type + delegate :identifier, to: :course_evaluation_type delegate :name, to: :assessment_method # custom methods From b8c9dbd7ba291c2d643b3739be67bfbbede6a783 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 6 May 2020 15:43:04 +0300 Subject: [PATCH 748/970] Add forgotten tests --- test/decorators/student_decorator_test.rb | 4 ++++ test/models/course_assessment_method_test.rb | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/decorators/student_decorator_test.rb b/test/decorators/student_decorator_test.rb index aad699c2d..8eff8a8b0 100644 --- a/test/decorators/student_decorator_test.rb +++ b/test/decorators/student_decorator_test.rb @@ -6,4 +6,8 @@ class StudentDecoratorTest < ActiveSupport::TestCase setup do @student = StudentDecorator.new(students(:serhat)) end + + test 'event_online_course_registrations method' do + assert @student.event_online_course_registrations + end end diff --git a/test/models/course_assessment_method_test.rb b/test/models/course_assessment_method_test.rb index 5ba7259a5..396aae329 100644 --- a/test/models/course_assessment_method_test.rb +++ b/test/models/course_assessment_method_test.rb @@ -14,6 +14,8 @@ class CourseAssessmentMethodTest < ActiveSupport::TestCase belongs_to :assessment_method belongs_to :course_evaluation_type has_many :grades, dependent: :destroy + has_many :saved_enrollments, through: :course_evaluation_type + has_one :available_course, through: :course_evaluation_type accepts_nested_attributes_for :grades # validations: presence @@ -29,7 +31,7 @@ class CourseAssessmentMethodTest < ActiveSupport::TestCase # delegates %i[ - available_course + identifier name ].each do |property| test "a course_assessment_method reach #{property} parameter" do From bbb02b02a26c5d747e0c9dcd8c300c980199770c Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 6 May 2020 15:51:27 +0300 Subject: [PATCH 749/970] Reach calendar shortcut --- app/decorators/assessment_decorator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/decorators/assessment_decorator.rb b/app/decorators/assessment_decorator.rb index d698172f2..d3a2fa0ca 100644 --- a/app/decorators/assessment_decorator.rb +++ b/app/decorators/assessment_decorator.rb @@ -16,6 +16,6 @@ def results_announcement_event private def calendar - course_evaluation_type.available_course.calendars.last + available_course.calendars.last end end From a59791835837aeb37d545f467f196475d0bf4408 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 6 May 2020 15:54:46 +0300 Subject: [PATCH 750/970] Add presence validation for identifier --- app/models/evaluation_type.rb | 2 +- app/views/reference/evaluation_types/_form.html.erb | 3 ++- test/models/evaluation_type_test.rb | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/evaluation_type.rb b/app/models/evaluation_type.rb index 1689e15fb..f7101f98c 100644 --- a/app/models/evaluation_type.rb +++ b/app/models/evaluation_type.rb @@ -13,7 +13,7 @@ class EvaluationType < ApplicationRecord # validations validates :name, presence: true, uniqueness: true, length: { maximum: 255 } - validates :identifier, uniqueness: true, length: { maximum: 255 } + validates :identifier, presence: true, uniqueness: true, length: { maximum: 255 } private diff --git a/app/views/reference/evaluation_types/_form.html.erb b/app/views/reference/evaluation_types/_form.html.erb index 1724045d9..d66adc614 100644 --- a/app/views/reference/evaluation_types/_form.html.erb +++ b/app/views/reference/evaluation_types/_form.html.erb @@ -4,7 +4,8 @@ params: [ { field: 'identifier', - width: 12 + width: 12, + required: true }, { field: 'name', diff --git a/test/models/evaluation_type_test.rb b/test/models/evaluation_type_test.rb index f76184769..f3bcc9404 100644 --- a/test/models/evaluation_type_test.rb +++ b/test/models/evaluation_type_test.rb @@ -13,6 +13,7 @@ class EvaluationTypeTest < ActiveSupport::TestCase # validations: presence validates_presence_of :name + validates_presence_of :identifier # validations: uniqueness validates_uniqueness_of :name From da2610300e82cd0f44b06827c57bde1b249fd0a9 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Wed, 6 May 2020 23:16:54 +0300 Subject: [PATCH 751/970] Revert "Remove redundant methods" This reverts commit ea75a1156a51e3ab37f54c27eeedd5b0bae33f40. --- app/models/calendar.rb | 4 ++++ app/models/calendar_event.rb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/models/calendar.rb b/app/models/calendar.rb index 2c6074e9d..b95ebb3b4 100644 --- a/app/models/calendar.rb +++ b/app/models/calendar.rb @@ -57,6 +57,10 @@ def event(identifier) calendar_events.find_by(calendar_event_type: type) end + def check_events(identifier) + event(identifier).try(:active_now?) + end + private def event_type(identifier) diff --git a/app/models/calendar_event.rb b/app/models/calendar_event.rb index 91c65dac1..457c90fdd 100644 --- a/app/models/calendar_event.rb +++ b/app/models/calendar_event.rb @@ -21,4 +21,8 @@ class CalendarEvent < ApplicationRecord # delegations delegate :name, to: :calendar_event_type, prefix: :type + + def active_now? + end_time ? Time.current.between?(start_time, end_time) : start_time.past? + end end From 7e3ab1e5a1a8e3a355396b7fbcaedb7748e279d9 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 7 May 2020 07:55:58 +0300 Subject: [PATCH 752/970] Remove relocated method --- app/decorators/calendar_event_decorator.rb | 6 ------ test/decorators/calendar_event_decorator_test.rb | 5 ----- 2 files changed, 11 deletions(-) diff --git a/app/decorators/calendar_event_decorator.rb b/app/decorators/calendar_event_decorator.rb index 30e452c9b..d79e21c1d 100644 --- a/app/decorators/calendar_event_decorator.rb +++ b/app/decorators/calendar_event_decorator.rb @@ -1,12 +1,6 @@ # frozen_string_literal: true class CalendarEventDecorator < SimpleDelegator - def active_now? - return unless presence - - end_time ? Time.current.between?(start_time, end_time) : start_time.past? - end - def date_range return I18n.t('calendar_management.calendar_events.undefined_date_range') unless presence diff --git a/test/decorators/calendar_event_decorator_test.rb b/test/decorators/calendar_event_decorator_test.rb index 194412145..6866aff32 100644 --- a/test/decorators/calendar_event_decorator_test.rb +++ b/test/decorators/calendar_event_decorator_test.rb @@ -7,11 +7,6 @@ class CalendarEventDecoratorTest < ActiveSupport::TestCase @calendar_event = CalendarEventDecorator.new(calendar_events(:mid_term_results_announcement)) end - test 'active_now? method' do - assert_not CalendarEventDecorator.new(calendar_events(:add_drop_fall_2018_grad)).active_now? - assert @calendar_event.active_now? - end - test 'date_range? method' do assert_equal @calendar_event.date_range, "#{@calendar_event.start_time&.strftime('%F %R')} - #{@calendar_event.end_time&.strftime('%F %R')}" From 39f9f37cb5396fee7da73a7b628f9e4176f81fc7 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 7 May 2020 07:56:41 +0300 Subject: [PATCH 753/970] Add relocated methods' tests --- test/models/calendar_event_test.rb | 5 +++++ test/models/calendar_test.rb | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/test/models/calendar_event_test.rb b/test/models/calendar_event_test.rb index fc12c5e93..af9365dba 100644 --- a/test/models/calendar_event_test.rb +++ b/test/models/calendar_event_test.rb @@ -19,4 +19,9 @@ class CalendarEventTest < ActiveSupport::TestCase # validations: length validates_length_of :timezone + + test 'active_now? method' do + assert_not calendar_events(:add_drop_fall_2018_grad).active_now? + assert calendar_events(:mid_term_results_announcement).active_now? + end end diff --git a/test/models/calendar_test.rb b/test/models/calendar_test.rb index 03e8d4a16..b53fd9cd7 100644 --- a/test/models/calendar_test.rb +++ b/test/models/calendar_test.rb @@ -37,4 +37,8 @@ class CalendarTest < ActiveSupport::TestCase event = calendar_events(:online_course_registrations) assert_equal calendars(:bm_calendar).event('online_course_registrations'), event end + + test 'check if events exists' do + assert calendars(:bm_calendar).check_events('online_course_registrations') + end end From 59f2ae5d245402fd1262823594590258fb376bc7 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 7 May 2020 07:58:09 +0300 Subject: [PATCH 754/970] Use check events --- app/decorators/prospective_student_decorator.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/decorators/prospective_student_decorator.rb b/app/decorators/prospective_student_decorator.rb index 2a1556766..6754adeae 100644 --- a/app/decorators/prospective_student_decorator.rb +++ b/app/decorators/prospective_student_decorator.rb @@ -14,11 +14,11 @@ def registration_documents end def permanent_registrable? - CalendarEventDecorator.new(calendar&.event('permanent_registration_applications')).active_now? + calendar&.check_events('permanent_registration_applications') end def temporary_registrable? - CalendarEventDecorator.new(calendar&.event('temporary_registration_applications')).active_now? + calendar&.check_events('temporary_registration_applications') end def document_required? From 7f27ce7e5b3d90ecbcfd904940a88aed5a8280f4 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 7 May 2020 07:59:32 +0300 Subject: [PATCH 755/970] Use safe navigation --- app/controllers/instructiveness/assessments_controller.rb | 2 +- app/controllers/studentship/course_enrollments_controller.rb | 2 +- app/views/instructiveness/assessments/show.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/instructiveness/assessments_controller.rb b/app/controllers/instructiveness/assessments_controller.rb index 97d828bee..01d536091 100644 --- a/app/controllers/instructiveness/assessments_controller.rb +++ b/app/controllers/instructiveness/assessments_controller.rb @@ -62,7 +62,7 @@ def authorized? end def event_active? - redirect_with('.errors.not_proper_event_range') unless @assessment.results_announcement_event.active_now? + redirect_with('.errors.not_proper_event_range') unless @assessment.results_announcement_event&.active_now? end def coordinator? diff --git a/app/controllers/studentship/course_enrollments_controller.rb b/app/controllers/studentship/course_enrollments_controller.rb index e9f150fca..b598e8c85 100644 --- a/app/controllers/studentship/course_enrollments_controller.rb +++ b/app/controllers/studentship/course_enrollments_controller.rb @@ -64,7 +64,7 @@ def authorized? end def event_active? - return if @student.event_online_course_registrations.active_now? + return if @student.event_online_course_registrations&.active_now? redirect_to(student_course_enrollments_path(@student), alert: t('.errors.not_proper_register_event_range')) end diff --git a/app/views/instructiveness/assessments/show.html.erb b/app/views/instructiveness/assessments/show.html.erb index 5478fb2d4..f442a0d1f 100644 --- a/app/views/instructiveness/assessments/show.html.erb +++ b/app/views/instructiveness/assessments/show.html.erb @@ -9,7 +9,7 @@ <%= fa_icon 'users' %><%= t('.students', course_name: @course.name) %>
- <% if @assessment.results_announcement_event.active_now? %> + <% if @assessment.results_announcement_event&.active_now? %> <% if @employee.coordinatorships.include?(@course) %> <%= link_to(t('.draft'), draft_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.saved? %> <%= link_to(t('.save'), save_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.saveable? %> From ed7dbe6e38dca53a33e316c08f8e4a98e8934b60 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 7 May 2020 10:27:57 +0300 Subject: [PATCH 756/970] Add timestamps --- db/migrate/20200427103727_create_student_histories.rb | 2 +- db/structure.sql | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/db/migrate/20200427103727_create_student_histories.rb b/db/migrate/20200427103727_create_student_histories.rb index ce0b2672d..ea089cd2f 100644 --- a/db/migrate/20200427103727_create_student_histories.rb +++ b/db/migrate/20200427103727_create_student_histories.rb @@ -11,7 +11,7 @@ def change t.references :graduation_term, foreign_key: { to_table: :academic_terms } t.boolean :other_studentship, default: false t.integer :preparatory_class, default: 0 - t.datetime :updated_at + t.timestamps end add_null_constraint :student_histories, :other_studentship diff --git a/db/structure.sql b/db/structure.sql index 35dfca6ce..d5b012777 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -3368,7 +3368,8 @@ CREATE TABLE public.student_histories ( graduation_term_id bigint, other_studentship boolean DEFAULT false, preparatory_class integer DEFAULT 0, - updated_at timestamp without time zone, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL, CONSTRAINT student_histories_other_studentship_null CHECK ((other_studentship IS NOT NULL)), CONSTRAINT student_histories_preparatory_class_numericality CHECK ((preparatory_class >= 0)) ); From f1646ee2736cafb867b653f2f01de8d81c8d7125 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 7 May 2020 10:29:16 +0300 Subject: [PATCH 757/970] Remove redundant comment --- test/fixtures/student_histories.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/fixtures/student_histories.yml b/test/fixtures/student_histories.yml index e3fbe13e2..ea8473613 100644 --- a/test/fixtures/student_histories.yml +++ b/test/fixtures/student_histories.yml @@ -1,5 +1,3 @@ -# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - serhat: student: serhat entrance_type: dgs From b771425b3fdf56cd34c2390902f9e1bc5b5b66d7 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 7 May 2020 11:08:01 +0300 Subject: [PATCH 758/970] Edit student controller test --- test/controllers/students_controller_test.rb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/test/controllers/students_controller_test.rb b/test/controllers/students_controller_test.rb index e2057b3c2..2587790b0 100644 --- a/test/controllers/students_controller_test.rb +++ b/test/controllers/students_controller_test.rb @@ -6,6 +6,7 @@ class StudentsControllerTest < ActionDispatch::IntegrationTest setup do sign_in users(:john) @student = students(:serhat) + @academic_term = academic_terms(:fall_2018_2019) end test 'should get edit' do @@ -17,13 +18,25 @@ class StudentsControllerTest < ActionDispatch::IntegrationTest test 'should update student' do patch student_path(@student), params: { student: { - scholarship_type_id: scholarship_types(:kkk).id + scholarship_type_id: scholarship_types(:kkk).id, + history_attributes: { + entrance_type_id: student_entrance_types(:osys).id, + registration_date: '2018-09-12 08:00:00', + registration_term_id: @academic_term.id, + other_studentship: true, + preparatory_class: 1 + } } } @student.reload - assert_equal 'Kara Kuvvetleri Komutanlığı', @student.scholarship_type_name + assert_equal @student.scholarship_type_name, 'Kara Kuvvetleri Komutanlığı' + assert_equal @student.entrance_type.name, 'ÖSYS' + assert_equal @student.registration_date, '2018-09-12 08:00:00'.in_time_zone + assert_equal @student.registration_term, @academic_term + assert_equal @student.preparatory_class, 1 + assert @student.other_studentship assert_redirected_to user_path(@student.user) assert_equal translate('students.update.success'), flash[:notice] end From 40c24978251e263c53417bb33ff97b114a0790ee Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 7 May 2020 15:15:24 +0300 Subject: [PATCH 759/970] Remove student history model --- app/controllers/students_controller.rb | 10 +- .../user_management/users_controller.rb | 2 +- app/models/student.rb | 22 +-- app/models/student_history.rb | 15 -- app/views/students/edit.html.erb | 52 +++---- .../user_management/users/_students.html.erb | 8 +- config/locales/models/user/en.yml | 14 +- config/locales/models/user/tr.yml | 14 +- .../20200427103727_add_columns_to_student.rb | 14 ++ ...20200427103727_create_student_histories.rb | 21 --- db/structure.sql | 132 ++++-------------- 11 files changed, 84 insertions(+), 220 deletions(-) delete mode 100644 app/models/student_history.rb create mode 100644 db/migrate/20200427103727_add_columns_to_student.rb delete mode 100644 db/migrate/20200427103727_create_student_histories.rb diff --git a/app/controllers/students_controller.rb b/app/controllers/students_controller.rb index d708a5b2b..93a2277a2 100644 --- a/app/controllers/students_controller.rb +++ b/app/controllers/students_controller.rb @@ -4,9 +4,7 @@ class StudentsController < ApplicationController before_action :set_student before_action :authorized? - def edit - @student.build_history if @student.history.nil? - end + def edit; end def update @student.update(student_params) ? redirect_to(user_path(@student.user), notice: t('.success')) : render(:edit) @@ -24,10 +22,8 @@ def authorized? def student_params params.require(:student).permit( - :student_number, :unit_id, :year, :semester, :scholarship_type_id, :status, - :exceeded_education_period, :stage_id, - history_attributes: %i[entrance_type_id registration_date registration_term_id - graduation_date graduation_term_id other_studentship preparatory_class] + :student_number, :unit_id, :year, :semester, :scholarship_type_id, :status, :exceeded_education_period, + :stage_id, :entrance_type_id, :registration_date, :registration_term_id, :other_studentship, :preparatory_class ) end end diff --git a/app/controllers/user_management/users_controller.rb b/app/controllers/user_management/users_controller.rb index df5c7cd61..cda4eec67 100644 --- a/app/controllers/user_management/users_controller.rb +++ b/app/controllers/user_management/users_controller.rb @@ -20,7 +20,7 @@ def show @addresses = @user.addresses.includes(district: :city) @employees = @user.employees.includes(:title).order(active: :desc) @duties = @user.duties.includes(:unit) - @students = @user.students.includes(:unit, :scholarship_type, :history, :stage) + @students = @user.students.includes(:unit, :scholarship_type, :stage) @positions = @user.positions.includes(:administrative_function, :duty) end diff --git a/app/models/student.rb b/app/models/student.rb index 0e0558d0e..cba1f5614 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -15,18 +15,18 @@ class Student < ApplicationRecord } # relations + belongs_to :entrance_type, class_name: 'StudentEntranceType' + belongs_to :registration_term, class_name: 'AcademicTerm', optional: true belongs_to :scholarship_type, optional: true + belongs_to :stage, class_name: 'StudentGrade', optional: true belongs_to :user belongs_to :unit - belongs_to :stage, class_name: 'StudentGrade', optional: true - has_one :history, class_name: 'StudentHistory', dependent: :destroy has_one :identity, dependent: :destroy has_many :calendars, -> { Calendar.active }, through: :unit has_many :curriculums, through: :unit has_many :semester_registrations, dependent: :destroy has_many :course_enrollments, through: :semester_registrations has_many :tuition_debts, dependent: :destroy - accepts_nested_attributes_for :history, allow_destroy: true # scopes scope :exceeded, -> { where(exceeded_education_period: true) } @@ -37,8 +37,12 @@ class Student < ApplicationRecord # validations validates :exceeded_education_period, inclusion: { in: [true, false] } validates :unit_id, uniqueness: { scope: %i[user] } + validates :other_studentship, inclusion: { in: [true, false] } validates :permanently_registered, inclusion: { in: [true, false] } # TODO: Will set equal_to: N, when we decide about student numbers + validates :preparatory_class, numericality: { only_integer: true, + greater_than_or_equal_to: 0, + less_than_or_equal_to: 2 } validates :student_number, presence: true, uniqueness: true, length: { maximum: 255 } validates :semester, numericality: { greater_than: 0 } validates :status, inclusion: { in: statuses.keys } @@ -49,12 +53,9 @@ class Student < ApplicationRecord delegate :name, to: :stage, prefix: true, allow_nil: true delegate :name, to: :unit, prefix: true delegate :name, to: :scholarship_type, prefix: true, allow_nil: true - delegate :entrance_type, :graduation_term, :other_studentship, :preparatory_class, - :registration_date, :registration_term, :graduation_date, to: :history, allow_nil: true # background jobs after_create_commit :build_identity_information, if: proc { identity.nil? } - after_create_commit :create_student_history # custom methods def gpa @@ -86,15 +87,6 @@ def prospective_student private - def create_student_history - create_history( - entrance_type_id: prospective_student&.student_entrance_type_id, - registration_date: created_at, - registration_term_id: prospective_student&.academic_term_id, - other_studentship: !prospective_student&.obs_status - ) - end - def build_identity_information Kps::IdentitySaveJob.perform_later(user, id) end diff --git a/app/models/student_history.rb b/app/models/student_history.rb deleted file mode 100644 index 126431f16..000000000 --- a/app/models/student_history.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class StudentHistory < ApplicationRecord - # relations - belongs_to :student - belongs_to :entrance_type, class_name: 'StudentEntranceType' - belongs_to :graduation_term, class_name: 'AcademicTerm', optional: true - belongs_to :registration_term, class_name: 'AcademicTerm', optional: true - - # validations - validates :other_studentship, inclusion: { in: [true, false] } - validates :preparatory_class, numericality: { only_integer: true, - greater_than_or_equal_to: 0, - less_than_or_equal_to: 2 } -end diff --git a/app/views/students/edit.html.erb b/app/views/students/edit.html.erb index 8d02bc4c8..6442b2add 100644 --- a/app/views/students/edit.html.erb +++ b/app/views/students/edit.html.erb @@ -35,42 +35,30 @@
<%= f.association :stage %>
+
+ <%= f.association :entrance_type %> +
+
+ <%= f.input :registration_date, as: :date_time_picker %> +
+
+ <%= f.association :registration_term, + label_method: lambda { |academic_term| full_name(academic_term) } %> +
+
+ <%= f.input :preparatory_class %> +
- <%= f.input :exceeded_education_period %> + <%= f.input :other_studentship %>
-
-
-
- <%= f.simple_fields_for :history do |h| %> -
- <%= h.input :registration_date, as: :date_time_picker %> -
-
- <%= h.association :registration_term, - label_method: lambda { |academic_term| full_name(academic_term) } %> -
-
- <%= h.input :graduation_date, as: :date_time_picker %> -
-
- <%= h.association :graduation_term, - label_method: lambda { |academic_term| full_name(academic_term) } %> -
-
- <%= h.association :entrance_type %> -
-
- <%= h.input :preparatory_class %> -
-
- <%= h.input :other_studentship %> -
- <% end %>
- <%= f.button :submit, class: 'btn btn-outline-success btn-sm' %> - <%= link_to_back user_path(@student.user) %> + <%= f.input :exceeded_education_period %>
+
+ <%= f.button :submit, class: 'btn btn-outline-success btn-sm' %> + <%= link_to_back user_path(@student.user) %> +
<% end %>
@@ -79,7 +67,7 @@ diff --git a/app/views/user_management/users/_students.html.erb b/app/views/user_management/users/_students.html.erb index 8c206e82f..2c7a3deb6 100644 --- a/app/views/user_management/users/_students.html.erb +++ b/app/views/user_management/users/_students.html.erb @@ -17,7 +17,6 @@ <%= t('semester') %> <%= t('.scholarship_type') %> <%= t('.stage') %> - <%= t('.exceeded_education_period') %> @@ -28,7 +27,6 @@ <%= student.semester %> <%= student.scholarship_type_name %> <%= student.stage_name %> - <%= student.exceeded_education_period ? t('yes') : t('no') %> @@ -36,10 +34,9 @@ <%= t('.entrance_type') %> <%= t('.registration_date') %> <%= t('.registration_term') %> - <%= t('.graduation_date') %> - <%= t('.graduation_term') %> <%= t('.other_studentship') %> <%= t('.preparatory_class') %> + <%= t('.exceeded_education_period') %> @@ -47,10 +44,9 @@ <%= student.entrance_type&.name %> <%= l(student.registration_date, format: '%d %b %Y') if student.registration_date %> <%= full_name(student.registration_term) %> - <%= l(student.graduation_date, format: '%d %b %Y') if student.graduation_date %> - <%= full_name(student.graduation_term) %> <%= student.other_studentship ? t('yes') : t('no') %> <%= student.preparatory_class %> + <%= student.exceeded_education_period ? t('yes') : t('no') %> diff --git a/config/locales/models/user/en.yml b/config/locales/models/user/en.yml index a415343c8..a4310ff8c 100644 --- a/config/locales/models/user/en.yml +++ b/config/locales/models/user/en.yml @@ -20,7 +20,12 @@ en: end_date: End Date start_date: Start Date student: &student_attributes + entrance_type: Entrance Type exceeded_education_period: Couldn't graduate during education period + other_studentship: There Is Other Studentship + preparatory_class: Preparatory Class + registration_date: Registration Date + registration_term: Registration Term scholarship_type: Scholarship Type semester: Semester stage: Stage @@ -28,14 +33,6 @@ en: student_number: Student Number unit: Unit year: Year - student_history: &student_history_attributes - entrance_type: Entrance Type - graduation_date: Graduation Date - graduation_term: Graduation Term - other_studentship: There Is Other Studentship - preparatory_class: Preparatory Class - registration_date: Registration Date - registration_term: Registration Term user: &user_attributes activated: Account Activation activated_at: Account Activation Date @@ -124,6 +121,5 @@ en: students: Student Information students: <<: *student_attributes - <<: *student_history_attributes update: success: User successfully updated. diff --git a/config/locales/models/user/tr.yml b/config/locales/models/user/tr.yml index da297e02e..0cb3f6b58 100644 --- a/config/locales/models/user/tr.yml +++ b/config/locales/models/user/tr.yml @@ -20,7 +20,12 @@ tr: end_date: Bitiş Tarihi start_date: Başlangıç Tarihi student: &student_attributes + entrance_type: Giriş Türü exceeded_education_period: Okulu Uzattı + other_studentship: Başka Öğrenciliği Var + preparatory_class: Hazırlık Sınıfı + registration_date: Kayıt Tarihi + registration_term: Kayıt Dönemi scholarship_type: Burs Türü semester: Yarıyıl stage: Aşama @@ -28,14 +33,6 @@ tr: student_number: Öğrenci Numarası unit: Birim year: Yıl - student_history: &student_history_attributes - entrance_type: Giriş Türü - graduation_date: Mezuniyet Tarihi - graduation_term: Mezuniyet Dönemi - other_studentship: Başka Öğrenciliği Var - preparatory_class: Hazırlık Sınıfı - registration_date: Kayıt Tarihi - registration_term: Kayıt Dönemi user: &user_attributes activated: Hesap Aktifleştirme activated_at: Hesap Aktifleştirme Tarihi @@ -137,6 +134,5 @@ tr: students: Öğrenci Bilgileri students: <<: *student_attributes - <<: *student_history_attributes update: success: Kullanıcı başarıyla güncellendi. diff --git a/db/migrate/20200427103727_add_columns_to_student.rb b/db/migrate/20200427103727_add_columns_to_student.rb new file mode 100644 index 000000000..500d7ddfc --- /dev/null +++ b/db/migrate/20200427103727_add_columns_to_student.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class AddColumnsToStudent < ActiveRecord::Migration[6.0] + def change + add_reference :students, :entrance_type, foreign_key: { to_table: :student_entrance_types } + add_column :students, :other_studentship, :boolean, default: false + add_column :students, :preparatory_class, :integer, default: 0 + add_column :students, :registration_date, :datetime + add_reference :students, :registration_term, foreign_key: { to_table: :academic_terms } + + add_null_constraint :students, :other_studentship + add_numericality_constraint :students, :preparatory_class, greater_than_or_equal_to: 0 + end +end diff --git a/db/migrate/20200427103727_create_student_histories.rb b/db/migrate/20200427103727_create_student_histories.rb deleted file mode 100644 index ea089cd2f..000000000 --- a/db/migrate/20200427103727_create_student_histories.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class CreateStudentHistories < ActiveRecord::Migration[6.0] - def change - create_table :student_histories do |t| - t.references :student, null: false, foreign_key: true - t.references :entrance_type, foreign_key: { to_table: :student_entrance_types } - t.datetime :registration_date - t.references :registration_term, foreign_key: { to_table: :academic_terms } - t.datetime :graduation_date - t.references :graduation_term, foreign_key: { to_table: :academic_terms } - t.boolean :other_studentship, default: false - t.integer :preparatory_class, default: 0 - t.timestamps - end - - add_null_constraint :student_histories, :other_studentship - add_numericality_constraint :student_histories, :preparatory_class, - greater_than_or_equal_to: 0 - end -end diff --git a/db/structure.sql b/db/structure.sql index d5b012777..8b3cfe4ce 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -3354,46 +3354,6 @@ CREATE SEQUENCE public.student_grading_systems_id_seq ALTER SEQUENCE public.student_grading_systems_id_seq OWNED BY public.student_grading_systems.id; --- --- Name: student_histories; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.student_histories ( - id bigint NOT NULL, - student_id bigint NOT NULL, - entrance_type_id bigint, - registration_date timestamp without time zone, - registration_term_id bigint, - graduation_date timestamp without time zone, - graduation_term_id bigint, - other_studentship boolean DEFAULT false, - preparatory_class integer DEFAULT 0, - created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL, - CONSTRAINT student_histories_other_studentship_null CHECK ((other_studentship IS NOT NULL)), - CONSTRAINT student_histories_preparatory_class_numericality CHECK ((preparatory_class >= 0)) -); - - --- --- Name: student_histories_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.student_histories_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: student_histories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.student_histories_id_seq OWNED BY public.student_histories.id; - - -- -- Name: student_punishment_types; Type: TABLE; Schema: public; Owner: - -- @@ -3480,7 +3440,14 @@ CREATE TABLE public.students ( status integer DEFAULT 1, exceeded_education_period boolean DEFAULT false, stage_id bigint, + entrance_type_id bigint, + other_studentship boolean DEFAULT false, + preparatory_class integer DEFAULT 0, + registration_date timestamp without time zone, + registration_term_id bigint, + CONSTRAINT students_other_studentship_null CHECK ((other_studentship IS NOT NULL)), CONSTRAINT students_permanently_registered_null CHECK ((permanently_registered IS NOT NULL)), + CONSTRAINT students_preparatory_class_numericality CHECK ((preparatory_class >= 0)), CONSTRAINT students_semester_null CHECK ((semester IS NOT NULL)), CONSTRAINT students_semester_numericality CHECK ((semester > 0)), CONSTRAINT students_status_null CHECK ((status IS NOT NULL)), @@ -4590,13 +4557,6 @@ ALTER TABLE ONLY public.student_grades ALTER COLUMN id SET DEFAULT nextval('publ ALTER TABLE ONLY public.student_grading_systems ALTER COLUMN id SET DEFAULT nextval('public.student_grading_systems_id_seq'::regclass); --- --- Name: student_histories id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.student_histories ALTER COLUMN id SET DEFAULT nextval('public.student_histories_id_seq'::regclass); - - -- -- Name: student_punishment_types id; Type: DEFAULT; Schema: public; Owner: - -- @@ -5621,14 +5581,6 @@ ALTER TABLE ONLY public.student_grading_systems ADD CONSTRAINT student_grading_systems_pkey PRIMARY KEY (id); --- --- Name: student_histories student_histories_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.student_histories - ADD CONSTRAINT student_histories_pkey PRIMARY KEY (id); - - -- -- Name: student_punishment_types student_punishment_types_code_unique; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -6633,31 +6585,17 @@ CREATE INDEX index_semester_registrations_on_student_id ON public.semester_regis -- --- Name: index_student_histories_on_entrance_type_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_student_histories_on_entrance_type_id ON public.student_histories USING btree (entrance_type_id); - - --- --- Name: index_student_histories_on_graduation_term_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_student_histories_on_graduation_term_id ON public.student_histories USING btree (graduation_term_id); - - --- --- Name: index_student_histories_on_registration_term_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_students_on_entrance_type_id; Type: INDEX; Schema: public; Owner: - -- -CREATE INDEX index_student_histories_on_registration_term_id ON public.student_histories USING btree (registration_term_id); +CREATE INDEX index_students_on_entrance_type_id ON public.students USING btree (entrance_type_id); -- --- Name: index_student_histories_on_student_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_students_on_registration_term_id; Type: INDEX; Schema: public; Owner: - -- -CREATE INDEX index_student_histories_on_student_id ON public.student_histories USING btree (student_id); +CREATE INDEX index_students_on_registration_term_id ON public.students USING btree (registration_term_id); -- @@ -6899,14 +6837,6 @@ ALTER TABLE ONLY public.students ADD CONSTRAINT fk_rails_155a016013 FOREIGN KEY (stage_id) REFERENCES public.student_grades(id); --- --- Name: student_histories fk_rails_1aec1b73f4; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.student_histories - ADD CONSTRAINT fk_rails_1aec1b73f4 FOREIGN KEY (entrance_type_id) REFERENCES public.student_entrance_types(id); - - -- -- Name: duties fk_rails_1b35a03564; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7187,14 +7117,6 @@ ALTER TABLE ONLY public.role_permissions ADD CONSTRAINT fk_rails_60126080bd FOREIGN KEY (role_id) REFERENCES public.roles(id); --- --- Name: student_histories fk_rails_60b0bff9e5; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.student_histories - ADD CONSTRAINT fk_rails_60b0bff9e5 FOREIGN KEY (registration_term_id) REFERENCES public.academic_terms(id); - - -- -- Name: calendar_events fk_rails_64d7b22524; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7211,6 +7133,14 @@ ALTER TABLE ONLY public.meeting_agendas ADD CONSTRAINT fk_rails_694b3fc610 FOREIGN KEY (committee_meeting_id) REFERENCES public.committee_meetings(id); +-- +-- Name: students fk_rails_6b6ccfbba8; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.students + ADD CONSTRAINT fk_rails_6b6ccfbba8 FOREIGN KEY (registration_term_id) REFERENCES public.academic_terms(id); + + -- -- Name: education_informations fk_rails_6ffd5f9683; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7267,14 +7197,6 @@ ALTER TABLE ONLY public.prospective_employees ADD CONSTRAINT fk_rails_7e3da1fde7 FOREIGN KEY (title_id) REFERENCES public.titles(id); --- --- Name: student_histories fk_rails_7f34dd6017; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.student_histories - ADD CONSTRAINT fk_rails_7f34dd6017 FOREIGN KEY (graduation_term_id) REFERENCES public.academic_terms(id); - - -- -- Name: students fk_rails_818ba821f0; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7531,6 +7453,14 @@ ALTER TABLE ONLY public.academic_credentials ADD CONSTRAINT fk_rails_b9d9c54fa8 FOREIGN KEY (country_id) REFERENCES public.countries(id); +-- +-- Name: students fk_rails_ba6ab25b1e; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.students + ADD CONSTRAINT fk_rails_ba6ab25b1e FOREIGN KEY (entrance_type_id) REFERENCES public.student_entrance_types(id); + + -- -- Name: course_enrollments fk_rails_baabe22f29; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7555,14 +7485,6 @@ ALTER TABLE ONLY public.books ADD CONSTRAINT fk_rails_bc582ddd02 FOREIGN KEY (user_id) REFERENCES public.users(id); --- --- Name: student_histories fk_rails_be0b7f94b6; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.student_histories - ADD CONSTRAINT fk_rails_be0b7f94b6 FOREIGN KEY (student_id) REFERENCES public.students(id); - - -- -- Name: ldap_sync_errors fk_rails_c34f07ddd2; Type: FK CONSTRAINT; Schema: public; Owner: - -- From ce7b95cfed08cca86f99ebc404f85143eeab7028 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 7 May 2020 15:27:06 +0300 Subject: [PATCH 760/970] Add nem fields to registered user method for prospective student --- app/models/prospective_student.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models/prospective_student.rb b/app/models/prospective_student.rb index 788e751e2..7c7c36ce6 100644 --- a/app/models/prospective_student.rb +++ b/app/models/prospective_student.rb @@ -82,6 +82,7 @@ def can_temporarily_register? military_status end + # rubocop:disable Metrics/MethodLength def registered_user(user) Student.new( user: user, @@ -90,9 +91,14 @@ def registered_user(user) status: can_permanently_register? ? :active : :passive, student_number: id_number, # TODO: must be generated year: 1, # TODO: can have a different value depending on the characteristics of the program - semester: 1 + semester: 1, + entrance_type: student_entrance_type, + other_studentship: !obs_status, + registration_date: Time.zone.now, + registration_term: academic_term ) end + # rubocop:enable Metrics/MethodLength private From 4525640c0722fb0e987776fbba59b07e23ca98e8 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 7 May 2020 15:42:07 +0300 Subject: [PATCH 761/970] Fix tests --- test/controllers/students_controller_test.rb | 15 +++++++------ test/fixtures/student_histories.yml | 12 ----------- test/fixtures/students.yml | 10 +++++++++ test/models/student_history_test.rb | 22 -------------------- test/models/student_test.rb | 12 ++++++++--- 5 files changed, 26 insertions(+), 45 deletions(-) delete mode 100644 test/fixtures/student_histories.yml delete mode 100644 test/models/student_history_test.rb diff --git a/test/controllers/students_controller_test.rb b/test/controllers/students_controller_test.rb index 2587790b0..5b9c830f6 100644 --- a/test/controllers/students_controller_test.rb +++ b/test/controllers/students_controller_test.rb @@ -18,14 +18,13 @@ class StudentsControllerTest < ActionDispatch::IntegrationTest test 'should update student' do patch student_path(@student), params: { student: { - scholarship_type_id: scholarship_types(:kkk).id, - history_attributes: { - entrance_type_id: student_entrance_types(:osys).id, - registration_date: '2018-09-12 08:00:00', - registration_term_id: @academic_term.id, - other_studentship: true, - preparatory_class: 1 - } + scholarship_type_id: scholarship_types(:kkk).id, + entrance_type_id: student_entrance_types(:osys).id, + registration_date: '2018-09-12 08:00:00', + registration_term_id: @academic_term.id, + other_studentship: true, + preparatory_class: 1 + } } diff --git a/test/fixtures/student_histories.yml b/test/fixtures/student_histories.yml deleted file mode 100644 index ea8473613..000000000 --- a/test/fixtures/student_histories.yml +++ /dev/null @@ -1,12 +0,0 @@ -serhat: - student: serhat - entrance_type: dgs - registration_term: fall_2018_2019 - other_studentship: false - preparatory_class: 0 -john: - student: john - entrance_type: dgs - registration_term: fall_2018_2019 - other_studentship: false - preparatory_class: 0 diff --git a/test/fixtures/students.yml b/test/fixtures/students.yml index 21e1e5e07..55792473d 100644 --- a/test/fixtures/students.yml +++ b/test/fixtures/students.yml @@ -8,6 +8,10 @@ serhat: status: active scholarship_type: meb exceeded_education_period: false + entrance_type: dgs + registration_term: fall_2018_2019 + other_studentship: false + preparatory_class: 0 serhat_omu: student_number: 98765 user: serhat @@ -17,6 +21,7 @@ serhat_omu: year: 1 semester: 1 stage: foreign_preparation + entrance_type: osys john: student_number: 45612 user: john @@ -26,6 +31,10 @@ john: year: 2 semester: 3 exceeded_education_period: true + entrance_type: dgs + registration_term: fall_2018_2019 + other_studentship: false + preparatory_class: 0 mike: student_number: 45789 user: mike @@ -35,3 +44,4 @@ mike: year: 1 semester: 1 exceeded_education_period: false + entrance_type: osys diff --git a/test/models/student_history_test.rb b/test/models/student_history_test.rb deleted file mode 100644 index 276bb5379..000000000 --- a/test/models/student_history_test.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -require 'test_helper' - -class StudentHistoryTest < ActiveSupport::TestCase - extend Support::Minitest::AssociationHelper - extend Support::Minitest::ValidationHelper - - # relations - belongs_to :student - belongs_to :entrance_type, class_name: 'StudentEntranceType' - belongs_to :graduation_term, class_name: 'AcademicTerm' - belongs_to :registration_term, class_name: 'AcademicTerm' - - # validations: presence - validates_presence_of :other_studentship - validates_presence_of :preparatory_class - - # validations: numericality - validates_numericality_of :preparatory_class - validates_numerical_range :preparatory_class, greater_than_or_equal_to: 0, less_than_or_equal_to: 2 -end diff --git a/test/models/student_test.rb b/test/models/student_test.rb index 6d3bb2f8a..070aeb44a 100644 --- a/test/models/student_test.rb +++ b/test/models/student_test.rb @@ -19,6 +19,8 @@ class StudentTest < ActiveSupport::TestCase } # relations + belongs_to :entrance_type, class_name: 'StudentEntranceType' + belongs_to :registration_term, class_name: 'AcademicTerm', optional: true belongs_to :scholarship_type, optional: true belongs_to :stage, class_name: 'StudentGrade', optional: true belongs_to :user @@ -30,12 +32,16 @@ class StudentTest < ActiveSupport::TestCase has_many :course_enrollments, through: :semester_registrations # validations: presence - validates_presence_of :student_number + validates_presence_of :other_studentship validates_presence_of :permanently_registered + validates_presence_of :preparatory_class validates_presence_of :semester + validates_presence_of :student_number validates_presence_of :year # validations: numericality + validates_numericality_of :preparatory_class + validates_numerical_range :preparatory_class, greater_than_or_equal_to: 0, less_than_or_equal_to: 2 validates_numerical_range :semester, greater_than: 0 validates_numerical_range :year, greater_than_or_equal_to: 0 @@ -45,7 +51,6 @@ class StudentTest < ActiveSupport::TestCase # callback tests after_commit :build_identity_information - after_commit :create_student_history # delegations test 'a student can communicate with addresses over the user' do @@ -84,7 +89,8 @@ class StudentTest < ActiveSupport::TestCase test 'student enqueues Kps::IdentitySaveJob after being created' do users(:serhat).students.destroy_all assert_enqueued_with(job: Kps::IdentitySaveJob) do - Student.create(student_number: '1234', user: users(:serhat), unit: units(:omu), year: 1, semester: 1) + Student.create(student_number: '1234', user: users(:serhat), unit: units(:omu), year: 1, semester: 1, + entrance_type: student_entrance_types(:osys)) end end end From c455a7390d99e0b7d316ff61bb68aeb5e2446f50 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 7 May 2020 16:47:14 +0300 Subject: [PATCH 762/970] Create readable methods instead of event methods --- .../instructiveness/assessments_controller.rb | 2 +- .../studentship/course_enrollments_controller.rb | 2 +- app/decorators/assessment_decorator.rb | 12 ++++++++++-- app/decorators/student_decorator.rb | 13 +++++++++++-- .../assessments/_assessment_info.html.erb | 2 +- app/views/instructiveness/assessments/show.html.erb | 2 +- .../studentship/course_enrollments/index.html.erb | 2 +- 7 files changed, 26 insertions(+), 9 deletions(-) diff --git a/app/controllers/instructiveness/assessments_controller.rb b/app/controllers/instructiveness/assessments_controller.rb index 01d536091..6dd2542a0 100644 --- a/app/controllers/instructiveness/assessments_controller.rb +++ b/app/controllers/instructiveness/assessments_controller.rb @@ -62,7 +62,7 @@ def authorized? end def event_active? - redirect_with('.errors.not_proper_event_range') unless @assessment.results_announcement_event&.active_now? + redirect_with('.errors.not_proper_event_range') unless @assessment.gradable? end def coordinator? diff --git a/app/controllers/studentship/course_enrollments_controller.rb b/app/controllers/studentship/course_enrollments_controller.rb index b598e8c85..311463504 100644 --- a/app/controllers/studentship/course_enrollments_controller.rb +++ b/app/controllers/studentship/course_enrollments_controller.rb @@ -64,7 +64,7 @@ def authorized? end def event_active? - return if @student.event_online_course_registrations&.active_now? + return if @student.registrable_for_online_course? redirect_to(student_course_enrollments_path(@student), alert: t('.errors.not_proper_register_event_range')) end diff --git a/app/decorators/assessment_decorator.rb b/app/decorators/assessment_decorator.rb index d3a2fa0ca..8a5ae3318 100644 --- a/app/decorators/assessment_decorator.rb +++ b/app/decorators/assessment_decorator.rb @@ -9,8 +9,12 @@ def saveable? draft? && fully_graded? end - def results_announcement_event - @results_announcement_event ||= CalendarEventDecorator.new(calendar&.event(identifier)) + def gradable? + results_announcement_event.try(:active_now?) + end + + def gradable_date_range + results_announcement_event.date_range end private @@ -18,4 +22,8 @@ def results_announcement_event def calendar available_course.calendars.last end + + def results_announcement_event + @results_announcement_event ||= CalendarEventDecorator.new(calendar&.event(identifier)) + end end diff --git a/app/decorators/student_decorator.rb b/app/decorators/student_decorator.rb index 522cccfda..24f835799 100644 --- a/app/decorators/student_decorator.rb +++ b/app/decorators/student_decorator.rb @@ -1,8 +1,12 @@ # frozen_string_literal: true class StudentDecorator < SimpleDelegator - def event_online_course_registrations - @event_online_course_registrations ||= CalendarEventDecorator.new(calendar&.event('online_course_registrations')) + def registrable_for_online_course? + online_course_registrations_event.try(:active_now?) + end + + def registrable_for_online_course_date_range + online_course_registrations_event.date_range end private @@ -10,4 +14,9 @@ def event_online_course_registrations def calendar calendars.last end + + def online_course_registrations_event + @online_course_registrations_event ||= + CalendarEventDecorator.new(calendar&.event('online_course_registrations')) + end end diff --git a/app/views/instructiveness/assessments/_assessment_info.html.erb b/app/views/instructiveness/assessments/_assessment_info.html.erb index 0d5802bb8..4884b0e02 100644 --- a/app/views/instructiveness/assessments/_assessment_info.html.erb +++ b/app/views/instructiveness/assessments/_assessment_info.html.erb @@ -21,7 +21,7 @@ <%= t('.status') %> <%= enum_t(@assessment, :status) %> <%= t('.date_range') %> - <%= @assessment.results_announcement_event.date_range %> + <%= @assessment.gradable_date_range %> diff --git a/app/views/instructiveness/assessments/show.html.erb b/app/views/instructiveness/assessments/show.html.erb index f442a0d1f..fdf7cde67 100644 --- a/app/views/instructiveness/assessments/show.html.erb +++ b/app/views/instructiveness/assessments/show.html.erb @@ -9,7 +9,7 @@ <%= fa_icon 'users' %><%= t('.students', course_name: @course.name) %>
- <% if @assessment.results_announcement_event&.active_now? %> + <% if @assessment.gradable? %> <% if @employee.coordinatorships.include?(@course) %> <%= link_to(t('.draft'), draft_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.saved? %> <%= link_to(t('.save'), save_given_course_assessment_path(@course, @assessment), class: 'btn btn-warning btn-sm') if @assessment.saveable? %> diff --git a/app/views/studentship/course_enrollments/index.html.erb b/app/views/studentship/course_enrollments/index.html.erb index ca568db33..c659a3ec1 100644 --- a/app/views/studentship/course_enrollments/index.html.erb +++ b/app/views/studentship/course_enrollments/index.html.erb @@ -20,7 +20,7 @@
<%= @student.unit.name %>
-

<%= "#{t('.registration_date_range')}: #{@student.event_online_course_registrations.date_range}" %>

+

<%= "#{t('.registration_date_range')}: #{@student.registrable_for_online_course_date_range}" %>

<%= "#{t('.registration_status')}: #{enum_t(@student.current_registration, :status)}" %> <% end %>
From 04113f55ec110c61bf8165dd734a1bc82be3b23a Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 7 May 2020 16:48:12 +0300 Subject: [PATCH 763/970] Update decorator tests --- test/decorators/assessment_decorator_test.rb | 9 +++++++-- test/decorators/student_decorator_test.rb | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/test/decorators/assessment_decorator_test.rb b/test/decorators/assessment_decorator_test.rb index c080376df..079b8ddf0 100644 --- a/test/decorators/assessment_decorator_test.rb +++ b/test/decorators/assessment_decorator_test.rb @@ -15,7 +15,12 @@ class AssessmentDecoratorTest < ActiveSupport::TestCase assert_not @assessment.saveable? end - test 'results_announcement_event method' do - assert @assessment.results_announcement_event + test 'gradable? method' do + assert @assessment.gradable? + end + + test 'gradable_date_range method' do + assert_equal @assessment.gradable_date_range, + CalendarEventDecorator.new(calendar_events(:midterm_results_announcement)).date_range end end diff --git a/test/decorators/student_decorator_test.rb b/test/decorators/student_decorator_test.rb index 8eff8a8b0..e7c607c15 100644 --- a/test/decorators/student_decorator_test.rb +++ b/test/decorators/student_decorator_test.rb @@ -7,7 +7,12 @@ class StudentDecoratorTest < ActiveSupport::TestCase @student = StudentDecorator.new(students(:serhat)) end - test 'event_online_course_registrations method' do - assert @student.event_online_course_registrations + test 'registrable_for_online_course? method' do + assert @student.registrable_for_online_course? + end + + test 'registrable_for_online_course_date_range method' do + assert_equal @student.registrable_for_online_course_date_range, + CalendarEventDecorator.new(calendar_events(:midterm_results_announcement)).date_range end end From 09629febaa04fc63e0c7eeea9d3496e09f0e643e Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 7 May 2020 16:54:29 +0300 Subject: [PATCH 764/970] Match the evaluation type identifier to its name --- app/decorators/assessment_decorator.rb | 3 ++- lib/tasks/fix_data.rake | 8 ++++---- test/fixtures/evaluation_types.yml | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/decorators/assessment_decorator.rb b/app/decorators/assessment_decorator.rb index 8a5ae3318..bcf528bc5 100644 --- a/app/decorators/assessment_decorator.rb +++ b/app/decorators/assessment_decorator.rb @@ -24,6 +24,7 @@ def calendar end def results_announcement_event - @results_announcement_event ||= CalendarEventDecorator.new(calendar&.event(identifier)) + @results_announcement_event ||= + CalendarEventDecorator.new(calendar&.event("#{identifier}_results_announcement")) end end diff --git a/lib/tasks/fix_data.rake b/lib/tasks/fix_data.rake index b0d391bbc..523680d96 100644 --- a/lib/tasks/fix_data.rake +++ b/lib/tasks/fix_data.rake @@ -3,15 +3,15 @@ namespace :fix_data do desc "Fills evaluation types' identifier field" task evaluation_types: :environment do - EvaluationType.where(identifier: nil).each do |evaluation_type| + EvaluationType.all.each do |evaluation_type| identifier = case evaluation_type.name when 'Dönem İçi Değerlendirme' - 'mid_term_results_announcement' + 'midterm' when 'Dönem Sonu Değerlendirme' - 'final_results_announcement' + 'final' when 'Bütünleme Değerlendirme' - 'retake_results_announcement' + 'retake' end evaluation_type.update(identifier: identifier) diff --git a/test/fixtures/evaluation_types.yml b/test/fixtures/evaluation_types.yml index f1b507ec0..f091eea8a 100644 --- a/test/fixtures/evaluation_types.yml +++ b/test/fixtures/evaluation_types.yml @@ -1,15 +1,15 @@ undergraduate_midterm: name: Dönem İçi Değerlendirme - identifier: mid_term_results_announcement + identifier: mid_term undergraduate_final: name: Dönem Sonu Değerlendirme - identifier: final_results_announcement + identifier: final undergraduate_retake: name: Bütünleme Değerlendirme - identifier: retake_results_announcement + identifier: retake evaluation_type_to_delete: name: This evaluation type will be deleted - identifier: retake_results_announcement + identifier: test From 0737c04f2f81d81e4c8cf62aef0e26a049aa4194 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 7 May 2020 16:56:46 +0300 Subject: [PATCH 765/970] Add a task to correct misspelling in event types --- lib/tasks/fix_data.rake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/tasks/fix_data.rake b/lib/tasks/fix_data.rake index 523680d96..72c1e267e 100644 --- a/lib/tasks/fix_data.rake +++ b/lib/tasks/fix_data.rake @@ -1,6 +1,14 @@ # frozen_string_literal: true namespace :fix_data do + desc "Corrects the misspelling in calendar event types identifier field" + task calendar_event_types: :environment do + CalendarEventType.where("identifier like ?", "%mid_term%").each do |event_type| + corrected_identifier = event_type.identifier.gsub('mid_term', 'midterm') + event_type.update(identifier: corrected_identifier) + end + end + desc "Fills evaluation types' identifier field" task evaluation_types: :environment do EvaluationType.all.each do |evaluation_type| From a2af1ee9fe30f02afb794871a333b2dad8fbd44a Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 7 May 2020 17:06:27 +0300 Subject: [PATCH 766/970] Change 'mid_term' to 'midterm' --- db/beta_seed/calendar.rb | 2 +- plugins/tenant/acme/db/static/event_types.yml | 10 +++++----- plugins/tenant/omu/db/static/event_types.yml | 10 +++++----- .../calendar_event_types_controller_test.rb | 2 +- test/decorators/calendar_event_decorator_test.rb | 2 +- test/fixtures/calendar_event_types.yml | 8 ++++---- test/fixtures/calendar_events.yml | 4 ++-- test/fixtures/evaluation_types.yml | 2 +- test/models/calendar_event_test.rb | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/db/beta_seed/calendar.rb b/db/beta_seed/calendar.rb index ae044ecfb..5748b3245 100644 --- a/db/beta_seed/calendar.rb +++ b/db/beta_seed/calendar.rb @@ -143,7 +143,7 @@ visible: true }, { - calendar_event_type: CalendarEventType.find_by(identifier: 'mid_term_exams'), + calendar_event_type: CalendarEventType.find_by(identifier: 'midterm_exams'), start_time: '2018-11-17 08:00:00', end_time: '2018-11-25 17:00:00', timezone: 'Istanbul', diff --git a/plugins/tenant/acme/db/static/event_types.yml b/plugins/tenant/acme/db/static/event_types.yml index 7a9333fe6..262209a3b 100644 --- a/plugins/tenant/acme/db/static/event_types.yml +++ b/plugins/tenant/acme/db/static/event_types.yml @@ -3,7 +3,7 @@ applications: name: Tek Ders Sınavı Başvuları - identifier: program name: Başvuru Tarihleri - - identifier: excused_mid_term + - identifier: excused_midterm name: Ara Sınav Mazeret Başvuruları - identifier: major_and_minor name: Çift Anadal ve Yandal Başvuruları @@ -39,9 +39,9 @@ advisor: - identifier: transfer_for_elective_courses name: Açılmayan Seçmeli Bir Dersi Seçen Öğrencilerin Açılan Başka Bir Seçmeli Derse Aktarılması exams: - - identifier: online_mid_term + - identifier: online_midterm name: Çevrimiçi Ara Sınavlar - - identifier: mid_term + - identifier: midterm name: Ara Sınavlar - identifier: final name: Yarıyıl Sonu Sınavları @@ -57,7 +57,7 @@ exams: name: Hazırlık Sınıfları için Düzey Belirleme Sınavı - identifier: preparatory_class_proficiency name: Hazırlık Sınıfları için Yeterlilik Sınavı - - identifier: excused_mid_term + - identifier: excused_midterm name: Mazeretli Ara Sınavlar - identifier: additional name: Ek Sınavlar @@ -80,7 +80,7 @@ submission: - identifier: project_seminar name: Dönem Projesi/Seminerlerin Enstitüye Teslimi announcement: - - identifier: mid_term_results + - identifier: midterm_results name: Ara Sınav Sonuçlarının İlanı - identifier: final_results name: Yarıyıl Sonu Sınav Sonuçlarının İlanı diff --git a/plugins/tenant/omu/db/static/event_types.yml b/plugins/tenant/omu/db/static/event_types.yml index 7a9333fe6..262209a3b 100644 --- a/plugins/tenant/omu/db/static/event_types.yml +++ b/plugins/tenant/omu/db/static/event_types.yml @@ -3,7 +3,7 @@ applications: name: Tek Ders Sınavı Başvuları - identifier: program name: Başvuru Tarihleri - - identifier: excused_mid_term + - identifier: excused_midterm name: Ara Sınav Mazeret Başvuruları - identifier: major_and_minor name: Çift Anadal ve Yandal Başvuruları @@ -39,9 +39,9 @@ advisor: - identifier: transfer_for_elective_courses name: Açılmayan Seçmeli Bir Dersi Seçen Öğrencilerin Açılan Başka Bir Seçmeli Derse Aktarılması exams: - - identifier: online_mid_term + - identifier: online_midterm name: Çevrimiçi Ara Sınavlar - - identifier: mid_term + - identifier: midterm name: Ara Sınavlar - identifier: final name: Yarıyıl Sonu Sınavları @@ -57,7 +57,7 @@ exams: name: Hazırlık Sınıfları için Düzey Belirleme Sınavı - identifier: preparatory_class_proficiency name: Hazırlık Sınıfları için Yeterlilik Sınavı - - identifier: excused_mid_term + - identifier: excused_midterm name: Mazeretli Ara Sınavlar - identifier: additional name: Ek Sınavlar @@ -80,7 +80,7 @@ submission: - identifier: project_seminar name: Dönem Projesi/Seminerlerin Enstitüye Teslimi announcement: - - identifier: mid_term_results + - identifier: midterm_results name: Ara Sınav Sonuçlarının İlanı - identifier: final_results name: Yarıyıl Sonu Sınav Sonuçlarının İlanı diff --git a/test/controllers/calendar_management/calendar_event_types_controller_test.rb b/test/controllers/calendar_management/calendar_event_types_controller_test.rb index 352539335..07b84f176 100644 --- a/test/controllers/calendar_management/calendar_event_types_controller_test.rb +++ b/test/controllers/calendar_management/calendar_event_types_controller_test.rb @@ -6,7 +6,7 @@ module CalendarManagement class CalendarEventTypesControllerTest < ActionDispatch::IntegrationTest setup do sign_in users(:john) - @calendar_event_type = calendar_event_types(:excused_mid_term_applications) + @calendar_event_type = calendar_event_types(:excused_midterm_applications) @form_params = %w[name identifier category] end diff --git a/test/decorators/calendar_event_decorator_test.rb b/test/decorators/calendar_event_decorator_test.rb index 6866aff32..52e4c0586 100644 --- a/test/decorators/calendar_event_decorator_test.rb +++ b/test/decorators/calendar_event_decorator_test.rb @@ -4,7 +4,7 @@ class CalendarEventDecoratorTest < ActiveSupport::TestCase setup do - @calendar_event = CalendarEventDecorator.new(calendar_events(:mid_term_results_announcement)) + @calendar_event = CalendarEventDecorator.new(calendar_events(:midterm_results_announcement)) end test 'date_range? method' do diff --git a/test/fixtures/calendar_event_types.yml b/test/fixtures/calendar_event_types.yml index 1bc2d0727..0b4ffcbbe 100644 --- a/test/fixtures/calendar_event_types.yml +++ b/test/fixtures/calendar_event_types.yml @@ -10,13 +10,13 @@ online_course_registrations: name: Çevrimiçi Ders Kayıtları identifier: online_course_registrations category: registrations -excused_mid_term_applications: +excused_midterm_applications: name: Ara Sınav Mazeret Başvuruları - identifier: excused_mid_term_applications + identifier: excused_midterm_applications category: applications -mid_term_results_announcement: +midterm_results_announcement: name: Ara Sınav Sonuçlarının İlanı - identifier: mid_term_results_announcement + identifier: midterm_results_announcement category: announcement calendar_event_type_to_delete: name: This event type will be deleted in tests diff --git a/test/fixtures/calendar_events.yml b/test/fixtures/calendar_events.yml index d76b2b9fa..8ecd44f95 100644 --- a/test/fixtures/calendar_events.yml +++ b/test/fixtures/calendar_events.yml @@ -12,9 +12,9 @@ online_course_registrations: end_time: <%= Time.current + 5.days %> location: Online timezone: Istanbul -mid_term_results_announcement: +midterm_results_announcement: calendar: bm_calendar - calendar_event_type: mid_term_results_announcement + calendar_event_type: midterm_results_announcement start_time: <%= Time.current - 5.days %> end_time: <%= Time.current + 5.days %> location: Online diff --git a/test/fixtures/evaluation_types.yml b/test/fixtures/evaluation_types.yml index f091eea8a..9fc559f37 100644 --- a/test/fixtures/evaluation_types.yml +++ b/test/fixtures/evaluation_types.yml @@ -1,6 +1,6 @@ undergraduate_midterm: name: Dönem İçi Değerlendirme - identifier: mid_term + identifier: midterm undergraduate_final: name: Dönem Sonu Değerlendirme diff --git a/test/models/calendar_event_test.rb b/test/models/calendar_event_test.rb index af9365dba..c491521d7 100644 --- a/test/models/calendar_event_test.rb +++ b/test/models/calendar_event_test.rb @@ -22,6 +22,6 @@ class CalendarEventTest < ActiveSupport::TestCase test 'active_now? method' do assert_not calendar_events(:add_drop_fall_2018_grad).active_now? - assert calendar_events(:mid_term_results_announcement).active_now? + assert calendar_events(:midterm_results_announcement).active_now? end end From cf825f3ed86f62701a8f193e5b536034c46be0b3 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 7 May 2020 17:12:24 +0300 Subject: [PATCH 767/970] Fix rubocop offenses --- lib/tasks/fix_data.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/fix_data.rake b/lib/tasks/fix_data.rake index 72c1e267e..2267cc989 100644 --- a/lib/tasks/fix_data.rake +++ b/lib/tasks/fix_data.rake @@ -1,9 +1,9 @@ # frozen_string_literal: true namespace :fix_data do - desc "Corrects the misspelling in calendar event types identifier field" + desc 'Corrects the misspelling in calendar event types identifier field' task calendar_event_types: :environment do - CalendarEventType.where("identifier like ?", "%mid_term%").each do |event_type| + CalendarEventType.where('identifier like ?', '%mid_term%').each do |event_type| corrected_identifier = event_type.identifier.gsub('mid_term', 'midterm') event_type.update(identifier: corrected_identifier) end From 521c82cb6ab1f92152d79b531fe68a6c4359723e Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 8 May 2020 08:43:28 +0300 Subject: [PATCH 768/970] Add missing test --- test/fixtures/students.yml | 1 + test/models/student_test.rb | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/test/fixtures/students.yml b/test/fixtures/students.yml index 55792473d..6efa042a0 100644 --- a/test/fixtures/students.yml +++ b/test/fixtures/students.yml @@ -22,6 +22,7 @@ serhat_omu: semester: 1 stage: foreign_preparation entrance_type: osys + preparatory_class: 2 john: student_number: 45612 user: john diff --git a/test/models/student_test.rb b/test/models/student_test.rb index 070aeb44a..915c3cce4 100644 --- a/test/models/student_test.rb +++ b/test/models/student_test.rb @@ -80,6 +80,11 @@ class StudentTest < ActiveSupport::TestCase assert_equal students(:serhat_omu).gpa, 0 end + test 'preparatory_class_repetition? method' do + assert students(:serhat_omu).preparatory_class_repetition? + assert_not students(:john).preparatory_class_repetition? + end + test 'scholarship?' do assert students(:serhat).scholarship? assert_not students(:john).scholarship? From 995f5bba9ec97501838365b04d65dd900b0a8787 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 8 May 2020 11:03:41 +0300 Subject: [PATCH 769/970] Fix rubocop offense --- app/views/reference/evaluation_types/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/reference/evaluation_types/index.html.erb b/app/views/reference/evaluation_types/index.html.erb index 34823f4cc..8d59992c4 100644 --- a/app/views/reference/evaluation_types/index.html.erb +++ b/app/views/reference/evaluation_types/index.html.erb @@ -4,5 +4,5 @@ collection: @evaluation_types, pagy: @pagy, card_header: t('.card_header'), - params: ['identifier', 'name'], + params: %w[identifier name], actions: %w[edit destroy] %> From 08a97b22d1cadeeac43f82b202f91c77686f13fb Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:29:05 +0000 Subject: [PATCH 770/970] chore(deps): bump mimemagic from 0.3.4 to 0.3.5 Bumps [mimemagic](https://github.com/minad/mimemagic) from 0.3.4 to 0.3.5. - [Release notes](https://github.com/minad/mimemagic/releases) - [Changelog](https://github.com/minad/mimemagic/blob/master/CHANGELOG.md) - [Commits](https://github.com/minad/mimemagic/compare/v0.3.4...v0.3.5) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3650d8774..824ce9999 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -230,7 +230,7 @@ GEM marcel (0.3.3) mimemagic (~> 0.3.2) method_source (1.0.0) - mimemagic (0.3.4) + mimemagic (0.3.5) mini_magick (4.10.1) mini_mime (1.0.2) mini_portile2 (2.4.0) From f35905207c417052899421798dee03e2d6645253 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:30:26 +0000 Subject: [PATCH 771/970] chore(deps): bump raabro from 1.1.6 to 1.3.1 Bumps [raabro](https://github.com/floraison/raabro) from 1.1.6 to 1.3.1. - [Release notes](https://github.com/floraison/raabro/releases) - [Changelog](https://github.com/floraison/raabro/blob/master/CHANGELOG.md) - [Commits](https://github.com/floraison/raabro/compare/v1.1.6...v1.3.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3650d8774..b67eaa398 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -282,7 +282,7 @@ GEM pundit (2.1.0) activesupport (>= 3.0.0) pwned (2.0.1) - raabro (1.1.6) + raabro (1.3.1) rack (2.0.9) rack-attack (6.3.0) rack (>= 1.0, < 3) From 12af510d764bcdec16cc43c2eddfd029bdeb7161 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:31:07 +0000 Subject: [PATCH 772/970] chore(deps): bump aws-partitions from 1.308.0 to 1.312.0 Bumps [aws-partitions](https://github.com/aws/aws-sdk-ruby) from 1.308.0 to 1.312.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-partitions/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3650d8774..cbd2a2b0f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,7 +94,7 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.1.0) - aws-partitions (1.308.0) + aws-partitions (1.312.0) aws-sdk-core (3.94.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) From 0cd14525b7fa2fb6d4bf90c214c81828036d7daf Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:31:45 +0000 Subject: [PATCH 773/970] chore(deps): bump aws-sdk-s3 from 1.63.0 to 1.64.0 Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.63.0 to 1.64.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/compare/v1.63.0...v1.64.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3650d8774..4e5931f8b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,16 +94,16 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.1.0) - aws-partitions (1.308.0) - aws-sdk-core (3.94.0) + aws-partitions (1.312.0) + aws-sdk-core (3.95.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.30.0) + aws-sdk-kms (1.31.0) aws-sdk-core (~> 3, >= 3.71.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.63.0) + aws-sdk-s3 (1.64.0) aws-sdk-core (~> 3, >= 3.83.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) From dc4e19823a0d5131a7ff42a306c8686f950e0f52 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:32:15 +0000 Subject: [PATCH 774/970] chore(deps): bump @coreui/coreui-free-bootstrap-admin-template Bumps [@coreui/coreui-free-bootstrap-admin-template](https://github.com/coreui/coreui-free-bootstrap-admin-template) from `112721f` to `0b81083`. - [Release notes](https://github.com/coreui/coreui-free-bootstrap-admin-template/releases) - [Commits](https://github.com/coreui/coreui-free-bootstrap-admin-template/compare/112721fb4be70038e8eb808d27e65d19cb823310...0b810831d37bfeb9dc3357d8ccad5c70525a7903) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 118 ++++++++++++++++++------------------------------------ 1 file changed, 39 insertions(+), 79 deletions(-) diff --git a/yarn.lock b/yarn.lock index a1bf08ea9..113448214 100644 --- a/yarn.lock +++ b/yarn.lock @@ -835,57 +835,52 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" -"@coreui/coreui-free-bootstrap-admin-template@https://github.com/coreui/coreui-free-bootstrap-admin-template.git#master": - version "2.1.15" - resolved "https://github.com/coreui/coreui-free-bootstrap-admin-template.git#112721fb4be70038e8eb808d27e65d19cb823310" +"@coreui/chartjs@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@coreui/chartjs/-/chartjs-2.0.0.tgz#0711b1bce0dc6261d376971cebc62e268ceb418d" + integrity sha512-degpSo1MqSWomkNwuXk2VQijEENqkaufEGI/i6/3ClVQNZQIWB5NG6QWA/aCTXt9Y/3tVfnuTzDC4YHw7E+Brg== dependencies: - "@coreui/coreui" "^2.1.12" - "@coreui/coreui-plugin-chartjs-custom-tooltips" "^1.3.1" - "@coreui/icons" "0.3.0" - bootstrap "^4.3.1" + "@coreui/coreui" "^3.0.0-beta.1" chart.js "^2.8.0" - core-js "^3.1.4" - flag-icon-css "^3.3.0" - font-awesome "~4.7.0" - jquery "^3.4.1" - pace-progress "1.0.2" - perfect-scrollbar "^1.4.0" - popper.js "^1.15.0" - regenerator-runtime "^0.13.2" - simple-line-icons "2.4.1" - -"@coreui/coreui-plugin-chartjs-custom-tooltips@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@coreui/coreui-plugin-chartjs-custom-tooltips/-/coreui-plugin-chartjs-custom-tooltips-1.3.1.tgz#c30ba81908edd01ed759defd2ac965eb63076d45" - integrity sha512-ovNE9QygRdB7IkE7gZNRx79lSk77STtNOFS4NRpjljoRcAseR156ZYV0i/dSoiwZwRJ+dHzWeXy1IMcXcdnAww== - dependencies: - ms "^2.1.1" -"@coreui/coreui-plugin-npm-postinstall@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@coreui/coreui-plugin-npm-postinstall/-/coreui-plugin-npm-postinstall-1.0.2.tgz#6daeb2ec786580d9c0849b05bc3e8d0222d5c463" - integrity sha512-yeeoWp+bNS84nP1977Y8UCiQ9pssO+f4QuVj3i0/gYZFjjvOgxx0dnyWhtowD5sLYnCRMPlPpqyjwXze3SlkYg== +"@coreui/coreui-free-bootstrap-admin-template@https://github.com/coreui/coreui-free-bootstrap-admin-template.git#master": + version "3.0.0" + uid "0b810831d37bfeb9dc3357d8ccad5c70525a7903" + resolved "https://github.com/coreui/coreui-free-bootstrap-admin-template.git#0b810831d37bfeb9dc3357d8ccad5c70525a7903" + dependencies: + "@coreui/chartjs" "^2.0.0" + "@coreui/coreui" "^3.0.0" + "@coreui/icons" "^1.0.1" + "@coreui/utils" "^1.2.2" + "@popperjs/core" "^2.0.6" + chart.js "^2.9.3" + perfect-scrollbar "1.5.0" + +"@coreui/coreui@^3.0.0", "@coreui/coreui@^3.0.0-beta.1": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@coreui/coreui/-/coreui-3.0.0.tgz#b18dd62dddb688b32237a33f60a8e56fed9a1da7" + integrity sha512-D62oLjBM3xqipQwwa29bYsEo3LUhge0Ub2tSrtXONz71oGmMxMNCjmYebkig0dM+iYuekYfusjeAP8sxpbRlHA== -"@coreui/coreui@^2.1.12": - version "2.1.16" - resolved "https://registry.yarnpkg.com/@coreui/coreui/-/coreui-2.1.16.tgz#93efb7d903bcd53092cc4bcc31ef8703de565457" - integrity sha512-1YOnQAlcX2bIgnaX3k9GKaN4lD+wKam7tdDfFj7/ZQTN1XG3dwDELHp4aagWQs78ix2CCO1LyeLrzGpsMcLW3Q== - dependencies: - "@coreui/coreui-plugin-npm-postinstall" "^1.0.2" - bootstrap "^4.3.1" - core-js "^3.3.4" - regenerator-runtime "^0.13.3" +"@coreui/icons@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@coreui/icons/-/icons-1.0.1.tgz#8af0fe6450904ee1dbb0abf36bf107f35cfecf5e" + integrity sha512-DAlvdHRC+HHecdy52vskbNzNKEpu6wHDvSlsHGrwOqNxQl1YLhGEtqAW4sKpyVE3GgysNCywUWZGFlLp8I3LgA== -"@coreui/icons@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@coreui/icons/-/icons-0.3.0.tgz#d5bece91b1442a9543593d1146bc8042b18489e3" - integrity sha512-RbBi5K5hUA8LUI9mM/i1BTaLjlyoS6kHwKbxWsH62+/j9L9WF8gAiJUhrNjMt1br8TY9RLeolyQys0E9480fIg== +"@coreui/utils@^1.2.2": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@coreui/utils/-/utils-1.2.4.tgz#f74ccdd12657c92f193dd9713cca961f157d8d39" + integrity sha512-bavC0vYshGwUQMgQ1GEX1r3853q/jWj6ZsBLeDrW+lPsI5eo4vdFx912w/dyGBfVr2U3qnyuNrdwtO/6tThntg== "@csstools/convert-colors@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7" integrity sha512-5a6wqoJV/xEdbRNKVo6I4hO3VjyDq//8q2f9I6PBAvMesJHFauXDorcNCsr9RzvsZnaWi5NYCcfyqP1QeFHFbw== +"@popperjs/core@^2.0.6": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.4.0.tgz#0e1bdf8d021e7ea58affade33d9d607e11365915" + integrity sha512-NMrDy6EWh9TPdSRiHmHH2ye1v5U0gBD7pRYwSwJvomx7Bm4GG04vu63dYiVzebLOx2obPpJugew06xVP0Nk7hA== + "@rails/actioncable@^6.0.0-alpha": version "6.0.2" resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-6.0.2.tgz#bcba9bcd6ee09a47c6628336e07399a68ca87814" @@ -1639,11 +1634,6 @@ boolbase@^1.0.0, boolbase@~1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= -bootstrap@^4.3.1: - version "4.4.1" - resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.4.1.tgz#8582960eea0c5cd2bede84d8b0baf3789c3e8b01" - integrity sha512-tbx5cHubwE6e2ZG7nqM3g/FZ5PQEDMWmMGNrCUBVRPHXTJaH7CBDdsLeu3eCh3B1tzAxTnAbtmrzvWEvT2NNEA== - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -1956,7 +1946,7 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -chart.js@^2.8.0: +chart.js@^2.8.0, chart.js@^2.9.3: version "2.9.3" resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-2.9.3.tgz#ae3884114dafd381bc600f5b35a189138aac1ef7" integrity sha512-+2jlOobSk52c1VU6fzkh3UwqHMdSlgH1xFv9FKMqHiNCpXsGPQa/+81AFa+i3jZ253Mq9aAycPwDjnn1XbRNNw== @@ -2328,11 +2318,6 @@ core-js-compat@^3.6.2: browserslist "^4.8.5" semver "7.0.0" -core-js@^3.1.4, core-js@^3.3.4: - version "3.6.4" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.4.tgz#440a83536b458114b9cb2ac1580ba377dc470647" - integrity sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw== - core-js@^3.6.4: version "3.6.5" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.5.tgz#7395dc273af37fb2e50e9bd3d9fe841285231d1a" @@ -3523,11 +3508,6 @@ findup-sync@3.0.0: micromatch "^3.0.4" resolve-dir "^1.0.1" -flag-icon-css@^3.3.0: - version "3.4.6" - resolved "https://registry.yarnpkg.com/flag-icon-css/-/flag-icon-css-3.4.6.tgz#7e51099c85648c65f86d9ebb9c0ec6f5d8826714" - integrity sha512-rF69rt19Hr63SRQTiPBzQABaYB20LAgZhDkr/AxqSdgmCIN+tC5PRMz56Y0gxehFXJmdRwv55+GMi7R1fCRTwg== - flat-cache@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" @@ -3567,11 +3547,6 @@ follow-redirects@^1.0.0: dependencies: debug "^3.0.0" -font-awesome@~4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/font-awesome/-/font-awesome-4.7.0.tgz#8fa8cf0411a1a31afd07b06d2902bb9fc815a133" - integrity sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM= - for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -4658,7 +4633,7 @@ jquery.maskedinput@^1.4.1: resolved "https://registry.yarnpkg.com/jquery.maskedinput/-/jquery.maskedinput-1.4.1.tgz#3ea8f4cdc4eafce7354c27b66a73d0f44defc327" integrity sha1-Pqj0zcTq/Oc1TCe2anPQ9E3vwyc= -jquery@>=1.12.0, jquery@^3.4.1: +jquery@>=1.12.0: version "3.5.0" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.5.0.tgz#9980b97d9e4194611c36530e7dc46a58d7340fc9" integrity sha512-Xb7SVYMvygPxbFMpTFQiHh1J7HClEaThguL15N/Gg37Lri/qKyhRGZYzHRyLH8Stq3Aow0LsHO2O2ci86fCrNQ== @@ -5857,11 +5832,6 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== -pace-progress@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pace-progress/-/pace-progress-1.0.2.tgz#fdc565c57dd91725a3167b360bf2578d3c3b548d" - integrity sha1-/cVlxX3ZFyWjFns2C/JXjTw7VI0= - pako@~1.0.5: version "1.0.11" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" @@ -6039,7 +6009,7 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" -perfect-scrollbar@^1.4.0: +perfect-scrollbar@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/perfect-scrollbar/-/perfect-scrollbar-1.5.0.tgz#821d224ed8ff61990c23f26db63048cdc75b6b83" integrity sha512-NrNHJn5mUGupSiheBTy6x+6SXCFbLlm8fVZh9moIzw/LgqElN5q4ncR4pbCBCYuCJ8Kcl9mYM0NgDxvW+b4LxA== @@ -6113,11 +6083,6 @@ pnp-webpack-plugin@^1.6.4: dependencies: ts-pnp "^1.1.6" -popper.js@^1.15.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b" - integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ== - portfinder@^1.0.25: version "1.0.25" resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.25.tgz#254fd337ffba869f4b9d37edc298059cb4d35eca" @@ -7066,7 +7031,7 @@ regenerate@^1.4.0: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== -regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.3, regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.5: +regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.5: version "0.13.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697" integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA== @@ -7560,11 +7525,6 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== -simple-line-icons@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/simple-line-icons/-/simple-line-icons-2.4.1.tgz#b75bc5a0d87e530928c2ccda5735274bb256f234" - integrity sha1-t1vFoNh+UwkowszaVzUnS7JW8jQ= - simple-swizzle@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" From 6c108655d065f3287ad25078c0ac0c96c59044d0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:32:26 +0000 Subject: [PATCH 775/970] chore(deps): bump aws-sdk-kms from 1.30.0 to 1.31.0 Bumps [aws-sdk-kms](https://github.com/aws/aws-sdk-ruby) from 1.30.0 to 1.31.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-kms/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/compare/1.30.0...1.31.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3650d8774..269008632 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,13 +94,13 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.1.0) - aws-partitions (1.308.0) - aws-sdk-core (3.94.0) + aws-partitions (1.312.0) + aws-sdk-core (3.95.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.30.0) + aws-sdk-kms (1.31.0) aws-sdk-core (~> 3, >= 3.71.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.63.0) From 4c5a837ba52a34d0a31fc0d6c6863b8dca116acc Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:32:44 +0000 Subject: [PATCH 776/970] chore(deps): bump postcss-attribute-case-insensitive from 4.0.1 to 4.0.2 Bumps [postcss-attribute-case-insensitive](https://github.com/Semigradsky/postcss-attribute-case-insensitive) from 4.0.1 to 4.0.2. - [Release notes](https://github.com/Semigradsky/postcss-attribute-case-insensitive/releases) - [Commits](https://github.com/Semigradsky/postcss-attribute-case-insensitive/commits) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index a1bf08ea9..531e92032 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6133,12 +6133,12 @@ posix-character-classes@^0.1.0: integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= postcss-attribute-case-insensitive@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-4.0.1.tgz#b2a721a0d279c2f9103a36331c88981526428cc7" - integrity sha512-L2YKB3vF4PetdTIthQVeT+7YiSzMoNMLLYxPXXppOOP7NoazEAy45sh2LvJ8leCQjfBcfkYQs8TtCcQjeZTp8A== + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-4.0.2.tgz#d93e46b504589e94ac7277b0463226c68041a880" + integrity sha512-clkFxk/9pcdb4Vkn0hAHq3YnxBQ2p0CGD1dy24jN+reBck+EWxMbxSUqN4Yj7t0w8csl87K6p0gxBe1utkJsYA== dependencies: postcss "^7.0.2" - postcss-selector-parser "^5.0.0" + postcss-selector-parser "^6.0.2" postcss-calc@^7.0.1: version "7.0.2" @@ -6711,7 +6711,7 @@ postcss-selector-parser@^3.0.0: indexes-of "^1.0.1" uniq "^1.0.1" -postcss-selector-parser@^5.0.0, postcss-selector-parser@^5.0.0-rc.3, postcss-selector-parser@^5.0.0-rc.4: +postcss-selector-parser@^5.0.0-rc.3, postcss-selector-parser@^5.0.0-rc.4: version "5.0.0" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz#249044356697b33b64f1a8f7c80922dddee7195c" integrity sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ== @@ -6768,9 +6768,9 @@ postcss-values-parser@^2.0.0, postcss-values-parser@^2.0.1: uniq "^1.0.1" postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.5, postcss@^7.0.6: - version "7.0.27" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.27.tgz#cc67cdc6b0daa375105b7c424a85567345fc54d9" - integrity sha512-WuQETPMcW9Uf1/22HWUWP9lgsIC+KEHg2kozMflKjbeUtw9ujvFX6QmIfozaErDkmLWS9WEnEdEe6Uo9/BNTdQ== + version "7.0.29" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.29.tgz#d3a903872bd52280b83bce38cdc83ce55c06129e" + integrity sha512-ba0ApvR3LxGvRMMiUa9n0WR4HjzcYm7tS+ht4/2Nd0NLtHpPIH77fuB9Xh1/yJVz9O/E/95Y/dn8ygWsyffXtw== dependencies: chalk "^2.4.2" source-map "^0.6.1" From 052f12e5af46186cd4822cbfa7b47dc1ccaf0600 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:32:53 +0000 Subject: [PATCH 777/970] chore(deps): bump aws-sdk-core from 3.94.0 to 3.95.0 Bumps [aws-sdk-core](https://github.com/aws/aws-sdk-ruby) from 3.94.0 to 3.95.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-core/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3650d8774..6a70d372d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,8 +94,8 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.1.0) - aws-partitions (1.308.0) - aws-sdk-core (3.94.0) + aws-partitions (1.312.0) + aws-sdk-core (3.95.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) From 49f6c161681b26e1b50dca353cb46a0712e1b688 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:33:31 +0000 Subject: [PATCH 778/970] chore(deps-dev): bump web-console from 4.0.1 to 4.0.2 Bumps [web-console](https://github.com/rails/web-console) from 4.0.1 to 4.0.2. - [Release notes](https://github.com/rails/web-console/releases) - [Changelog](https://github.com/rails/web-console/blob/master/CHANGELOG.markdown) - [Commits](https://github.com/rails/web-console/compare/v4.0.1...v4.0.2) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3650d8774..f887b1ae5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -434,7 +434,7 @@ GEM public_suffix warden (1.2.8) rack (>= 2.0.6) - web-console (4.0.1) + web-console (4.0.2) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) From faefe1c943d84b25832ded5e1973ccb3f871aa6d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:33:35 +0000 Subject: [PATCH 779/970] chore(deps): bump eslint-module-utils from 2.5.2 to 2.6.0 Bumps [eslint-module-utils](https://github.com/benmosher/eslint-plugin-import) from 2.5.2 to 2.6.0. - [Release notes](https://github.com/benmosher/eslint-plugin-import/releases) - [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md) - [Commits](https://github.com/benmosher/eslint-plugin-import/compare/utils/v2.5.2...v2.6.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index a1bf08ea9..dc051fbfa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3055,9 +3055,9 @@ eslint-import-resolver-node@^0.3.2: resolve "^1.13.1" eslint-module-utils@^2.4.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.5.2.tgz#7878f7504824e1b857dd2505b59a8e5eda26a708" - integrity sha512-LGScZ/JSlqGKiT8OC+cYRxseMjyqt6QO54nl281CK93unD89ijSeRV6An8Ci/2nvWVKe8K/Tqdm75RQoIOCr+Q== + version "2.6.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz#579ebd094f56af7797d19c9866c9c9486629bfa6" + integrity sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA== dependencies: debug "^2.6.9" pkg-dir "^2.0.0" From a9c58b8c27d2dacecca2a734d938f2b8f1acf83d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:34:00 +0000 Subject: [PATCH 780/970] chore(deps): bump fugit from 1.3.4 to 1.3.5 Bumps [fugit](https://github.com/floraison/fugit) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/floraison/fugit/releases) - [Changelog](https://github.com/floraison/fugit/blob/master/CHANGELOG.md) - [Commits](https://github.com/floraison/fugit/compare/v1.3.4...v1.3.5) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3650d8774..a867a8650 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -181,7 +181,7 @@ GEM railties (>= 3.2, < 6.1) friendly_id (5.3.0) activerecord (>= 4.0.0) - fugit (1.3.4) + fugit (1.3.5) et-orbi (~> 1.1, >= 1.1.8) raabro (~> 1.1) globalid (0.4.2) @@ -282,7 +282,7 @@ GEM pundit (2.1.0) activesupport (>= 3.0.0) pwned (2.0.1) - raabro (1.1.6) + raabro (1.3.1) rack (2.0.9) rack-attack (6.3.0) rack (>= 1.0, < 3) From 6911b77609b41ca1667c8f67c7fcc2b63e929a8a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:34:31 +0000 Subject: [PATCH 781/970] chore(deps): bump public_suffix from 4.0.4 to 4.0.5 Bumps [public_suffix](https://github.com/weppos/publicsuffix-ruby) from 4.0.4 to 4.0.5. - [Release notes](https://github.com/weppos/publicsuffix-ruby/releases) - [Changelog](https://github.com/weppos/publicsuffix-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/weppos/publicsuffix-ruby/compare/v4.0.4...v4.0.5) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3650d8774..f764189ed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -276,7 +276,7 @@ GEM method_source (~> 1.0) pry-rails (0.3.9) pry (>= 0.10.4) - public_suffix (4.0.4) + public_suffix (4.0.5) puma (4.3.3) nio4r (~> 2.0) pundit (2.1.0) From 40da8d3162515cc83f2e505f09738fd12e9a3ad5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:34:50 +0000 Subject: [PATCH 782/970] chore(deps): bump trix from 1.2.2 to 1.2.3 Bumps [trix](https://github.com/basecamp/trix) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/basecamp/trix/releases) - [Commits](https://github.com/basecamp/trix/compare/1.2.2...1.2.3) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e25fb16c7..62d175bdf 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "select2": "^4.0.12", "stimulus": "^1.1.1", "toastr": "^2.1.4", - "trix": "^1.2.2", + "trix": "^1.2.3", "turbolinks": "^5.2.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index a1bf08ea9..37b523b32 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8240,10 +8240,10 @@ trim-newlines@^1.0.0: resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" integrity sha1-WIeWa7WCpFA6QetST301ARgVphM= -trix@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/trix/-/trix-1.2.2.tgz#bb2afacb981df9a6edb49bc66f57427b9728909d" - integrity sha512-xNWwKDa1PG5do/qV3FRESXjM17U5ACB9Ih+x4mylLYfAgmYYTA17ExVdrrA7vCJ5J9nS1tVZFyhVTPgPTtIFVg== +trix@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/trix/-/trix-1.2.3.tgz#354d8002b3b8f7af426a85097c2fa2042a538d2b" + integrity sha512-1E/abahXhFgrTsIfd20c2NRp3VXqtwzseFevfZdHjvqS2+7TDfGGefn2BAeHnsInR3QWoLn33xAXw6aGZVVRgw== "true-case-path@^1.0.2": version "1.0.3" From 9c0e9abc489245e5042c7086b60a7578a30d3125 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:35:02 +0000 Subject: [PATCH 783/970] chore(deps): bump pagy from 3.8.0 to 3.8.1 Bumps [pagy](https://github.com/ddnexus/pagy) from 3.8.0 to 3.8.1. - [Release notes](https://github.com/ddnexus/pagy/releases) - [Changelog](https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md) - [Commits](https://github.com/ddnexus/pagy/compare/3.8.0...3.8.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3650d8774..800046573 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -261,7 +261,7 @@ GEM validate_url webfinger (>= 1.0.1) orm_adapter (0.5.0) - pagy (3.8.0) + pagy (3.8.1) parallel (1.19.1) parser (2.7.1.2) ast (~> 2.4.0) From daf3c24f1771265a27fedbafbb679e54d3e0c292 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 00:35:41 +0000 Subject: [PATCH 784/970] chore(deps): bump browserify-sign from 4.0.4 to 4.1.0 Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.0.4 to 4.1.0. - [Release notes](https://github.com/crypto-browserify/browserify-sign/releases) - [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.0.4...v4.1.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 47 +++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index a1bf08ea9..246e5a120 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1601,11 +1601,16 @@ bluebird@^3.5.5: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.4.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== +bn.js@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.1.tgz#48efc4031a9c4041b9c99c6941d903463ab62eb5" + integrity sha512-IUTD/REb78Z2eodka1QZyyEk66pciRcP6Sroka0aI3tG/iwIdYLrBD62RsubR7vqdt3WyX8p4jxeatzmRSphtA== + body-parser@1.19.0: version "1.19.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" @@ -1704,7 +1709,7 @@ browserify-des@^1.0.0: inherits "^2.0.1" safe-buffer "^5.1.2" -browserify-rsa@^4.0.0: +browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= @@ -1713,17 +1718,18 @@ browserify-rsa@^4.0.0: randombytes "^2.0.1" browserify-sign@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" - integrity sha1-qk62jl17ZYuqa/alfmMMvXqT0pg= - dependencies: - bn.js "^4.1.1" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.2" - elliptic "^6.0.0" - inherits "^2.0.1" - parse-asn1 "^5.0.0" + version "4.1.0" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.1.0.tgz#4fe971b379a5aeb4925e06779f9fa1f41d249d70" + integrity sha512-VYxo7cDCeYUoBZ0ZCy4UyEUCP3smyBd4DRQM5nrFS1jJjPJjX7rP3oLRpPoWfkhQfyJ0I9ZbHbKafrFD/SGlrg== + dependencies: + bn.js "^5.1.1" + browserify-rsa "^4.0.1" + create-hash "^1.2.0" + create-hmac "^1.1.7" + elliptic "^6.5.2" + inherits "^2.0.4" + parse-asn1 "^5.1.5" + readable-stream "^3.6.0" browserify-zlib@^0.2.0: version "0.2.0" @@ -2372,7 +2378,7 @@ create-ecdh@^4.0.0: bn.js "^4.1.0" elliptic "^6.0.0" -create-hash@^1.1.0, create-hash@^1.1.2: +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== @@ -2383,7 +2389,7 @@ create-hash@^1.1.0, create-hash@^1.1.2: ripemd160 "^2.0.1" sha.js "^2.4.0" -create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: +create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== @@ -2918,7 +2924,7 @@ electron-to-chromium@^1.3.390: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.403.tgz#c8bab4e2e72bf78bc28bad1cc355c061f9cc1918" integrity sha512-JaoxV4RzdBAZOnsF4dAlZ2ijJW72MbqO5lNfOBHUWiBQl3Rwe+mk2RCUMrRI3rSClLJ8HSNQNqcry12H+0ZjFw== -elliptic@^6.0.0: +elliptic@^6.0.0, elliptic@^6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762" integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw== @@ -5883,7 +5889,7 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-asn1@^5.0.0: +parse-asn1@^5.0.0, parse-asn1@^5.1.5: version "5.1.5" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.5.tgz#003271343da58dc94cace494faef3d2147ecea0e" integrity sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ== @@ -7341,11 +7347,16 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: +safe-buffer@>=5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" From 65288ae007cea840a040c6eecda0af28800e72cf Mon Sep 17 00:00:00 2001 From: isubas Date: Sun, 17 May 2020 12:06:24 +0300 Subject: [PATCH 785/970] coreui migrate to v3.0.0 --- app/assets/config/manifest.js | 4 +- app/assets/javascripts/application.js | 2 +- app/assets/javascripts/coreui.js | 7 +- app/assets/javascripts/guest.js | 2 +- .../stylesheets/custom/content_loader.css | 2 - .../stylesheets/custom/guest_footer.css | 2 +- app/views/layouts/application.html.erb | 30 +-- .../components/_content_loader_panel.html.erb | 6 +- app/views/layouts/guest.html.erb | 11 +- app/views/layouts/shared/_aside.html.erb | 37 ++-- app/views/layouts/shared/_footer.html.erb | 2 +- app/views/layouts/shared/_header.html.erb | 44 ++-- app/views/layouts/shared/_sidebar.html.erb | 69 +++---- .../layouts/shared/menus/_admin.html.erb | 194 +++++++++--------- .../layouts/shared/menus/_employee.html.erb | 6 +- .../shared/menus/_institution_manager.erb | 6 +- .../layouts/shared/menus/_student.html.erb | 6 +- app/views/manager/dashboard/stats.html.erb | 30 +-- .../app/assets/images/logos/acme-logo.svg | 2 +- test/system/account_test.rb | 4 +- yarn.lock | 7 +- 21 files changed, 234 insertions(+), 239 deletions(-) diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 6f144bc23..889079bc2 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1,6 +1,6 @@ +//= link application.js +//= link coreui.js //= link_tree ../images //= link_directory ../stylesheets .css - -//= link application.js //= link chart.js //= link highcharts-langs/tr.js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 8b150a265..f6fa57229 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -1,6 +1,6 @@ // Manifest file for common assets being used in panel -//= require coreui +//= require jquery/dist/jquery.min //= require helpers/dynamic_select //= require toastr/build/toastr.min //= require shared/toastr_config diff --git a/app/assets/javascripts/coreui.js b/app/assets/javascripts/coreui.js index 3e4bdc7d3..71d758e3f 100644 --- a/app/assets/javascripts/coreui.js +++ b/app/assets/javascripts/coreui.js @@ -1,10 +1,5 @@ // Manifest including all assets of CoreUI -// core-components -//= require jquery/dist/jquery.min -//= require popper.js/dist/umd/popper.min -//= require bootstrap/dist/js/bootstrap.min - // core-ui -//= require @coreui/coreui/dist/js/coreui.min +//= require @coreui/coreui/dist/js/coreui.bundle.min //= require @coreui/coreui/dist/js/coreui-utilities.min diff --git a/app/assets/javascripts/guest.js b/app/assets/javascripts/guest.js index 35270451b..9e7cdb162 100644 --- a/app/assets/javascripts/guest.js +++ b/app/assets/javascripts/guest.js @@ -1,7 +1,7 @@ // Manifest file for guest template. +//= require jquery/dist/jquery.min //= require rails-ujs -//= require coreui //= require toastr/build/toastr.min //= require shared/toastr_config //= require select2/dist/js/select2.min diff --git a/app/assets/stylesheets/custom/content_loader.css b/app/assets/stylesheets/custom/content_loader.css index 46ff552c2..072d1bf45 100644 --- a/app/assets/stylesheets/custom/content_loader.css +++ b/app/assets/stylesheets/custom/content_loader.css @@ -1,5 +1,3 @@ - - .loading { position: absolute; z-index: 1000; diff --git a/app/assets/stylesheets/custom/guest_footer.css b/app/assets/stylesheets/custom/guest_footer.css index a66c1b547..2c5a4f4f1 100644 --- a/app/assets/stylesheets/custom/guest_footer.css +++ b/app/assets/stylesheets/custom/guest_footer.css @@ -1,4 +1,4 @@ -.app-footer { +.c-footer { position: fixed; bottom: 0; width: 100%; diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 58e209865..7c2addc64 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,25 +5,27 @@ <%= stylesheet_link_tag 'application', media: 'all' %> <%= javascript_include_tag 'application' %> <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload', async: true %> - - - <%= render 'layouts/shared/header' %> -
- <%= render 'layouts/shared/sidebar' %> -
-

-
-
- <%= yield %> + + <%= render 'layouts/shared/sidebar' %> + <%= render 'layouts/shared/aside' %> +
+ <%= render 'layouts/shared/header' %> +
+
+
+
+ <%= yield %> +
-
-
- <%= render 'layouts/shared/aside' %> + +
+ <%= render 'layouts/shared/footer' %>
- <%= render 'layouts/shared/footer' %> <%= render 'layouts/shared/toastr' %> + <%= javascript_include_tag 'coreui' %> diff --git a/app/views/layouts/components/_content_loader_panel.html.erb b/app/views/layouts/components/_content_loader_panel.html.erb index c3bbadeec..2803055ee 100644 --- a/app/views/layouts/components/_content_loader_panel.html.erb +++ b/app/views/layouts/components/_content_loader_panel.html.erb @@ -22,12 +22,12 @@
<% if refresh.auto %>
-
From af053a98e261769f3c02f47cd4c6351fcaebc88e Mon Sep 17 00:00:00 2001 From: dilara Date: Mon, 1 Jun 2020 15:11:37 +0300 Subject: [PATCH 874/970] Revert "Add destroy? to policies" This reverts commit 26c49d1a1171b03dcc748ddee9ac05505c5853f0. --- .../course_management/available_courses_controller.rb | 2 ++ .../course_management/available_course_group_policy.rb | 4 ---- app/policies/course_management/available_course_policy.rb | 4 ---- .../course_management/course_evaluation_type_policy.rb | 4 ---- .../available_course_groups_controller_test.rb | 4 ++-- .../available_courses_controller_test.rb | 4 ++-- .../course_evaluation_types_controller_test.rb | 4 ++-- .../available_course_group_policy_test.rb | 8 ++------ .../course_management/available_course_policy_test.rb | 8 ++------ .../course_evaluation_type_policy_test.rb | 8 ++------ 10 files changed, 14 insertions(+), 36 deletions(-) diff --git a/app/controllers/course_management/available_courses_controller.rb b/app/controllers/course_management/available_courses_controller.rb index 71e363e92..1d1385c0b 100644 --- a/app/controllers/course_management/available_courses_controller.rb +++ b/app/controllers/course_management/available_courses_controller.rb @@ -44,6 +44,8 @@ def update end def destroy + return redirect_with('.errors.not_proper_event_range') unless @available_course.manageable? + message = @available_course.destroy ? 'success' : 'error' redirect_with(message) end diff --git a/app/policies/course_management/available_course_group_policy.rb b/app/policies/course_management/available_course_group_policy.rb index 6917e18ed..ff2a342f6 100644 --- a/app/policies/course_management/available_course_group_policy.rb +++ b/app/policies/course_management/available_course_group_policy.rb @@ -6,10 +6,6 @@ class AvailableCourseGroupPolicy < ApplicationPolicy undef :index?, :show? - def destroy? - permitted?(:destroy) && record.available_course.manageable? - end - private def permitted?(*privileges) diff --git a/app/policies/course_management/available_course_policy.rb b/app/policies/course_management/available_course_policy.rb index a50bbd178..638341e65 100644 --- a/app/policies/course_management/available_course_policy.rb +++ b/app/policies/course_management/available_course_policy.rb @@ -4,10 +4,6 @@ module CourseManagement class AvailableCoursePolicy < ApplicationPolicy include CrudPolicyMethods - def destroy? - permitted?(:destroy) && record.manageable? - end - private def permitted?(*privileges) diff --git a/app/policies/course_management/course_evaluation_type_policy.rb b/app/policies/course_management/course_evaluation_type_policy.rb index 96cc27fdd..121f70a2d 100644 --- a/app/policies/course_management/course_evaluation_type_policy.rb +++ b/app/policies/course_management/course_evaluation_type_policy.rb @@ -6,10 +6,6 @@ class CourseEvaluationTypePolicy < ApplicationPolicy undef :index?, :show? - def destroy? - permitted?(:destroy) && record.available_course.manageable? - end - private def permitted?(*privileges) diff --git a/test/controllers/course_management/available_course_groups_controller_test.rb b/test/controllers/course_management/available_course_groups_controller_test.rb index ed12a70cc..563501ee2 100644 --- a/test/controllers/course_management/available_course_groups_controller_test.rb +++ b/test/controllers/course_management/available_course_groups_controller_test.rb @@ -80,8 +80,8 @@ class AvailableCourseGroupsControllerTest < ActionDispatch::IntegrationTest delete available_course_available_course_group_path(@available_course, @group) end - assert_redirected_to root_path - assert_equal t('pundit.default'), flash[:alert] + assert_redirected_to available_course_path(@available_course) + assert_equal translate('.errors.not_proper_event_range'), flash[:info] end private diff --git a/test/controllers/course_management/available_courses_controller_test.rb b/test/controllers/course_management/available_courses_controller_test.rb index 231814c64..be3a07fda 100644 --- a/test/controllers/course_management/available_courses_controller_test.rb +++ b/test/controllers/course_management/available_courses_controller_test.rb @@ -93,8 +93,8 @@ class AvailableCoursesControllerTest < ActionDispatch::IntegrationTest delete available_course_path(@available_course) end - assert_redirected_to root_path - assert_equal t('pundit.default'), flash[:alert] + assert_redirected_to available_courses_path + assert_equal translate('.errors.not_proper_event_range'), flash[:info] end private diff --git a/test/controllers/course_management/course_evaluation_types_controller_test.rb b/test/controllers/course_management/course_evaluation_types_controller_test.rb index 60bb840b9..ffd3acad0 100644 --- a/test/controllers/course_management/course_evaluation_types_controller_test.rb +++ b/test/controllers/course_management/course_evaluation_types_controller_test.rb @@ -87,8 +87,8 @@ class CourseEvaluationTypesControllerTest < ActionDispatch::IntegrationTest delete available_course_evaluation_type_path(available_course, course_evaluation_type) end - assert_redirected_to root_path - assert_equal t('pundit.default'), flash[:alert] + assert_redirected_to available_course_path(available_course) + assert_equal translate('.errors.not_proper_event_range'), flash[:notice] end private diff --git a/test/policies/course_management/available_course_group_policy_test.rb b/test/policies/course_management/available_course_group_policy_test.rb index 98ced1654..21c434e13 100644 --- a/test/policies/course_management/available_course_group_policy_test.rb +++ b/test/policies/course_management/available_course_group_policy_test.rb @@ -4,10 +4,6 @@ module CourseManagement class AvailableCourseGroupPolicyTest < PunditTestCase - setup do - @group = available_course_groups(:elective_course_group) - end - %w[ create? destroy? @@ -16,8 +12,8 @@ class AvailableCourseGroupPolicyTest < PunditTestCase update? ].each do |method| test method do - assert_permit users(:serhat), record: @group - assert_not_permit users(:mine), record: @group + assert_permit users(:serhat) + assert_not_permit users(:mine) end end end diff --git a/test/policies/course_management/available_course_policy_test.rb b/test/policies/course_management/available_course_policy_test.rb index 4281dd52f..5faed5992 100644 --- a/test/policies/course_management/available_course_policy_test.rb +++ b/test/policies/course_management/available_course_policy_test.rb @@ -4,10 +4,6 @@ module CourseManagement class AvailableCoursePolicyTest < PunditTestCase - setup do - @available_course = available_courses(:elective_course) - end - %w[ create? destroy? @@ -18,8 +14,8 @@ class AvailableCoursePolicyTest < PunditTestCase update? ].each do |method| test method do - assert_permit users(:serhat), record: @available_course - assert_not_permit users(:mine), record: @available_course + assert_permit users(:serhat) + assert_not_permit users(:mine) end end end diff --git a/test/policies/course_management/course_evaluation_type_policy_test.rb b/test/policies/course_management/course_evaluation_type_policy_test.rb index 966bed1cc..0aa9c924e 100644 --- a/test/policies/course_management/course_evaluation_type_policy_test.rb +++ b/test/policies/course_management/course_evaluation_type_policy_test.rb @@ -4,10 +4,6 @@ module CourseManagement class CourseEvaluationTypePolicyTest < PunditTestCase - setup do - @evaluation_type = course_evaluation_types(:elective_midterm_evaluation_type) - end - %w[ create? destroy? @@ -16,8 +12,8 @@ class CourseEvaluationTypePolicyTest < PunditTestCase update? ].each do |method| test method do - assert_permit users(:serhat), record: @evaluation_type - assert_not_permit users(:mine), record: @evaluation_type + assert_permit users(:serhat) + assert_not_permit users(:mine) end end end From e29b3a188b58d78a8ace724e6ed0cc49390ca79d Mon Sep 17 00:00:00 2001 From: dilara Date: Mon, 1 Jun 2020 16:26:54 +0300 Subject: [PATCH 875/970] Simplify link filter --- .../course_management/available_courses/_groups.html.erb | 4 ++-- app/views/course_management/available_courses/show.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/course_management/available_courses/_groups.html.erb b/app/views/course_management/available_courses/_groups.html.erb index ac993e6a5..36561badc 100644 --- a/app/views/course_management/available_courses/_groups.html.erb +++ b/app/views/course_management/available_courses/_groups.html.erb @@ -11,8 +11,8 @@
<%= fa_icon 'cube' %><%= group.name %> - <% except = %i[show] << (:destroy if (@groups.count == 1) || !manageable) %> - <%= link_to_actions([@available_course, group], except: except.compact) %> + <%= link_to_edit([:edit, @available_course, group]) %> + <%= link_to_destroy([@available_course, group]) if (@groups.count > 1) && manageable %>
diff --git a/app/views/course_management/available_courses/show.html.erb b/app/views/course_management/available_courses/show.html.erb index a6862d34c..85733600f 100644 --- a/app/views/course_management/available_courses/show.html.erb +++ b/app/views/course_management/available_courses/show.html.erb @@ -3,8 +3,8 @@
<%= link_to_back available_courses_path %> <% manageable = @available_course.manageable? %> - <% except = %i[show] << (:destroy unless manageable) %> - <%= link_to_actions(@available_course, except: except.compact) %> + <%= link_to_edit([:edit, @available_course]) %> + <%= link_to_destroy(@available_course) if manageable %>
From c822f450c1395ee989998cfa67a76eaa2dd5ed0b Mon Sep 17 00:00:00 2001 From: dilara Date: Tue, 2 Jun 2020 11:53:31 +0300 Subject: [PATCH 876/970] Add callback to ensure there is another group --- app/models/available_course_group.rb | 9 +++++++++ test/models/available_course_group_test.rb | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/app/models/available_course_group.rb b/app/models/available_course_group.rb index 519eab464..e7a8544d5 100644 --- a/app/models/available_course_group.rb +++ b/app/models/available_course_group.rb @@ -1,6 +1,9 @@ # frozen_string_literal: true class AvailableCourseGroup < ApplicationRecord + # callbacks + before_destroy :must_be_another_group + # relations belongs_to :available_course, counter_cache: :groups_count has_many :course_enrollments, dependent: :destroy @@ -26,4 +29,10 @@ def quota_full? def number_of_enrolled_students saved_enrollments.count end + + private + + def must_be_another_group + throw(:abort) if available_course.groups.where.not(id: id).empty? && !destroyed_by_association + end end diff --git a/test/models/available_course_group_test.rb b/test/models/available_course_group_test.rb index e1bcffaff..7a936d520 100644 --- a/test/models/available_course_group_test.rb +++ b/test/models/available_course_group_test.rb @@ -4,6 +4,7 @@ class AvailableCourseGroupTest < ActiveSupport::TestCase extend Support::Minitest::AssociationHelper + extend Support::Minitest::CallbackHelper extend Support::Minitest::ValidationHelper # relations @@ -27,6 +28,15 @@ class AvailableCourseGroupTest < ActiveSupport::TestCase # validations: nested models validates_presence_of_nested_model :lecturers + # callbacks + before_destroy :must_be_another_group + + test 'callback ensures that there must be a group other than current one' do + AvailableCourse.reset_counters(available_courses(:elective_course).id, :groups_count) + assert available_course_groups(:elective_course_group).destroy + assert_not available_course_groups(:compulsory_course_group).destroy + end + # custom methods test 'quota_full? method' do assert available_course_groups(:elective_course_group).quota_full? From a89bd6824ca81ae315dcd848d7b0105fc1d08aa9 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 2 Jun 2020 15:01:12 +0300 Subject: [PATCH 877/970] Add tuition debts information to student side --- .../studentship/tuition_debts_controller.rb | 17 +++++++++ .../studentship/tuition_debts/index.html.erb | 35 +++++++++++++++++++ .../studentship/tuition_debts.en.yml | 9 +++++ .../studentship/tuition_debts.tr.yml | 9 +++++ config/routes/studentship.rb | 1 + 5 files changed, 71 insertions(+) create mode 100644 app/controllers/studentship/tuition_debts_controller.rb create mode 100644 app/views/studentship/tuition_debts/index.html.erb create mode 100644 config/locales/controllers/studentship/tuition_debts.en.yml create mode 100644 config/locales/controllers/studentship/tuition_debts.tr.yml diff --git a/app/controllers/studentship/tuition_debts_controller.rb b/app/controllers/studentship/tuition_debts_controller.rb new file mode 100644 index 000000000..d59328ced --- /dev/null +++ b/app/controllers/studentship/tuition_debts_controller.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Studentship + class TuitionDebtsController < ApplicationController + before_action :set_student + + def index + @debts = @student.tuition_debts + end + + private + + def set_student + @student = current_user.students.find(params[:student_id]) + end + end +end diff --git a/app/views/studentship/tuition_debts/index.html.erb b/app/views/studentship/tuition_debts/index.html.erb new file mode 100644 index 000000000..e41631acc --- /dev/null +++ b/app/views/studentship/tuition_debts/index.html.erb @@ -0,0 +1,35 @@ +
+
+
+ <%= link_to_back root_path %> +
+ +
+
+ <%= fa_icon 'money' %> <%= t('.tuition_debt_information') %> +
+
+
+ + + + + + + + + + <% @debts.each do |debt| %> + + + + + + + <% end %> + +
<%= t('.academic_term') %><%= t('.amount') %><%= t('.due_date') %><%= t('.paid') %>
<%= full_name(debt.academic_term) %><%= number_to_currency(debt.amount) %><%= l(debt.due_date, format: :short) %><%= icon_for_check(debt.paid) %>
+
+
+
+
diff --git a/config/locales/controllers/studentship/tuition_debts.en.yml b/config/locales/controllers/studentship/tuition_debts.en.yml new file mode 100644 index 000000000..0b39797ef --- /dev/null +++ b/config/locales/controllers/studentship/tuition_debts.en.yml @@ -0,0 +1,9 @@ +en: + studentship: + tuition_debts: + index: + academic_term: Academic Term + amount: Amount + due_date: Due Date + paid: Paid? + tuition_debt_information: Tuition Debt Information diff --git a/config/locales/controllers/studentship/tuition_debts.tr.yml b/config/locales/controllers/studentship/tuition_debts.tr.yml new file mode 100644 index 000000000..39937479a --- /dev/null +++ b/config/locales/controllers/studentship/tuition_debts.tr.yml @@ -0,0 +1,9 @@ +tr: + studentship: + tuition_debts: + index: + academic_term: Akademik Dönem + amount: Meblağ + due_date: Son Ödeme Tarihi + paid: Ödendi mi? + tuition_debt_information: Harç Borcu Bilgileri diff --git a/config/routes/studentship.rb b/config/routes/studentship.rb index 5ee28fb64..1dc486101 100644 --- a/config/routes/studentship.rb +++ b/config/routes/studentship.rb @@ -6,5 +6,6 @@ get :save, on: :collection get :list, on: :collection end + resources :tuition_debts, only: :index end end From a341f136db0e5053700ab3f74983ef7b982e807c Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 3 Jun 2020 09:46:51 +0300 Subject: [PATCH 878/970] Add tuition debt link to student sidebar --- app/views/layouts/shared/menus/_student.html.erb | 5 +++++ config/locales/layouts/shared/sidebar.en.yml | 1 + config/locales/layouts/shared/sidebar.tr.yml | 1 + 3 files changed, 7 insertions(+) diff --git a/app/views/layouts/shared/menus/_student.html.erb b/app/views/layouts/shared/menus/_student.html.erb index 3004258e1..ea53384ee 100644 --- a/app/views/layouts/shared/menus/_student.html.erb +++ b/app/views/layouts/shared/menus/_student.html.erb @@ -3,3 +3,8 @@ <%= fa_icon('graduation-cap', text: t('.course_enrollment'), class: 'c-sidebar-nav-icon') %> <% end %> +
  • + <%= link_to student_tuition_debts_path(current_account.object), class: 'c-sidebar-nav-link' do %> + <%= fa_icon('graduation-cap', text: t('.tuition_debt_information'), class: 'c-sidebar-nav-icon') %> + <% end %> +
  • diff --git a/config/locales/layouts/shared/sidebar.en.yml b/config/locales/layouts/shared/sidebar.en.yml index 5a3bfce59..f12f401b0 100644 --- a/config/locales/layouts/shared/sidebar.en.yml +++ b/config/locales/layouts/shared/sidebar.en.yml @@ -41,6 +41,7 @@ en: given_courses: Given Courses student: course_enrollment: Course Enrollment + tuition_debt_information: Tuition Debt Information institution_manager: manager: stats: University Stats diff --git a/config/locales/layouts/shared/sidebar.tr.yml b/config/locales/layouts/shared/sidebar.tr.yml index ec2dea560..00236ee46 100644 --- a/config/locales/layouts/shared/sidebar.tr.yml +++ b/config/locales/layouts/shared/sidebar.tr.yml @@ -41,6 +41,7 @@ tr: given_courses: Verilen Dersler student: course_enrollment: Ders Kayıtlanma + tuition_debt_information: Harç Borcu Bilgileri institution_manager: manager: stats: Üniversite İstatistikleri From 40cfad1efaec93d0a02e34d6d37cd99d21336994 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 3 Jun 2020 11:35:13 +0300 Subject: [PATCH 879/970] Add policy --- .../studentship/tuition_debts_controller.rb | 7 ++++++- app/policies/studentship/tuition_debt_policy.rb | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 app/policies/studentship/tuition_debt_policy.rb diff --git a/app/controllers/studentship/tuition_debts_controller.rb b/app/controllers/studentship/tuition_debts_controller.rb index d59328ced..a97159da8 100644 --- a/app/controllers/studentship/tuition_debts_controller.rb +++ b/app/controllers/studentship/tuition_debts_controller.rb @@ -3,15 +3,20 @@ module Studentship class TuitionDebtsController < ApplicationController before_action :set_student + before_action :authorized? def index @debts = @student.tuition_debts end - + private def set_student @student = current_user.students.find(params[:student_id]) end + + def authorized? + authorize(@student, policy_class: Studentship::TuitionDebtPolicy) + end end end diff --git a/app/policies/studentship/tuition_debt_policy.rb b/app/policies/studentship/tuition_debt_policy.rb new file mode 100644 index 000000000..854ca75c2 --- /dev/null +++ b/app/policies/studentship/tuition_debt_policy.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Studentship + class TuitionDebtPolicy < ApplicationPolicy + def index? + permitted? + end + + private + + def permitted? + user&.student? + end + end +end From 3bc3b39c0c79f8fcf6eb187562e9bb4bd4f8642e Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 3 Jun 2020 11:53:33 +0300 Subject: [PATCH 880/970] Create tuition debt controller test --- .../studentship/tuition_debts_controller.rb | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/controllers/studentship/tuition_debts_controller.rb diff --git a/test/controllers/studentship/tuition_debts_controller.rb b/test/controllers/studentship/tuition_debts_controller.rb new file mode 100644 index 000000000..db6818136 --- /dev/null +++ b/test/controllers/studentship/tuition_debts_controller.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require 'test_helper' + +module Studentship + class TuitionDebtsControllerTest < ActionDispatch::IntegrationTest + setup do + sign_in users(:john) + @student = students(:john) + end + + test 'should get index' do + get student_tuition_debts_path(@student) + assert_response :success + assert_select 'tr' do + %i[academic_term amount due_date paid].each do |param| + assert_select 'th', t("studentship.tuition_debts.index.#{param}") + end + end + end + end +end From 62764d5e6127996ff81c28593d2104cc67b63f37 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 3 Jun 2020 14:24:52 +0300 Subject: [PATCH 881/970] Create tuition debt policy test --- .../policies/studentship/tuition_debt_policy_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/policies/studentship/tuition_debt_policy_test.rb diff --git a/test/policies/studentship/tuition_debt_policy_test.rb b/test/policies/studentship/tuition_debt_policy_test.rb new file mode 100644 index 000000000..ec6eb5082 --- /dev/null +++ b/test/policies/studentship/tuition_debt_policy_test.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'pundit_test_case' + +module Studentship + class TuitionDebtPolicyTest < PunditTestCase + test 'index?' do + assert_permit users(:serhat) + assert_not_permit users(:mine) + end + end +end From 628446b7e8650ebf8fa143cec74569319e458d40 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 4 Jun 2020 13:35:23 +0300 Subject: [PATCH 882/970] Fix n+1 query --- app/controllers/studentship/tuition_debts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/studentship/tuition_debts_controller.rb b/app/controllers/studentship/tuition_debts_controller.rb index a97159da8..ede78ee71 100644 --- a/app/controllers/studentship/tuition_debts_controller.rb +++ b/app/controllers/studentship/tuition_debts_controller.rb @@ -6,7 +6,7 @@ class TuitionDebtsController < ApplicationController before_action :authorized? def index - @debts = @student.tuition_debts + @debts = @student.tuition_debts.includes(:academic_term).order(:due_date) end private From 6d443d58d4a99417869bc6ef687082101e4cccf1 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 4 Jun 2020 16:31:33 +0300 Subject: [PATCH 883/970] Change file name --- ...ition_debts_controller.rb => tuition_debts_controller_test.rb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/controllers/studentship/{tuition_debts_controller.rb => tuition_debts_controller_test.rb} (100%) diff --git a/test/controllers/studentship/tuition_debts_controller.rb b/test/controllers/studentship/tuition_debts_controller_test.rb similarity index 100% rename from test/controllers/studentship/tuition_debts_controller.rb rename to test/controllers/studentship/tuition_debts_controller_test.rb From 7d92f412f46b28bdff030fc8577241005e5b5b4a Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 4 Jun 2020 16:32:40 +0300 Subject: [PATCH 884/970] Change icon --- app/views/layouts/shared/menus/_student.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/shared/menus/_student.html.erb b/app/views/layouts/shared/menus/_student.html.erb index ea53384ee..72659e596 100644 --- a/app/views/layouts/shared/menus/_student.html.erb +++ b/app/views/layouts/shared/menus/_student.html.erb @@ -5,6 +5,6 @@
  • <%= link_to student_tuition_debts_path(current_account.object), class: 'c-sidebar-nav-link' do %> - <%= fa_icon('graduation-cap', text: t('.tuition_debt_information'), class: 'c-sidebar-nav-icon') %> + <%= fa_icon('money', text: t('.tuition_debt_information'), class: 'c-sidebar-nav-icon') %> <% end %>
  • From 359a818264a6140bb2e1594e9fcd4ceadf076520 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 5 Jun 2020 14:35:20 +0000 Subject: [PATCH 885/970] chore(deps): [security] bump websocket-extensions from 0.1.4 to 0.1.5 Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-ruby) from 0.1.4 to 0.1.5. **This update includes a security fix.** - [Release notes](https://github.com/faye/websocket-extensions-ruby/releases) - [Changelog](https://github.com/faye/websocket-extensions-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/faye/websocket-extensions-ruby/compare/0.1.4...0.1.5) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3e8c69da9..01c8ef7f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -458,7 +458,7 @@ GEM semantic_range (>= 2.3.0) websocket-driver (0.7.2) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.4) + websocket-extensions (0.1.5) wicked_pdf (2.0.2) activesupport xpath (3.2.0) From 73e58aa4634b502194e6dae83b4b8606a280423b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Jun 2020 19:37:06 +0000 Subject: [PATCH 886/970] chore(deps): bump websocket-extensions in /plugins/tenant/common Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-ruby) from 0.1.4 to 0.1.5. - [Release notes](https://github.com/faye/websocket-extensions-ruby/releases) - [Changelog](https://github.com/faye/websocket-extensions-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/faye/websocket-extensions-ruby/compare/0.1.4...0.1.5) Signed-off-by: dependabot[bot] --- plugins/tenant/common/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tenant/common/Gemfile.lock b/plugins/tenant/common/Gemfile.lock index 2b7290bc7..37025b036 100644 --- a/plugins/tenant/common/Gemfile.lock +++ b/plugins/tenant/common/Gemfile.lock @@ -136,7 +136,7 @@ GEM thread_safe (~> 0.1) websocket-driver (0.7.2) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.4) + websocket-extensions (0.1.5) zeitwerk (2.3.0) PLATFORMS From 590aa43b226cc847d2e1379f869b3e41f80e4221 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 5 Jun 2020 19:37:29 +0000 Subject: [PATCH 887/970] chore(deps): [security] bump websocket-extensions from 0.1.3 to 0.1.4 Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4. **This update includes a security fix.** - [Release notes](https://github.com/faye/websocket-extensions-node/releases) - [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md) - [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index bfa4c5ea7..fed86fca1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8705,9 +8705,9 @@ websocket-driver@>=0.5.1: websocket-extensions ">=0.1.1" websocket-extensions@>=0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29" - integrity sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg== + version "0.1.4" + resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" + integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== which-module@^1.0.0: version "1.0.0" From 00d0c1f8bd3ca162b153d1b3e9a46beba8aa6d68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 7 Jun 2020 06:01:30 +0000 Subject: [PATCH 888/970] chore(deps): bump websocket-extensions in /plugins/tenant/omu Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-ruby) from 0.1.4 to 0.1.5. - [Release notes](https://github.com/faye/websocket-extensions-ruby/releases) - [Changelog](https://github.com/faye/websocket-extensions-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/faye/websocket-extensions-ruby/compare/0.1.4...0.1.5) Signed-off-by: dependabot[bot] --- plugins/tenant/omu/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tenant/omu/Gemfile.lock b/plugins/tenant/omu/Gemfile.lock index 3b95d0d8d..668da54f3 100644 --- a/plugins/tenant/omu/Gemfile.lock +++ b/plugins/tenant/omu/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: ../../support specs: nokul-support (0.1.0) - activesupport (~> 6.0.0) + activesupport (>= 6.0.3.1) PATH remote: ../common @@ -144,7 +144,7 @@ GEM thread_safe (~> 0.1) websocket-driver (0.7.2) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.4) + websocket-extensions (0.1.5) zeitwerk (2.3.0) PLATFORMS From 947ce2a484b96a40675d30bf6fb445bff4258816 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 7 Jun 2020 06:01:30 +0000 Subject: [PATCH 889/970] chore(deps): bump websocket-extensions in /plugins/tenant/acme Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-ruby) from 0.1.4 to 0.1.5. - [Release notes](https://github.com/faye/websocket-extensions-ruby/releases) - [Changelog](https://github.com/faye/websocket-extensions-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/faye/websocket-extensions-ruby/compare/0.1.4...0.1.5) Signed-off-by: dependabot[bot] --- plugins/tenant/acme/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tenant/acme/Gemfile.lock b/plugins/tenant/acme/Gemfile.lock index 3e95a5084..941b9b1cd 100644 --- a/plugins/tenant/acme/Gemfile.lock +++ b/plugins/tenant/acme/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: ../../support specs: nokul-support (0.1.0) - activesupport (~> 6.0.0) + activesupport (>= 6.0.3.1) PATH remote: ../common @@ -144,7 +144,7 @@ GEM thread_safe (~> 0.1) websocket-driver (0.7.2) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.4) + websocket-extensions (0.1.5) zeitwerk (2.3.0) PLATFORMS From aa43e0e89c13184a1e033a294320893109411ea0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 7 Jun 2020 06:02:19 +0000 Subject: [PATCH 890/970] chore(deps): bump websocket-extensions in /plugins/support Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-ruby) from 0.1.4 to 0.1.5. - [Release notes](https://github.com/faye/websocket-extensions-ruby/releases) - [Changelog](https://github.com/faye/websocket-extensions-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/faye/websocket-extensions-ruby/compare/0.1.4...0.1.5) Signed-off-by: dependabot[bot] --- plugins/support/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/support/Gemfile.lock b/plugins/support/Gemfile.lock index 074f002e4..9e29c153d 100644 --- a/plugins/support/Gemfile.lock +++ b/plugins/support/Gemfile.lock @@ -130,7 +130,7 @@ GEM thread_safe (~> 0.1) websocket-driver (0.7.2) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.4) + websocket-extensions (0.1.5) zeitwerk (2.3.0) PLATFORMS From 432430f0097983c26d4ed7c5cbfdfbcb600ca3da Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 7 Jun 2020 06:03:17 +0000 Subject: [PATCH 891/970] chore(deps): bump websocket-extensions from 0.1.3 to 0.1.4 Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4. - [Release notes](https://github.com/faye/websocket-extensions-node/releases) - [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md) - [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index bfa4c5ea7..fed86fca1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8705,9 +8705,9 @@ websocket-driver@>=0.5.1: websocket-extensions ">=0.1.1" websocket-extensions@>=0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29" - integrity sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg== + version "0.1.4" + resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" + integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== which-module@^1.0.0: version "1.0.0" From cd66ec641951db9859d8d530cf40a035665d75e7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:30:17 +0000 Subject: [PATCH 892/970] chore(deps): bump connection_pool from 2.2.2 to 2.2.3 Bumps [connection_pool](https://github.com/mperham/connection_pool) from 2.2.2 to 2.2.3. - [Release notes](https://github.com/mperham/connection_pool/releases) - [Changelog](https://github.com/mperham/connection_pool/blob/master/Changes.md) - [Commits](https://github.com/mperham/connection_pool/compare/v2.2.2...v2.2.3) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 01c8ef7f6..f00981ffe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -146,7 +146,7 @@ GEM simplecov coderay (1.1.3) concurrent-ruby (1.1.6) - connection_pool (2.2.2) + connection_pool (2.2.3) crack (0.4.3) safe_yaml (~> 1.0.0) crass (1.0.6) From 2ffc110435108fd8844aee21b96f2040792aa59e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:30:49 +0000 Subject: [PATCH 893/970] chore(deps-dev): bump rack-mini-profiler from 2.0.1 to 2.0.2 Bumps [rack-mini-profiler](https://github.com/MiniProfiler/rack-mini-profiler) from 2.0.1 to 2.0.2. - [Release notes](https://github.com/MiniProfiler/rack-mini-profiler/releases) - [Changelog](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/CHANGELOG.md) - [Commits](https://github.com/MiniProfiler/rack-mini-profiler/compare/v2.0.1...v2.0.2) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 01c8ef7f6..752d294d4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -285,7 +285,7 @@ GEM rack (2.2.2) rack-attack (6.3.1) rack (>= 1.0, < 3) - rack-mini-profiler (2.0.1) + rack-mini-profiler (2.0.2) rack (>= 1.2.0) rack-oauth2 (1.14.0) activesupport From 3f92dd9de0326289e3ea8d7d8df10144f5d76493 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:31:27 +0000 Subject: [PATCH 894/970] chore(deps): bump omniauth_openid_connect from 0.3.4 to 0.3.5 Bumps [omniauth_openid_connect](https://github.com/m0n9oose/omniauth_openid_connect) from 0.3.4 to 0.3.5. - [Release notes](https://github.com/m0n9oose/omniauth_openid_connect/releases) - [Changelog](https://github.com/m0n9oose/omniauth_openid_connect/blob/master/CHANGELOG.md) - [Commits](https://github.com/m0n9oose/omniauth_openid_connect/compare/v0.3.4...v0.3.5) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 01c8ef7f6..193a6dcbf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -192,7 +192,7 @@ GEM hashie (4.1.0) html_tokenizer (0.0.7) httpclient (2.8.3) - i18n (1.8.2) + i18n (1.8.3) concurrent-ruby (~> 1.0) image_processing (1.11.0) mini_magick (>= 4.9.5, < 5) @@ -245,7 +245,7 @@ GEM omniauth (1.9.1) hashie (>= 3.4.6) rack (>= 1.6.2, < 3) - omniauth_openid_connect (0.3.4) + omniauth_openid_connect (0.3.5) addressable (~> 2.5) omniauth (~> 1.9) openid_connect (~> 1.1) From ba6c2813b58f15581ca84fab9a26d69f4aea4ae9 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:31:58 +0000 Subject: [PATCH 895/970] chore(deps): bump sassc from 2.3.0 to 2.4.0 Bumps [sassc](https://github.com/sass/sassc-ruby) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/sass/sassc-ruby/releases) - [Changelog](https://github.com/sass/sassc-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/sass/sassc-ruby/compare/v2.3.0...v2.4.0) Signed-off-by: dependabot-preview[bot] --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index d8e22b1bb..4d04157d7 100644 --- a/Gemfile +++ b/Gemfile @@ -39,7 +39,7 @@ gem 'net-ldap' # assets: core asset dependencies # TODO: The following line should be removed when sassc-rails has the latest version of sassc. -gem 'sassc', '~> 2.3.0' +gem 'sassc', '~> 2.4.0' gem 'sassc-rails', '>= 2.1.2' gem 'uglifier', '>= 1.3.0' diff --git a/Gemfile.lock b/Gemfile.lock index 01c8ef7f6..f0d2ed066 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -174,7 +174,7 @@ GEM execjs (2.7.0) faraday (1.0.1) multipart-post (>= 1.2, < 3) - ffi (1.12.2) + ffi (1.13.0) fit-commit (3.8.1) swearjar (~> 1.3) font-awesome-rails (4.7.0.5) @@ -365,7 +365,7 @@ GEM ffi (~> 1.9) rubyzip (2.3.0) safe_yaml (1.0.5) - sassc (2.3.0) + sassc (2.4.0) ffi (~> 1.9) sassc-rails (2.1.2) railties (>= 4.0.0) @@ -523,7 +523,7 @@ DEPENDENCIES rubocop-rails (>= 2.5.2) ruby-progressbar ruby-vips (~> 2.0.17) - sassc (~> 2.3.0) + sassc (~> 2.4.0) sassc-rails (>= 2.1.2) sidekiq sidekiq-cron From 98e99c11cbddf02aac231b56601bc61415f0aafc Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:32:28 +0000 Subject: [PATCH 896/970] chore(deps): bump aws-sdk-core from 3.97.0 to 3.98.0 Bumps [aws-sdk-core](https://github.com/aws/aws-sdk-ruby) from 3.97.0 to 3.98.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-core/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 01c8ef7f6..a2028c004 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,8 +94,8 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.1.0) - aws-partitions (1.322.0) - aws-sdk-core (3.97.0) + aws-partitions (1.326.0) + aws-sdk-core (3.98.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) From 491511c0874782d332c5d7a906b457c3f6da8144 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:32:57 +0000 Subject: [PATCH 897/970] chore(deps): bump aws-sdk-kms from 1.32.0 to 1.33.0 Bumps [aws-sdk-kms](https://github.com/aws/aws-sdk-ruby) from 1.32.0 to 1.33.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-kms/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/compare/v1.32.0...v1.33.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 01c8ef7f6..8207d47dc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,13 +94,13 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.1.0) - aws-partitions (1.322.0) - aws-sdk-core (3.97.0) + aws-partitions (1.326.0) + aws-sdk-core (3.98.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.32.0) + aws-sdk-kms (1.33.0) aws-sdk-core (~> 3, >= 3.71.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.67.0) From 6eab355474992fbe39ec7706547530131d7520af Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:33:33 +0000 Subject: [PATCH 898/970] chore(deps): bump aws-sdk-s3 from 1.67.0 to 1.67.1 Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.67.0 to 1.67.1. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 01c8ef7f6..ce046a93c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,16 +94,16 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.1.0) - aws-partitions (1.322.0) - aws-sdk-core (3.97.0) + aws-partitions (1.326.0) + aws-sdk-core (3.98.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.32.0) + aws-sdk-kms (1.33.0) aws-sdk-core (~> 3, >= 3.71.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.67.0) + aws-sdk-s3 (1.67.1) aws-sdk-core (~> 3, >= 3.96.1) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) From 071f0d516c133d3be94eea211ba7bf216f924dc1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:33:57 +0000 Subject: [PATCH 899/970] chore(deps): bump fugit from 1.3.5 to 1.3.6 Bumps [fugit](https://github.com/floraison/fugit) from 1.3.5 to 1.3.6. - [Release notes](https://github.com/floraison/fugit/releases) - [Changelog](https://github.com/floraison/fugit/blob/master/CHANGELOG.md) - [Commits](https://github.com/floraison/fugit/compare/v1.3.5...v1.3.6) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 01c8ef7f6..73f02c529 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -181,9 +181,9 @@ GEM railties (>= 3.2, < 6.1) friendly_id (5.3.0) activerecord (>= 4.0.0) - fugit (1.3.5) + fugit (1.3.6) et-orbi (~> 1.1, >= 1.1.8) - raabro (~> 1.1) + raabro (~> 1.3) globalid (0.4.2) activesupport (>= 4.2.0) groupdate (5.0.0) From ceffc902df9132f5e0a4deb08a3d43a787de908a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:34:29 +0000 Subject: [PATCH 900/970] chore(deps): bump ffi from 1.12.2 to 1.13.0 Bumps [ffi](https://github.com/ffi/ffi) from 1.12.2 to 1.13.0. - [Release notes](https://github.com/ffi/ffi/releases) - [Changelog](https://github.com/ffi/ffi/blob/master/CHANGELOG.md) - [Commits](https://github.com/ffi/ffi/compare/1.12.2...1.13.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 01c8ef7f6..54c0016d3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -174,7 +174,7 @@ GEM execjs (2.7.0) faraday (1.0.1) multipart-post (>= 1.2, < 3) - ffi (1.12.2) + ffi (1.13.0) fit-commit (3.8.1) swearjar (~> 1.3) font-awesome-rails (4.7.0.5) From 73eacf27083698c57f4943bfc49f0b96a2fa8dd0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:34:57 +0000 Subject: [PATCH 901/970] chore(deps): bump regexp_parser from 1.7.0 to 1.7.1 Bumps [regexp_parser](https://github.com/ammar/regexp_parser) from 1.7.0 to 1.7.1. - [Release notes](https://github.com/ammar/regexp_parser/releases) - [Changelog](https://github.com/ammar/regexp_parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/ammar/regexp_parser/compare/v1.7.0...v1.7.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 01c8ef7f6..00593cb70 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -331,7 +331,7 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) redis (4.1.4) - regexp_parser (1.7.0) + regexp_parser (1.7.1) rein (5.1.0) activerecord (>= 4.0.0) activesupport (>= 4.0.0) From 20c53b475a6172c7d53d9793f494f0ead126fa96 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:47:12 +0000 Subject: [PATCH 902/970] chore(deps): bump browserify-sign from 4.1.0 to 4.2.0 Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.1.0 to 4.2.0. - [Release notes](https://github.com/crypto-browserify/browserify-sign/releases) - [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.1.0...v4.2.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index fed86fca1..c6125f683 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1609,14 +1609,14 @@ bluebird@^3.5.5: integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.4.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== + version "4.11.9" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" + integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw== bn.js@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.1.tgz#48efc4031a9c4041b9c99c6941d903463ab62eb5" - integrity sha512-IUTD/REb78Z2eodka1QZyyEk66pciRcP6Sroka0aI3tG/iwIdYLrBD62RsubR7vqdt3WyX8p4jxeatzmRSphtA== + version "5.1.2" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.2.tgz#c9686902d3c9a27729f43ab10f9d79c2004da7b0" + integrity sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA== body-parser@1.19.0: version "1.19.0" @@ -1727,9 +1727,9 @@ browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: randombytes "^2.0.1" browserify-sign@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.1.0.tgz#4fe971b379a5aeb4925e06779f9fa1f41d249d70" - integrity sha512-VYxo7cDCeYUoBZ0ZCy4UyEUCP3smyBd4DRQM5nrFS1jJjPJjX7rP3oLRpPoWfkhQfyJ0I9ZbHbKafrFD/SGlrg== + version "4.2.0" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.0.tgz#545d0b1b07e6b2c99211082bf1b12cce7a0b0e11" + integrity sha512-hEZC1KEeYuoHRqhGhTy6gWrpJA3ZDjFWv0DE61643ZnOXAKJb3u7yWcrU0mMc9SwAqK1n7myPGndkp0dFG7NFA== dependencies: bn.js "^5.1.1" browserify-rsa "^4.0.1" @@ -1739,6 +1739,7 @@ browserify-sign@^4.0.0: inherits "^2.0.4" parse-asn1 "^5.1.5" readable-stream "^3.6.0" + safe-buffer "^5.2.0" browserify-zlib@^0.2.0: version "0.2.0" @@ -6061,9 +6062,9 @@ path-type@^4.0.0: integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== pbkdf2@^3.0.3: - version "3.0.17" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" - integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== + version "3.1.1" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.1.tgz#cb8724b0fada984596856d1a6ebafd3584654b94" + integrity sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg== dependencies: create-hash "^1.1.2" create-hmac "^1.1.4" @@ -7366,12 +7367,7 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@>=5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" - integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== - -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: +safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== From 5ee6c059a7827e88f753949a784ca2578f56a70e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:47:36 +0000 Subject: [PATCH 903/970] chore(deps): bump http-proxy from 1.18.0 to 1.18.1 Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.18.0 to 1.18.1. - [Release notes](https://github.com/http-party/node-http-proxy/releases) - [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md) - [Commits](https://github.com/http-party/node-http-proxy/compare/1.18.0...1.18.1) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index fed86fca1..6836b0eee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3580,9 +3580,9 @@ flush-write-stream@^1.0.0: readable-stream "^2.3.6" follow-redirects@^1.0.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.10.0.tgz#01f5263aee921c6a54fb91667f08f4155ce169eb" - integrity sha512-4eyLK6s6lH32nOvLLwlIOnr9zrL8Sm+OvW4pVTJNoXeGzYIkHVf+pADQi+OJ0E67hiuSLezPVPyBcIZO50TmmQ== + version "1.11.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.11.0.tgz#afa14f08ba12a52963140fe43212658897bc0ecb" + integrity sha512-KZm0V+ll8PfBrKwMzdo5D13b1bur9Iq9Zd/RMmAoQQcl2PxxFml8cxXPaaPYVbV0RjNjq1CU7zIzAOqtUPudmA== dependencies: debug "^3.0.0" @@ -4132,9 +4132,9 @@ http-proxy-middleware@0.19.1: micromatch "^3.1.10" http-proxy@^1.17.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.0.tgz#dbe55f63e75a347db7f3d99974f2692a314a6a3a" - integrity sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ== + version "1.18.1" + resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" + integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== dependencies: eventemitter3 "^4.0.0" follow-redirects "^1.0.0" From ceb8effd386e237f63353941d54cb85fee2b93a7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:49:17 +0000 Subject: [PATCH 904/970] chore(deps): bump compressible from 2.0.17 to 2.0.18 Bumps [compressible](https://github.com/jshttp/compressible) from 2.0.17 to 2.0.18. - [Release notes](https://github.com/jshttp/compressible/releases) - [Changelog](https://github.com/jshttp/compressible/blob/master/HISTORY.md) - [Commits](https://github.com/jshttp/compressible/compare/v2.0.17...v2.0.18) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index fed86fca1..822f88597 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2216,11 +2216,11 @@ component-emitter@^1.2.1: integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== compressible@~2.0.16: - version "2.0.17" - resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.17.tgz#6e8c108a16ad58384a977f3a482ca20bff2f38c1" - integrity sha512-BGHeLCK1GV7j1bSmQQAi26X+GgWcTjLr/0tzSvMCl3LH1w1IJ4PFSPoV5316b30cneTziC+B1a+3OjoSUcQYmw== + version "2.0.18" + resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" + integrity sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg== dependencies: - mime-db ">= 1.40.0 < 2" + mime-db ">= 1.43.0 < 2" compression-webpack-plugin@^3.1.0: version "3.1.0" @@ -5240,12 +5240,12 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@1.43.0, "mime-db@>= 1.40.0 < 2": +mime-db@1.43.0: version "1.43.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ== -mime-db@1.44.0: +mime-db@1.44.0, "mime-db@>= 1.43.0 < 2": version "1.44.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== From 2423b39645847ed4bf3ebdf876cbaf79d72dcf79 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:50:20 +0000 Subject: [PATCH 905/970] chore(deps): bump postcss-flexbugs-fixes from 4.2.0 to 4.2.1 Bumps [postcss-flexbugs-fixes](https://github.com/luisrudge/postcss-flexbugs-fixes) from 4.2.0 to 4.2.1. - [Release notes](https://github.com/luisrudge/postcss-flexbugs-fixes/releases) - [Changelog](https://github.com/luisrudge/postcss-flexbugs-fixes/blob/master/CHANGELOG.md) - [Commits](https://github.com/luisrudge/postcss-flexbugs-fixes/commits) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index fed86fca1..32de03b15 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6311,9 +6311,9 @@ postcss-env-function@^2.0.2: postcss-values-parser "^2.0.0" postcss-flexbugs-fixes@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-4.2.0.tgz#662b3dcb6354638b9213a55eed8913bcdc8d004a" - integrity sha512-QRE0n3hpkxxS/OGvzOa+PDuy4mh/Jg4o9ui22/ko5iGYOG3M5dfJabjnAZjTdh2G9F85c7Hv8hWcEDEKW/xceQ== + version "4.2.1" + resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-4.2.1.tgz#9218a65249f30897deab1033aced8578562a6690" + integrity sha512-9SiofaZ9CWpQWxOwRh1b/r85KD5y7GgvsNt1056k6OYLvWUun0czCvogfJgylC22uJTwW1KzY3Gz65NZRlvoiQ== dependencies: postcss "^7.0.26" @@ -6793,9 +6793,9 @@ postcss-values-parser@^2.0.0, postcss-values-parser@^2.0.1: uniq "^1.0.1" postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.30, postcss@^7.0.5, postcss@^7.0.6: - version "7.0.31" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.31.tgz#332af45cb73e26c0ee2614d7c7fb02dfcc2bd6dd" - integrity sha512-a937VDHE1ftkjk+8/7nj/mrjtmkn69xxzJgRETXdAUU+IgOYPQNJF17haGWbeDxSyk++HA14UA98FurvPyBJOA== + version "7.0.32" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.32.tgz#4310d6ee347053da3433db2be492883d62cec59d" + integrity sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw== dependencies: chalk "^2.4.2" source-map "^0.6.1" From d06d9272bb1ae5f058f9cf07303cfd6e864ef55d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2020 00:52:13 +0000 Subject: [PATCH 906/970] chore(deps): bump @rails/actioncable from 6.0.2 to 6.0.3 Bumps [@rails/actioncable](https://github.com/rails/rails) from 6.0.2 to 6.0.3. - [Release notes](https://github.com/rails/rails/releases) - [Commits](https://github.com/rails/rails/compare/v6.0.2...v6.0.3) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4ac0b8511..9a43c10ae 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "dependencies": { "@coreui/coreui-free-bootstrap-admin-template": "https://github.com/coreui/coreui-free-bootstrap-admin-template.git#master", - "@rails/actioncable": "^6.0.0-alpha", + "@rails/actioncable": "^6.0.3", "@rails/actiontext": "^6.0.2", "@rails/activestorage": "^6.0.0-alpha", "@rails/ujs": "^6.0.1", diff --git a/yarn.lock b/yarn.lock index fed86fca1..9d3af86a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -880,10 +880,10 @@ resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.4.0.tgz#0e1bdf8d021e7ea58affade33d9d607e11365915" integrity sha512-NMrDy6EWh9TPdSRiHmHH2ye1v5U0gBD7pRYwSwJvomx7Bm4GG04vu63dYiVzebLOx2obPpJugew06xVP0Nk7hA== -"@rails/actioncable@^6.0.0-alpha": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-6.0.2.tgz#bcba9bcd6ee09a47c6628336e07399a68ca87814" - integrity sha512-vN78gohsXPlC5jxBHlmiwkUI9bv6SulcZaE72kAIg/G4ou+wTdiMWPJK1bf2IxUNf+sfOjhl+tbRmY4AzJcgrw== +"@rails/actioncable@^6.0.3": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-6.0.3.tgz#722b4b639936129307ddbab3a390f6bcacf3e7bc" + integrity sha512-I01hgqxxnOgOtJTGlq0ZsGJYiTEEiSGVEGQn3vimZSqEP1HqzyFNbzGTq14Xdyeow2yGJjygjoFF1pmtE+SQaw== "@rails/actiontext@^6.0.2": version "6.0.2" From 13cb885fd16172c6efca5cf1dc915916fdfb1546 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 11 Jun 2020 14:41:57 +0300 Subject: [PATCH 907/970] Change integer values of location enum --- app/models/academic_credential.rb | 2 +- app/models/education_information.rb | 2 +- test/fixtures/academic_credentials.yml | 5 +---- test/models/academic_credential_test.rb | 2 +- test/models/education_information_test.rb | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/models/academic_credential.rb b/app/models/academic_credential.rb index f9beda6be..f52c1b481 100644 --- a/app/models/academic_credential.rb +++ b/app/models/academic_credential.rb @@ -3,7 +3,7 @@ class AcademicCredential < ApplicationRecord # enums enum activity: { deleted: 0, active: 1 } - enum location: { domestic: 0, abroad: 1 } + enum location: { domestic: 1, abroad: 2 } enum status: { full_time: 0, part_time: 1 } # relations diff --git a/app/models/education_information.rb b/app/models/education_information.rb index e9ab5316b..c2f3271d0 100644 --- a/app/models/education_information.rb +++ b/app/models/education_information.rb @@ -3,7 +3,7 @@ class EducationInformation < ApplicationRecord # enums enum activity: { deleted: 0, active: 1 } - enum location: { domestic: 0, abroad: 1 } + enum location: { domestic: 1, abroad: 2 } # relations belongs_to :user diff --git a/test/fixtures/academic_credentials.yml b/test/fixtures/academic_credentials.yml index 32bed2e9a..84fbc2c1b 100644 --- a/test/fixtures/academic_credentials.yml +++ b/test/fixtures/academic_credentials.yml @@ -1,12 +1,9 @@ one: activity: 1 country_id: turkey - department: - discipline: - end_year: faculty: Ziraat Fakültesi last_update: <%= Time.zone.now + 2.years %> - location: 0 + location: domestic profession_name: Bitki Koruma scientific_field: Bitki Koruma start_year: 2016 diff --git a/test/models/academic_credential_test.rb b/test/models/academic_credential_test.rb index 5cfac2b91..5f47a1ae0 100644 --- a/test/models/academic_credential_test.rb +++ b/test/models/academic_credential_test.rb @@ -13,7 +13,7 @@ class AcademicCredentialTest < ActiveSupport::TestCase # enums enum activity: { deleted: 0, active: 1 } - enum location: { domestic: 0, abroad: 1 } + enum location: { domestic: 1, abroad: 2 } enum status: { full_time: 0, part_time: 1 } # validations: presence diff --git a/test/models/education_information_test.rb b/test/models/education_information_test.rb index 7d3bb66cd..38c108450 100644 --- a/test/models/education_information_test.rb +++ b/test/models/education_information_test.rb @@ -13,7 +13,7 @@ class EducationInformationTest < ActiveSupport::TestCase # enums enum activity: { deleted: 0, active: 1 } - enum location: { domestic: 0, abroad: 1 } + enum location: { domestic: 1, abroad: 2 } # validations: presence validates_presence_of :location From 7a094d5e2451cfc4bd344c367d202febd7d1b329 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 11 Jun 2020 14:54:13 +0300 Subject: [PATCH 908/970] Use passive instead of deleted --- app/models/academic_credential.rb | 2 +- app/models/article.rb | 2 +- app/models/book.rb | 2 +- app/models/education_information.rb | 2 +- app/models/paper.rb | 2 +- test/fixtures/academic_credentials.yml | 4 ++-- test/fixtures/education_informations.yml | 10 ---------- test/models/academic_credential_test.rb | 2 +- test/models/article_test.rb | 2 +- test/models/book_test.rb | 2 +- test/models/education_information_test.rb | 2 +- test/models/paper_test.rb | 2 +- 12 files changed, 12 insertions(+), 22 deletions(-) diff --git a/app/models/academic_credential.rb b/app/models/academic_credential.rb index f52c1b481..79d5d6a19 100644 --- a/app/models/academic_credential.rb +++ b/app/models/academic_credential.rb @@ -2,7 +2,7 @@ class AcademicCredential < ApplicationRecord # enums - enum activity: { deleted: 0, active: 1 } + enum activity: { passive: 0, active: 1 } enum location: { domestic: 1, abroad: 2 } enum status: { full_time: 0, part_time: 1 } diff --git a/app/models/article.rb b/app/models/article.rb index 21801fd4b..9dccb86a1 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -7,7 +7,7 @@ class Article < ApplicationRecord enum scope: { national: 0, international: 1 } enum review: { reviewed: 0, unreviewed: 1 } enum access_type: { printed: 1, electronic: 2, printed_and_electronic: 3 } - enum status: { deleted: 0, active: 1 } + enum status: { passive: 0, active: 1 } enum index: { ssci: 5, diff --git a/app/models/book.rb b/app/models/book.rb index dba8d5e2d..8f46517a7 100644 --- a/app/models/book.rb +++ b/app/models/book.rb @@ -4,7 +4,7 @@ class Book < ApplicationRecord self.inheritance_column = nil # enums - enum activity: { deleted: 0, active: 1 } + enum activity: { passive: 0, active: 1 } enum contribution_rate: { all_of: 0, chapters: 1 } enum scope: { national: 0, international: 1 } enum type: { diff --git a/app/models/education_information.rb b/app/models/education_information.rb index c2f3271d0..16a020343 100644 --- a/app/models/education_information.rb +++ b/app/models/education_information.rb @@ -2,7 +2,7 @@ class EducationInformation < ApplicationRecord # enums - enum activity: { deleted: 0, active: 1 } + enum activity: { passive: 0, active: 1 } enum location: { domestic: 1, abroad: 2 } # relations diff --git a/app/models/paper.rb b/app/models/paper.rb index aa573d68b..0979931c0 100644 --- a/app/models/paper.rb +++ b/app/models/paper.rb @@ -4,7 +4,7 @@ class Paper < ApplicationRecord self.inheritance_column = nil # enums - enum activity: { deleted: 0, active: 1 } + enum activity: { passive: 0, active: 1 } enum presentation_type: { verbal: 33, guest_speaker: 39, poster: 38 } enum publication_status: { unpublished: 0, published: 1, accepted: 2 } enum scope: { national: 0, international: 1 } diff --git a/test/fixtures/academic_credentials.yml b/test/fixtures/academic_credentials.yml index 84fbc2c1b..07c87c824 100644 --- a/test/fixtures/academic_credentials.yml +++ b/test/fixtures/academic_credentials.yml @@ -1,5 +1,5 @@ one: - activity: 1 + activity: active country_id: turkey faculty: Ziraat Fakültesi last_update: <%= Time.zone.now + 2.years %> @@ -7,7 +7,7 @@ one: profession_name: Bitki Koruma scientific_field: Bitki Koruma start_year: 2016 - status: 0 + status: full_time title: Profesör unit_id: 122258 university: Ondokuz Mayıs Üniversitesi diff --git a/test/fixtures/education_informations.yml b/test/fixtures/education_informations.yml index 567a03311..d23a5a84c 100644 --- a/test/fixtures/education_informations.yml +++ b/test/fixtures/education_informations.yml @@ -1,24 +1,14 @@ one: activity: active - advisor: - advisor_id_number: country: turkey department: Bitki Koruma Bölümü - diploma_equivalency: - diploma_no: discipline: Bitki Koruma Pr. end_year: 1992 - end_date_of_thesis: faculty: Ziraat Fakültesi last_update: Tue, 26 Nov 2013 19:26:35 EET +02:00 location: abroad - other_discipline: - other_university: program: Lisans start_year: 1988 - start_date_of_thesis: - thesis_name: - thesis_step: user: mine unit_id: 145105 university: Çukurova Üniversitesi diff --git a/test/models/academic_credential_test.rb b/test/models/academic_credential_test.rb index 5f47a1ae0..d1748dbdc 100644 --- a/test/models/academic_credential_test.rb +++ b/test/models/academic_credential_test.rb @@ -12,7 +12,7 @@ class AcademicCredentialTest < ActiveSupport::TestCase belongs_to :country, optional: true # enums - enum activity: { deleted: 0, active: 1 } + enum activity: { passive: 0, active: 1 } enum location: { domestic: 1, abroad: 2 } enum status: { full_time: 0, part_time: 1 } diff --git a/test/models/article_test.rb b/test/models/article_test.rb index daa46eeaf..dfb4e0344 100644 --- a/test/models/article_test.rb +++ b/test/models/article_test.rb @@ -14,7 +14,7 @@ class ArticleTest < ActiveSupport::TestCase enum scope: { national: 0, international: 1 } enum review: { reviewed: 0, unreviewed: 1 } enum access_type: { printed: 1, electronic: 2, printed_and_electronic: 3 } - enum status: { deleted: 0, active: 1 } + enum status: { passive: 0, active: 1 } enum index: { ssci: 5, diff --git a/test/models/book_test.rb b/test/models/book_test.rb index 6fa671bd1..7d0159208 100644 --- a/test/models/book_test.rb +++ b/test/models/book_test.rb @@ -12,7 +12,7 @@ class BookTest < ActiveSupport::TestCase belongs_to :country, optional: true # enums - enum activity: { deleted: 0, active: 1 } + enum activity: { passive: 0, active: 1 } enum contribution_rate: { all_of: 0, chapters: 1 } enum scope: { national: 0, international: 1 } enum type: { diff --git a/test/models/education_information_test.rb b/test/models/education_information_test.rb index 38c108450..65644e212 100644 --- a/test/models/education_information_test.rb +++ b/test/models/education_information_test.rb @@ -12,7 +12,7 @@ class EducationInformationTest < ActiveSupport::TestCase belongs_to :country, optional: true # enums - enum activity: { deleted: 0, active: 1 } + enum activity: { passive: 0, active: 1 } enum location: { domestic: 1, abroad: 2 } # validations: presence diff --git a/test/models/paper_test.rb b/test/models/paper_test.rb index b7a9841fa..389e3bca4 100644 --- a/test/models/paper_test.rb +++ b/test/models/paper_test.rb @@ -12,7 +12,7 @@ class PaperTest < ActiveSupport::TestCase belongs_to :country, optional: true # enums - enum activity: { deleted: 0, active: 1 } + enum activity: { passive: 0, active: 1 } enum presentation_type: { verbal: 33, guest_speaker: 39, poster: 38 } enum publication_status: { unpublished: 0, published: 1, accepted: 2 } enum scope: { national: 0, international: 1 } From 51c955a4db8d918d1611f38172bbfa32f8f5ed77 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Fri, 12 Jun 2020 00:36:54 +0000 Subject: [PATCH 909/970] fix: package.json & yarn.lock to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-HIGHCHARTS-571995 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9a43c10ae..87dc5ca71 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "chalk": "^3.0.0", "echarts": "^4.5.0", "flatpickr": "^4.6.3", - "highcharts": "^8.0.4", + "highcharts": "^8.1.1", "intl-tel-input": "^17.0.0", "jquery.maskedinput": "^1.4.1", "select2": "^4.0.13", diff --git a/yarn.lock b/yarn.lock index 90d9b8438..542ac57e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3995,10 +3995,10 @@ hex-color-regex@^1.1.0: resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== -highcharts@^8.0.4: - version "8.0.4" - resolved "https://registry.yarnpkg.com/highcharts/-/highcharts-8.0.4.tgz#a717434012bd5f9b82b94b737d62acec501d360c" - integrity sha512-RD86/w7VNwuY96c2Pv16dtZujJ4vg5viiVjbFF/TCrvFpmtQRzBIECG90ww0JtiK6+6TKlwCYf0an+kgQshnRw== +highcharts@^8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/highcharts/-/highcharts-8.1.1.tgz#7dc011e260289ab64d775807df0d13b85ed88338" + integrity sha512-DSkI+fAqkqYDslOVLcEk8DX7W9itRIwzsdS0uVEOnVf0LF1hSKZtDINHP7ze/uBN9NdWQV9HydtiPTrkLx0lXg== hmac-drbg@^1.0.0: version "1.0.1" From 21acbefa1cb5d2eaea6636240ea386b355e81547 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:30:00 +0000 Subject: [PATCH 910/970] chore(deps): bump aws-sdk-s3 from 1.67.1 to 1.68.1 Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.67.1 to 1.68.1. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b60063a71..5d2b27e02 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,17 +94,17 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.1.0) - aws-partitions (1.326.0) - aws-sdk-core (3.98.0) + aws-partitions (1.329.0) + aws-sdk-core (3.99.2) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.33.0) - aws-sdk-core (~> 3, >= 3.71.0) + aws-sdk-kms (1.34.1) + aws-sdk-core (~> 3, >= 3.99.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.67.1) - aws-sdk-core (~> 3, >= 3.96.1) + aws-sdk-s3 (1.68.1) + aws-sdk-core (~> 3, >= 3.99.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) aws-sigv4 (1.1.4) From 5c69f7bbca635d106995698b60fdcf7ecd3fca15 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:30:30 +0000 Subject: [PATCH 911/970] chore(deps): bump ffi from 1.13.0 to 1.13.1 Bumps [ffi](https://github.com/ffi/ffi) from 1.13.0 to 1.13.1. - [Release notes](https://github.com/ffi/ffi/releases) - [Changelog](https://github.com/ffi/ffi/blob/master/CHANGELOG.md) - [Commits](https://github.com/ffi/ffi/compare/1.13.0...1.13.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b60063a71..05d0b2740 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -174,7 +174,7 @@ GEM execjs (2.7.0) faraday (1.0.1) multipart-post (>= 1.2, < 3) - ffi (1.13.0) + ffi (1.13.1) fit-commit (3.8.1) swearjar (~> 1.3) font-awesome-rails (4.7.0.5) From 08ac98f4d5bcb4837b7f17324ac76a0ba07f1801 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:31:05 +0000 Subject: [PATCH 912/970] chore(deps-dev): bump bundler-audit from 0.6.1 to 0.7.0.1 Bumps [bundler-audit](https://github.com/postmodern/bundler-audit) from 0.6.1 to 0.7.0.1. - [Release notes](https://github.com/postmodern/bundler-audit/releases) - [Changelog](https://github.com/rubysec/bundler-audit/blob/master/ChangeLog.md) - [Commits](https://github.com/postmodern/bundler-audit/compare/v0.6.1...v0.7.0.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b60063a71..4a8374773 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -127,9 +127,9 @@ GEM bullet (6.1.0) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) - bundler-audit (0.6.1) + bundler-audit (0.7.0.1) bundler (>= 1.2.0, < 3) - thor (~> 0.18) + thor (>= 0.18, < 2) byebug (11.1.3) capybara (3.32.2) addressable @@ -411,7 +411,7 @@ GEM httpclient (>= 2.4) swearjar (1.3.1) telephone_number (1.4.7) - thor (0.20.3) + thor (1.0.1) thread_safe (0.3.6) tilt (2.0.10) twilio-ruby (5.36.0) From 1d255e748f6059bc736cc1a5f94918e747535539 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:31:40 +0000 Subject: [PATCH 913/970] chore(deps-dev): bump minitest-focus from 1.2.0 to 1.2.1 Bumps [minitest-focus](https://github.com/seattlerb/minitest-focus) from 1.2.0 to 1.2.1. - [Release notes](https://github.com/seattlerb/minitest-focus/releases) - [Changelog](https://github.com/seattlerb/minitest-focus/blob/master/History.txt) - [Commits](https://github.com/seattlerb/minitest-focus/compare/v1.2.0...v1.2.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b60063a71..1d6ff84cc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -234,7 +234,7 @@ GEM mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.14.1) - minitest-focus (1.2.0) + minitest-focus (1.2.1) minitest (>= 4, < 6) msgpack (1.3.3) multipart-post (2.1.1) From 8027c76f5e1079c19618d3c4c0b50553fef2102f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:32:08 +0000 Subject: [PATCH 914/970] chore(deps): bump sprockets from 4.0.0 to 4.0.2 Bumps [sprockets](https://github.com/rails/sprockets) from 4.0.0 to 4.0.2. - [Release notes](https://github.com/rails/sprockets/releases) - [Changelog](https://github.com/rails/sprockets/blob/master/CHANGELOG.md) - [Commits](https://github.com/rails/sprockets/compare/v4.0.0...v4.0.2) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b60063a71..74be9be52 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -398,7 +398,7 @@ GEM spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (4.0.0) + sprockets (4.0.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.1) From d2cbcefe0ab755720d24d167854bb9043a9887df Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:32:41 +0000 Subject: [PATCH 915/970] chore(deps): bump rollbar from 2.25.0 to 2.25.1 Bumps [rollbar](https://github.com/rollbar/rollbar-gem) from 2.25.0 to 2.25.1. - [Release notes](https://github.com/rollbar/rollbar-gem/releases) - [Changelog](https://github.com/rollbar/rollbar-gem/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollbar/rollbar-gem/compare/v2.25.0...v2.25.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b60063a71..7509e33de 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -341,7 +341,7 @@ GEM actionpack (>= 5.0) railties (>= 5.0) rexml (3.2.4) - rollbar (2.25.0) + rollbar (2.25.1) rubocop (0.84.0) parallel (~> 1.10) parser (>= 2.7.0.1) From 68a5b26ec94db828640d718c5cf76f392f8d269e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:33:08 +0000 Subject: [PATCH 916/970] chore(deps): bump aws-sdk-core from 3.98.0 to 3.99.2 Bumps [aws-sdk-core](https://github.com/aws/aws-sdk-ruby) from 3.98.0 to 3.99.2. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-core/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b60063a71..7d07b1401 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,8 +94,8 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.1.0) - aws-partitions (1.326.0) - aws-sdk-core (3.98.0) + aws-partitions (1.329.0) + aws-sdk-core (3.99.2) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) From 879b8a44dbd4c36f7c3298b79301736f31e77d9b Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:33:40 +0000 Subject: [PATCH 917/970] chore(deps): bump twilio-ruby from 5.36.0 to 5.37.0 Bumps [twilio-ruby](https://github.com/twilio/twilio-ruby) from 5.36.0 to 5.37.0. - [Release notes](https://github.com/twilio/twilio-ruby/releases) - [Changelog](https://github.com/twilio/twilio-ruby/blob/master/CHANGES.md) - [Commits](https://github.com/twilio/twilio-ruby/compare/5.36.0...5.37.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b60063a71..879baeaaf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -414,7 +414,7 @@ GEM thor (0.20.3) thread_safe (0.3.6) tilt (2.0.10) - twilio-ruby (5.36.0) + twilio-ruby (5.37.0) faraday (>= 0.9, < 2.0) jwt (>= 1.5, <= 2.5) nokogiri (>= 1.6, < 2.0) From 75961e065414a30f6c5e4c5b57cbeeedf7af1e17 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:34:07 +0000 Subject: [PATCH 918/970] chore(deps-dev): bump rubocop-performance from 1.6.0 to 1.6.1 Bumps [rubocop-performance](https://github.com/rubocop-hq/rubocop-performance) from 1.6.0 to 1.6.1. - [Release notes](https://github.com/rubocop-hq/rubocop-performance/releases) - [Changelog](https://github.com/rubocop-hq/rubocop-performance/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop-hq/rubocop-performance/compare/v1.6.0...v1.6.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b60063a71..7f381ecdd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -89,7 +89,7 @@ GEM aes_key_wrap (1.0.1) ancestry (3.0.7) activerecord (>= 3.2.0) - ast (2.4.0) + ast (2.4.1) attr_required (1.0.1) authy (2.7.5) httpclient (>= 2.5.3.3) @@ -354,7 +354,7 @@ GEM parser (>= 2.7.0.1) rubocop-minitest (0.9.0) rubocop (>= 0.74) - rubocop-performance (1.6.0) + rubocop-performance (1.6.1) rubocop (>= 0.71.0) rubocop-rails (2.5.2) activesupport From b5187ad419daf7d3f31c5b4409cba96e0886adf6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:34:36 +0000 Subject: [PATCH 919/970] chore(deps): bump aws-partitions from 1.326.0 to 1.329.0 Bumps [aws-partitions](https://github.com/aws/aws-sdk-ruby) from 1.326.0 to 1.329.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-partitions/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b60063a71..e12f407a9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,7 +94,7 @@ GEM authy (2.7.5) httpclient (>= 2.5.3.3) aws-eventstream (1.1.0) - aws-partitions (1.326.0) + aws-partitions (1.329.0) aws-sdk-core (3.98.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) From 96daef1c3f86f0457918c57d35c95e85b2eae7ce Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:47:41 +0000 Subject: [PATCH 920/970] chore(deps-dev): bump eslint-plugin-import from 2.20.2 to 2.21.2 Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.20.2 to 2.21.2. - [Release notes](https://github.com/benmosher/eslint-plugin-import/releases) - [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md) - [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.20.2...v2.21.2) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 48 ++++++++++++++++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 87dc5ca71..2d1c87fe6 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "babel-eslint": "^10.1.0", "eslint": "^6.7.2", "eslint-config-standard": "^14.1.1", - "eslint-plugin-import": "^2.20.2", + "eslint-plugin-import": "^2.21.2", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.0.1", "eslint-plugin-standard": "^4.0.0", diff --git a/yarn.lock b/yarn.lock index 542ac57e1..e00661ba7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -991,6 +991,11 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= + "@types/minimatch@*": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" @@ -1365,7 +1370,7 @@ array-flatten@^2.1.0: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== -array-includes@^3.0.3: +array-includes@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.1.tgz#cdd67e6852bdf9c1215460786732255ed2459348" integrity sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ== @@ -1391,7 +1396,7 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= -array.prototype.flat@^1.2.1: +array.prototype.flat@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz#0de82b426b0318dbfdb940089e38b043d37f6c7b" integrity sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ== @@ -3057,7 +3062,7 @@ eslint-config-standard@^14.1.1: resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz#830a8e44e7aef7de67464979ad06b406026c56ea" integrity sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg== -eslint-import-resolver-node@^0.3.2: +eslint-import-resolver-node@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.3.tgz#dbaa52b6b2816b50bc6711af75422de808e98404" integrity sha512-b8crLDo0M5RSe5YG8Pu2DYBj71tSB6OvXkfzwbJU2w7y8P4/yo0MyF8jU26IEuEuHF2K5/gcAJE3LhQGqBBbVg== @@ -3065,7 +3070,7 @@ eslint-import-resolver-node@^0.3.2: debug "^2.6.9" resolve "^1.13.1" -eslint-module-utils@^2.4.1: +eslint-module-utils@^2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz#579ebd094f56af7797d19c9866c9c9486629bfa6" integrity sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA== @@ -3081,23 +3086,24 @@ eslint-plugin-es@^3.0.0: eslint-utils "^2.0.0" regexpp "^3.0.0" -eslint-plugin-import@^2.20.2: - version "2.20.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.2.tgz#91fc3807ce08be4837141272c8b99073906e588d" - integrity sha512-FObidqpXrR8OnCh4iNsxy+WACztJLXAHBO5hK79T1Hc77PgQZkyDGA5Ag9xAvRpglvLNxhH/zSmZ70/pZ31dHg== +eslint-plugin-import@^2.21.2: + version "2.21.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.21.2.tgz#8fef77475cc5510801bedc95f84b932f7f334a7c" + integrity sha512-FEmxeGI6yaz+SnEB6YgNHlQK1Bs2DKLM+YF+vuTk5H8J9CLbJLtlPvRFgZZ2+sXiKAlN5dpdlrWOjK8ZoZJpQA== dependencies: - array-includes "^3.0.3" - array.prototype.flat "^1.2.1" + array-includes "^3.1.1" + array.prototype.flat "^1.2.3" contains-path "^0.1.0" debug "^2.6.9" doctrine "1.5.0" - eslint-import-resolver-node "^0.3.2" - eslint-module-utils "^2.4.1" + eslint-import-resolver-node "^0.3.3" + eslint-module-utils "^2.6.0" has "^1.0.3" minimatch "^3.0.4" - object.values "^1.1.0" + object.values "^1.1.1" read-pkg-up "^2.0.0" - resolve "^1.12.0" + resolve "^1.17.0" + tsconfig-paths "^3.9.0" eslint-plugin-node@^11.1.0: version "11.1.0" @@ -5695,7 +5701,7 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" -object.values@^1.1.0: +object.values@^1.1.0, object.values@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.1.tgz#68a99ecde356b7e9295a3c5e0ce31dc8c953de5e" integrity sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA== @@ -7286,7 +7292,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.3.2, resolve@^1.8.1: +resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.3.2, resolve@^1.8.1: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== @@ -8285,6 +8291,16 @@ ts-pnp@^1.1.6: resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92" integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw== +tsconfig-paths@^3.9.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz#098547a6c4448807e8fcb8eae081064ee9a3c90b" + integrity sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.0" + strip-bom "^3.0.0" + tslib@^1.9.0: version "1.13.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043" From 503d6af21f78afae63d2d78e93f96263f8e769fc Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:48:09 +0000 Subject: [PATCH 921/970] chore(deps): bump moment from 2.25.3 to 2.26.0 Bumps [moment](https://github.com/moment/moment) from 2.25.3 to 2.26.0. - [Release notes](https://github.com/moment/moment/releases) - [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) - [Commits](https://github.com/moment/moment/compare/2.25.3...2.26.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 542ac57e1..25058a1e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5372,9 +5372,9 @@ mixin-deep@^1.2.0: minimist "^1.2.5" moment@^2.10.2: - version "2.25.3" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.25.3.tgz#252ff41319cf41e47761a1a88cab30edfe9808c0" - integrity sha512-PuYv0PHxZvzc15Sp8ybUCoQ+xpyPWvjOuK72a5ovzp2LI32rJXOiIfyoFoYvG3s6EwwrdkMyWuRiEHSZRLJNdg== + version "2.26.0" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.26.0.tgz#5e1f82c6bafca6e83e808b30c8705eed0dcbd39a" + integrity sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw== move-concurrently@^1.0.1: version "1.0.1" From 93d3c3d631a2791dc1916f219ea085fe7d37c6e2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:49:03 +0000 Subject: [PATCH 922/970] chore(deps): bump jshint from 2.11.0 to 2.11.1 Bumps [jshint](https://github.com/jshint/jshint) from 2.11.0 to 2.11.1. - [Release notes](https://github.com/jshint/jshint/releases) - [Changelog](https://github.com/jshint/jshint/blob/master/CHANGELOG.md) - [Commits](https://github.com/jshint/jshint/compare/2.11.0...2.11.1) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 542ac57e1..fe62200ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2997,7 +2997,12 @@ entities@1.0: resolved "https://registry.yarnpkg.com/entities/-/entities-1.0.0.tgz#b2987aa3821347fcde642b24fdfc9e4fb712bf26" integrity sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY= -entities@^2.0.0, entities@~2.0.0: +entities@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.3.tgz#5c487e5742ab93c15abb5da22759b8590ec03b7f" + integrity sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ== + +entities@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.0.tgz#68d6084cab1b079767540d80e56a39b423e4abf4" integrity sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw== @@ -4731,9 +4736,9 @@ jsesc@~0.5.0: integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= jshint@^2.9.6: - version "2.11.0" - resolved "https://registry.yarnpkg.com/jshint/-/jshint-2.11.0.tgz#7f3d99820b8b653eaaec7015a563b2d8101cbbc8" - integrity sha512-ooaD/hrBPhu35xXW4gn+o3SOuzht73gdBuffgJzrZBJZPGgGiiTvJEgTyxFvBO2nz0+X1G6etF8SzUODTlLY6Q== + version "2.11.1" + resolved "https://registry.yarnpkg.com/jshint/-/jshint-2.11.1.tgz#28ec7d1cf7baaae5ce7bd37b9a70ed6cfd938570" + integrity sha512-WXWePB8ssAH3DlD05IoqolsY6arhbll/1+i2JkRPpihQAuiNaR/gSt8VKIcxpV5m6XChP0hCwESQUqpuQMA8Tg== dependencies: cli "~1.0.0" console-browserify "1.1.x" From 90274ac1528d21c659c688dd107657e9b11ebf4a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:49:31 +0000 Subject: [PATCH 923/970] chore(deps): bump spdx-correct from 3.1.0 to 3.1.1 Bumps [spdx-correct](https://github.com/jslicense/spdx-correct.js) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/jslicense/spdx-correct.js/releases) - [Commits](https://github.com/jslicense/spdx-correct.js/compare/v3.1.0...v3.1.1) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 542ac57e1..df0d137f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7711,9 +7711,9 @@ spark-md5@^3.0.0: integrity sha512-0tF3AGSD1ppQeuffsLDIOWlKUd3lS92tFxcsrh5Pe3ZphhnoK+oXIBTzOAThZCiuINZLvpiLH/1VS1/ANEJVig== spdx-correct@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" - integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== + version "3.1.1" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" + integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids "^3.0.0" @@ -7724,9 +7724,9 @@ spdx-exceptions@^2.1.0: integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== spdx-expression-parse@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== dependencies: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0" From dc50bf9f001f612d5c98c386fbe7233179281bcb Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 00:50:21 +0000 Subject: [PATCH 924/970] chore(deps): bump aws4 from 1.9.1 to 1.10.0 Bumps [aws4](https://github.com/mhart/aws4) from 1.9.1 to 1.10.0. - [Release notes](https://github.com/mhart/aws4/releases) - [Commits](https://github.com/mhart/aws4/compare/v1.9.1...v1.10.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 542ac57e1..84a12af3f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1496,9 +1496,9 @@ aws-sign2@~0.7.0: integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= aws4@^1.8.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e" - integrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug== + version "1.10.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.10.0.tgz#a17b3a8ea811060e74d47d306122400ad4497ae2" + integrity sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA== babel-eslint@^10.1.0: version "10.1.0" From 9ab284b1267cb7ed12ca4185190eae2df5612fe4 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 15 Jun 2020 12:42:44 +0300 Subject: [PATCH 925/970] Add new enum parameter to certifications --- app/models/certification.rb | 25 ++++++++++++--------- config/locales/models/certifications/en.yml | 3 +++ config/locales/models/certifications/tr.yml | 3 +++ test/models/certification_test.rb | 25 ++++++++++++--------- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/app/models/certification.rb b/app/models/certification.rb index 6a68a4711..4656549da 100644 --- a/app/models/certification.rb +++ b/app/models/certification.rb @@ -5,17 +5,20 @@ class Certification < ApplicationRecord # enums enum type: { - certification: 1, - course: 2, - research: 3, - study: 4, - report: 5, - workshop: 6, - interview: 7, - essay: 8, - evaluation: 9, - conversation: 10, - translation: 11 + certification: 1, + course: 2, + research: 3, + study: 4, + report: 5, + workshop: 6, + interview: 7, + essay: 8, + evaluation: 9, + conversation: 10, + translation: 11, + seminar: 12, + speeches: 13, + organizing_congress: 14 } enum scope: { national: 0, international: 1 } diff --git a/config/locales/models/certifications/en.yml b/config/locales/models/certifications/en.yml index 263e04c77..46df9b21e 100644 --- a/config/locales/models/certifications/en.yml +++ b/config/locales/models/certifications/en.yml @@ -20,3 +20,6 @@ en: evaluation: Evaluation conversation: Conversation translation: Translation + seminar: Seminar + speeches: Speeches + organizing_congress: Organizing Congress diff --git a/config/locales/models/certifications/tr.yml b/config/locales/models/certifications/tr.yml index 2dbcc72e4..73ff64962 100644 --- a/config/locales/models/certifications/tr.yml +++ b/config/locales/models/certifications/tr.yml @@ -20,3 +20,6 @@ tr: evaluation: Değerlendirme conversation: Söyleşi translation: Çeviri + seminar: Seminer + speeches: Konuşmalarım + organizing_congress: Kongre Düzenleme diff --git a/test/models/certification_test.rb b/test/models/certification_test.rb index 3033102ea..2f7dfd5fe 100644 --- a/test/models/certification_test.rb +++ b/test/models/certification_test.rb @@ -12,17 +12,20 @@ class CertificationTest < ActiveSupport::TestCase # enums enum type: { - certification: 1, - course: 2, - research: 3, - study: 4, - report: 5, - workshop: 6, - interview: 7, - essay: 8, - evaluation: 9, - conversation: 10, - translation: 11 + certification: 1, + course: 2, + research: 3, + study: 4, + report: 5, + workshop: 6, + interview: 7, + essay: 8, + evaluation: 9, + conversation: 10, + translation: 11, + seminar: 12, + speeches: 13, + organizing_congress: 14 } enum scope: { national: 0, international: 1 } enum status: { active: 1, passive: 2 } From 65d617e5a5faa4b8cd470b1ec46f1d3f1b55493f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 23:11:09 +0000 Subject: [PATCH 926/970] chore(deps): [security] bump rack from 2.2.2 to 2.2.3 Bumps [rack](https://github.com/rack/rack) from 2.2.2 to 2.2.3. **This update includes a security fix.** - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/master/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/v2.2.2...2.2.3) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6dd5e9f1c..53b67cabc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -282,7 +282,7 @@ GEM activesupport (>= 3.0.0) pwned (2.0.2) raabro (1.3.1) - rack (2.2.2) + rack (2.2.3) rack-attack (6.3.1) rack (>= 1.0, < 3) rack-mini-profiler (2.0.2) From 143701f858934d8c4ae43c0701c2dcfa61e5473a Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 17 Jun 2020 13:19:56 +0300 Subject: [PATCH 927/970] Fix enum locals of projects --- config/locales/models/account/en.yml | 9 --------- config/locales/models/account/tr.yml | 9 --------- config/locales/models/projects/en.yml | 6 ++++++ config/locales/models/projects/tr.yml | 6 ++++++ 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/config/locales/models/account/en.yml b/config/locales/models/account/en.yml index 8055542fd..344023c69 100644 --- a/config/locales/models/account/en.yml +++ b/config/locales/models/account/en.yml @@ -89,15 +89,6 @@ en: electronic: Electronic printed: Printed printed_and_electronic: Printed and Electronic - project: - statuses: - continuing: Continuing - completed: Completed - deferred: Deferred - pending: Pending - scopes: - international: International - national: National helpers: submit: duty: diff --git a/config/locales/models/account/tr.yml b/config/locales/models/account/tr.yml index 94f2051b7..ecd1e3bcd 100644 --- a/config/locales/models/account/tr.yml +++ b/config/locales/models/account/tr.yml @@ -89,15 +89,6 @@ tr: electronic: Elektronik printed: Basılı printed_and_electronic: Basılı ve Elektronik - project: - statuses: - continuing: Devam Ediyor - completed: Tamamlanmış - deferred: Ertelenmiş - pending: Bekleyen - scopes: - international: Uluslararası - national: Ulusal helpers: submit: duty: diff --git a/config/locales/models/projects/en.yml b/config/locales/models/projects/en.yml index 8436175cd..93b5cc1c8 100644 --- a/config/locales/models/projects/en.yml +++ b/config/locales/models/projects/en.yml @@ -2,6 +2,12 @@ en: activerecord: enums: project: + activities: + passive: Passive + active: Active + scopes: + international: International + national: National statuses: completed: Completed continuing: Continuing diff --git a/config/locales/models/projects/tr.yml b/config/locales/models/projects/tr.yml index 45aab7ea8..79ffaf98b 100644 --- a/config/locales/models/projects/tr.yml +++ b/config/locales/models/projects/tr.yml @@ -2,6 +2,12 @@ tr: activerecord: enums: project: + activities: + passive: Pasif + active: Aktif + scopes: + international: Uluslararası + national: Ulusal statuses: completed: Tamamlandı continuing: Devam ediyor From 5c3bea4b6472ec12e82fbb0b70b1dd5f25693c28 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 17 Jun 2020 13:33:54 +0300 Subject: [PATCH 928/970] Move papers traslations --- config/locales/models/account/en.yml | 19 ------------------- config/locales/models/account/tr.yml | 19 ------------------- config/locales/models/papers/en.yml | 22 ++++++++++++++++++++++ config/locales/models/papers/tr.yml | 22 ++++++++++++++++++++++ 4 files changed, 44 insertions(+), 38 deletions(-) create mode 100644 config/locales/models/papers/en.yml create mode 100644 config/locales/models/papers/tr.yml diff --git a/config/locales/models/account/en.yml b/config/locales/models/account/en.yml index 344023c69..a12b56dc7 100644 --- a/config/locales/models/account/en.yml +++ b/config/locales/models/account/en.yml @@ -70,25 +70,6 @@ en: electronic: Electronic printed: Printed printed_and_electronic: Printed and Electronic - paper: - presentation_types: - guest_speaker: Guest Speaker - poster: Poster - verbal: Verbal Paper - publication_statuses: - accepted: Accepted - published: Published - unpublished: Unpublished - scopes: - national: National - international: International - types: - full_text: Full-text Paper - summary: Summary Paper - type_of_releases: - electronic: Electronic - printed: Printed - printed_and_electronic: Printed and Electronic helpers: submit: duty: diff --git a/config/locales/models/account/tr.yml b/config/locales/models/account/tr.yml index ecd1e3bcd..742f7e2a4 100644 --- a/config/locales/models/account/tr.yml +++ b/config/locales/models/account/tr.yml @@ -70,25 +70,6 @@ tr: electronic: Elektronik printed: Basılı printed_and_electronic: Basılı ve Elektronik - paper: - presentation_types: - guest_speaker: Davetli Konuşmacı - poster: Poster - verbal: Sözlü Sunum - publication_statuses: - accepted: Kabul Edildi - published: Yayımlanmış - unpublished: Yayımlanmamış - scopes: - national: Ulusal - international: Uluslararası - types: - full_text: Tam Metin Bildiri - summary: Özet Bildiri - type_of_releases: - electronic: Elektronik - printed: Basılı - printed_and_electronic: Basılı ve Elektronik helpers: submit: duty: diff --git a/config/locales/models/papers/en.yml b/config/locales/models/papers/en.yml new file mode 100644 index 000000000..ecb0f98c2 --- /dev/null +++ b/config/locales/models/papers/en.yml @@ -0,0 +1,22 @@ +en: + activerecord: + enums: + paper: + presentation_types: + guest_speaker: Guest Speaker + poster: Poster + verbal: Verbal Paper + publication_statuses: + accepted: Accepted + published: Published + unpublished: Unpublished + scopes: + national: National + international: International + types: + full_text: Full-text Paper + summary: Summary Paper + type_of_releases: + electronic: Electronic + printed: Printed + printed_and_electronic: Printed and Electronic diff --git a/config/locales/models/papers/tr.yml b/config/locales/models/papers/tr.yml new file mode 100644 index 000000000..fbf09ef79 --- /dev/null +++ b/config/locales/models/papers/tr.yml @@ -0,0 +1,22 @@ +tr: + activerecord: + enums: + paper: + presentation_types: + guest_speaker: Davetli Konuşmacı + poster: Poster + verbal: Sözlü Sunum + publication_statuses: + accepted: Kabul Edildi + published: Yayımlanmış + unpublished: Yayımlanmamış + scopes: + national: Ulusal + international: Uluslararası + types: + full_text: Tam Metin Bildiri + summary: Özet Bildiri + type_of_releases: + electronic: Elektronik + printed: Basılı + printed_and_electronic: Basılı ve Elektronik From bbf91e7c9c29b76262a4432c5373e565b112888c Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 17 Jun 2020 13:36:38 +0300 Subject: [PATCH 929/970] Move books translations --- config/locales/models/account/en.yml | 17 ----------------- config/locales/models/account/tr.yml | 17 ----------------- config/locales/models/books/en.yml | 20 ++++++++++++++++++++ config/locales/models/books/tr.yml | 20 ++++++++++++++++++++ 4 files changed, 40 insertions(+), 34 deletions(-) create mode 100644 config/locales/models/books/en.yml create mode 100644 config/locales/models/books/tr.yml diff --git a/config/locales/models/account/en.yml b/config/locales/models/account/en.yml index a12b56dc7..504b8c052 100644 --- a/config/locales/models/account/en.yml +++ b/config/locales/models/account/en.yml @@ -53,23 +53,6 @@ en: review_article: Review Article short_article: Short Article technical_note: Technical Note - book: - contribution_rates: - all_of: All of book - chapters: Chapters - scopes: - national: National - international: International - types: - encyclopedia_article: Encyclopedia Article - research: Research - scientific: Scientific - textbook: Textbook - translation: Translation - type_of_releases: - electronic: Electronic - printed: Printed - printed_and_electronic: Printed and Electronic helpers: submit: duty: diff --git a/config/locales/models/account/tr.yml b/config/locales/models/account/tr.yml index 742f7e2a4..35360aacd 100644 --- a/config/locales/models/account/tr.yml +++ b/config/locales/models/account/tr.yml @@ -53,23 +53,6 @@ tr: review_article: Derleme Makale short_article: Kısa Makale technical_note: Teknik Not - book: - contribution_rates: - all_of: Tüm Kitap - chapters: Kitap Bölümü - scopes: - international: Uluslararası - national: Ulusal - types: - encyclopedia_article: Ansiklopedi - research: Araştırma Kitabı - scientific: Bilimsel Kitap - textbook: Ders Kitabı - translation: Kitap Tercümesi - type_of_releases: - electronic: Elektronik - printed: Basılı - printed_and_electronic: Basılı ve Elektronik helpers: submit: duty: diff --git a/config/locales/models/books/en.yml b/config/locales/models/books/en.yml new file mode 100644 index 000000000..93b36102c --- /dev/null +++ b/config/locales/models/books/en.yml @@ -0,0 +1,20 @@ +en: + activerecord: + enums: + book: + contribution_rates: + all_of: All of book + chapters: Chapters + scopes: + national: National + international: International + types: + encyclopedia_article: Encyclopedia Article + research: Research + scientific: Scientific + textbook: Textbook + translation: Translation + type_of_releases: + electronic: Electronic + printed: Printed + printed_and_electronic: Printed and Electronic diff --git a/config/locales/models/books/tr.yml b/config/locales/models/books/tr.yml new file mode 100644 index 000000000..1bc80c789 --- /dev/null +++ b/config/locales/models/books/tr.yml @@ -0,0 +1,20 @@ +tr: + activerecord: + enums: + book: + contribution_rates: + all_of: Tüm Kitap + chapters: Kitap Bölümü + scopes: + international: Uluslararası + national: Ulusal + types: + encyclopedia_article: Ansiklopedi + research: Araştırma Kitabı + scientific: Bilimsel Kitap + textbook: Ders Kitabı + translation: Kitap Tercümesi + type_of_releases: + electronic: Elektronik + printed: Basılı + printed_and_electronic: Basılı ve Elektronik From 095d2015d1b153a49664c386e88d77008fd8c101 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 17 Jun 2020 13:48:21 +0300 Subject: [PATCH 930/970] Move articles translations --- config/locales/models/account/en.yml | 22 ---------------------- config/locales/models/account/tr.yml | 22 ---------------------- config/locales/models/articles/en.yml | 25 +++++++++++++++++++++++++ config/locales/models/articles/tr.yml | 25 +++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 44 deletions(-) create mode 100644 config/locales/models/articles/en.yml create mode 100644 config/locales/models/articles/tr.yml diff --git a/config/locales/models/account/en.yml b/config/locales/models/account/en.yml index 504b8c052..1938c565f 100644 --- a/config/locales/models/account/en.yml +++ b/config/locales/models/account/en.yml @@ -31,28 +31,6 @@ en: lecturer_education: 35 - Lecturer education public_institution: 38 - Assignment in public institutions and foundations short_term_temporary: 39/a - Short-term temporary assignment - article: - access_type: - electronic: Electronic - printed: Printed - printed_and_electronic: Printed and Electronic - scopes: - international: International - national: National - reviews: - reviewed: Reviewed - unreviewed: Unreviewed - types: - abstract: Abstract - book_review: Book Review - case_report: Case Report - commentary: Commentary - expert_report: Expert Report - letter_to_the_editor: Letter to the editor - original_article: Original Article - review_article: Review Article - short_article: Short Article - technical_note: Technical Note helpers: submit: duty: diff --git a/config/locales/models/account/tr.yml b/config/locales/models/account/tr.yml index 35360aacd..5856ff772 100644 --- a/config/locales/models/account/tr.yml +++ b/config/locales/models/account/tr.yml @@ -31,28 +31,6 @@ tr: long_term_temporary: 39/b - Uzun süreli geçici görevlendirme public_institution: 38 - Kamu kuruluşları ve vakıflarda görevlendirme short_term_temporary: 39/a - Kısa süreli geçici görevlendirme - article: - access_type: - electronic: Elektronik - printed: Basılı - printed_and_electronic: Basılı ve Elektronik - scopes: - international: Uluslararası - national: Ulusal - reviews: - reviewed: Hakemli - unreviewed: Hakemsiz - types: - abstract: Özet - book_review: Kitap İncelemesi - case_report: Vaka Raporu - commentary: Eleştiri - expert_report: Uzman Raporu - letter_to_the_editor: Editöre Mektup - original_article: Özgün Makale - review_article: Derleme Makale - short_article: Kısa Makale - technical_note: Teknik Not helpers: submit: duty: diff --git a/config/locales/models/articles/en.yml b/config/locales/models/articles/en.yml new file mode 100644 index 000000000..0a9a436e9 --- /dev/null +++ b/config/locales/models/articles/en.yml @@ -0,0 +1,25 @@ +en: + activerecord: + enums: + article: + access_type: + electronic: Electronic + printed: Printed + printed_and_electronic: Printed and Electronic + scopes: + international: International + national: National + reviews: + reviewed: Reviewed + unreviewed: Unreviewed + types: + abstract: Abstract + book_review: Book Review + case_report: Case Report + commentary: Commentary + expert_report: Expert Report + letter_to_the_editor: Letter to the editor + original_article: Original Article + review_article: Review Article + short_article: Short Article + technical_note: Technical Note diff --git a/config/locales/models/articles/tr.yml b/config/locales/models/articles/tr.yml new file mode 100644 index 000000000..43f33ad70 --- /dev/null +++ b/config/locales/models/articles/tr.yml @@ -0,0 +1,25 @@ +tr: + activerecord: + enums: + article: + access_type: + electronic: Elektronik + printed: Basılı + printed_and_electronic: Basılı ve Elektronik + scopes: + international: Uluslararası + national: Ulusal + reviews: + reviewed: Hakemli + unreviewed: Hakemsiz + types: + abstract: Özet + book_review: Kitap İncelemesi + case_report: Vaka Raporu + commentary: Eleştiri + expert_report: Uzman Raporu + letter_to_the_editor: Editöre Mektup + original_article: Özgün Makale + review_article: Derleme Makale + short_article: Kısa Makale + technical_note: Teknik Not From 32b01bc2dac26351cffc9d22c3030873b972ecd7 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 17 Jun 2020 13:51:46 +0300 Subject: [PATCH 931/970] Fix typo --- app/views/account/profile/partials/_certifications.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/account/profile/partials/_certifications.html.erb b/app/views/account/profile/partials/_certifications.html.erb index 0264438a3..816b90262 100644 --- a/app/views/account/profile/partials/_certifications.html.erb +++ b/app/views/account/profile/partials/_certifications.html.erb @@ -19,7 +19,7 @@ <%= certificate.city_and_country %> <%= enum_t certificate, :scope %> <%= enum_t certificate, :type %> - <%= l(certificate.start_date, format: '%Y') %> + <%= l(certificate.start_date, format: '%Y') %> <% end %>
    From 5bc8cc2e07d4d382e73fe45ce03439bb8bee9cc5 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 18 Jun 2020 09:02:11 +0300 Subject: [PATCH 932/970] Fix indents --- app/views/account/profile/index.html.erb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/views/account/profile/index.html.erb b/app/views/account/profile/index.html.erb index 81306f45b..fbea4f84d 100644 --- a/app/views/account/profile/index.html.erb +++ b/app/views/account/profile/index.html.erb @@ -101,21 +101,21 @@