From 9b59b6ff13516f5e7243a5a7d0a73619bb135b92 Mon Sep 17 00:00:00 2001 From: msdundar Date: Mon, 18 Feb 2019 05:09:16 +0300 Subject: [PATCH 1/2] Rename concerns with meaningful names --- app/controllers/account/addresses_controller.rb | 2 +- app/controllers/account/identities_controller.rb | 2 +- app/controllers/admin/cities_controller.rb | 2 +- app/controllers/admin/countries_controller.rb | 2 +- .../calendar_event_types_controller.rb | 2 +- .../calendar_management/calendars_controller.rb | 2 +- app/controllers/committee/agenda_types_controller.rb | 2 +- app/controllers/committee/agendas_controller.rb | 2 +- app/controllers/committee/dashboard_controller.rb | 2 +- app/controllers/concerns/reference_resource.rb | 2 +- ...{pagy_backend_with_helpers.rb => searchable_module.rb} | 2 +- ...st_update_from_mernis.rb => updateable_from_mernis.rb} | 2 +- .../course_management/available_courses_controller.rb | 2 +- .../course_management/course_group_types_controller.rb | 2 +- .../course_management/course_types_controller.rb | 2 +- app/controllers/course_management/courses_controller.rb | 2 +- .../course_management/curriculums_controller.rb | 3 ++- .../first_registration/prospective_students_controller.rb | 2 +- .../registration_documents_controller.rb | 2 +- app/controllers/public_profile_controller.rb | 2 +- app/controllers/references/academic_terms_controller.rb | 2 +- app/controllers/units_controller.rb | 3 ++- app/controllers/users_controller.rb | 4 ++-- test/config/application_config_test.rb | 8 ++++++++ ...ller_test.rb => assessment_methods_controller_test.rb} | 2 +- test/fixtures/addresses.yml | 6 +++--- 26 files changed, 38 insertions(+), 28 deletions(-) rename app/controllers/concerns/{pagy_backend_with_helpers.rb => searchable_module.rb} (88%) rename app/controllers/concerns/{last_update_from_mernis.rb => updateable_from_mernis.rb} (91%) rename test/controllers/admin/{assessment_method_controller_test.rb => assessment_methods_controller_test.rb} (97%) diff --git a/app/controllers/account/addresses_controller.rb b/app/controllers/account/addresses_controller.rb index 38c060daf..fc6aef710 100644 --- a/app/controllers/account/addresses_controller.rb +++ b/app/controllers/account/addresses_controller.rb @@ -2,7 +2,7 @@ module Account class AddressesController < ApplicationController - include LastUpdateFromMernis + include UpdateableFromMernis before_action :set_user before_action :set_address, only: %i[edit update destroy] diff --git a/app/controllers/account/identities_controller.rb b/app/controllers/account/identities_controller.rb index 4cc011356..ff2cd2658 100644 --- a/app/controllers/account/identities_controller.rb +++ b/app/controllers/account/identities_controller.rb @@ -2,7 +2,7 @@ module Account class IdentitiesController < ApplicationController - include LastUpdateFromMernis + include UpdateableFromMernis before_action :set_user before_action :set_identity, only: %i[edit update destroy] diff --git a/app/controllers/admin/cities_controller.rb b/app/controllers/admin/cities_controller.rb index 1c678f794..f3f039632 100644 --- a/app/controllers/admin/cities_controller.rb +++ b/app/controllers/admin/cities_controller.rb @@ -2,7 +2,7 @@ module Admin class CitiesController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule before_action :set_country before_action :set_city, only: %i[show edit update destroy] diff --git a/app/controllers/admin/countries_controller.rb b/app/controllers/admin/countries_controller.rb index 49fdc8fb2..16eb980ce 100644 --- a/app/controllers/admin/countries_controller.rb +++ b/app/controllers/admin/countries_controller.rb @@ -2,7 +2,7 @@ module Admin class CountriesController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule before_action :set_country, only: %i[show edit update destroy] diff --git a/app/controllers/calendar_management/calendar_event_types_controller.rb b/app/controllers/calendar_management/calendar_event_types_controller.rb index 199468ab3..46166c3ac 100644 --- a/app/controllers/calendar_management/calendar_event_types_controller.rb +++ b/app/controllers/calendar_management/calendar_event_types_controller.rb @@ -2,7 +2,7 @@ module CalendarManagement class CalendarEventTypesController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule before_action :set_calendar_event_type, only: %i[edit update destroy] diff --git a/app/controllers/calendar_management/calendars_controller.rb b/app/controllers/calendar_management/calendars_controller.rb index e4c745957..777884551 100644 --- a/app/controllers/calendar_management/calendars_controller.rb +++ b/app/controllers/calendar_management/calendars_controller.rb @@ -2,7 +2,7 @@ module CalendarManagement class CalendarsController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule before_action :set_calendar, only: %i[show edit update destroy] diff --git a/app/controllers/committee/agenda_types_controller.rb b/app/controllers/committee/agenda_types_controller.rb index 0fbdaa779..ef5304d83 100644 --- a/app/controllers/committee/agenda_types_controller.rb +++ b/app/controllers/committee/agenda_types_controller.rb @@ -2,7 +2,7 @@ module Committee class AgendaTypesController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule before_action :set_agenda_type, only: %i[edit update destroy] diff --git a/app/controllers/committee/agendas_controller.rb b/app/controllers/committee/agendas_controller.rb index f948015d9..ec70cbf27 100644 --- a/app/controllers/committee/agendas_controller.rb +++ b/app/controllers/committee/agendas_controller.rb @@ -2,7 +2,7 @@ module Committee class AgendasController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule before_action :set_committee before_action :set_agenda, only: %i[edit update destroy] diff --git a/app/controllers/committee/dashboard_controller.rb b/app/controllers/committee/dashboard_controller.rb index 34dcb6137..99108e29f 100644 --- a/app/controllers/committee/dashboard_controller.rb +++ b/app/controllers/committee/dashboard_controller.rb @@ -2,7 +2,7 @@ module Committee class DashboardController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule def index @committees = pagy_by_search( diff --git a/app/controllers/concerns/reference_resource.rb b/app/controllers/concerns/reference_resource.rb index 5a82a7ecb..cc98b4764 100644 --- a/app/controllers/concerns/reference_resource.rb +++ b/app/controllers/concerns/reference_resource.rb @@ -2,7 +2,7 @@ module ReferenceResource extend ActiveSupport::Concern - include PagyBackendWithHelpers + include SearchableModule # rubocop:disable Metrics/BlockLength # rubocop:disable Rails/LexicallyScopedActionFilter diff --git a/app/controllers/concerns/pagy_backend_with_helpers.rb b/app/controllers/concerns/searchable_module.rb similarity index 88% rename from app/controllers/concerns/pagy_backend_with_helpers.rb rename to app/controllers/concerns/searchable_module.rb index 6607bb398..9ffecc8ff 100644 --- a/app/controllers/concerns/pagy_backend_with_helpers.rb +++ b/app/controllers/concerns/searchable_module.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PagyBackendWithHelpers +module SearchableModule extend ActiveSupport::Concern include Pagy::Backend diff --git a/app/controllers/concerns/last_update_from_mernis.rb b/app/controllers/concerns/updateable_from_mernis.rb similarity index 91% rename from app/controllers/concerns/last_update_from_mernis.rb rename to app/controllers/concerns/updateable_from_mernis.rb index 54c53d70b..726abcc8e 100644 --- a/app/controllers/concerns/last_update_from_mernis.rb +++ b/app/controllers/concerns/updateable_from_mernis.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module LastUpdateFromMernis +module UpdateableFromMernis extend ActiveSupport::Concern def elapsed_time(resource) diff --git a/app/controllers/course_management/available_courses_controller.rb b/app/controllers/course_management/available_courses_controller.rb index 974a1251d..dcc565eff 100644 --- a/app/controllers/course_management/available_courses_controller.rb +++ b/app/controllers/course_management/available_courses_controller.rb @@ -2,7 +2,7 @@ module CourseManagement class AvailableCoursesController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule before_action :set_available_course, only: %i[show edit update destroy] diff --git a/app/controllers/course_management/course_group_types_controller.rb b/app/controllers/course_management/course_group_types_controller.rb index ca8176819..cd0c3bb17 100644 --- a/app/controllers/course_management/course_group_types_controller.rb +++ b/app/controllers/course_management/course_group_types_controller.rb @@ -2,7 +2,7 @@ module CourseManagement class CourseGroupTypesController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule before_action :set_course_group_type, only: %i[edit update destroy] diff --git a/app/controllers/course_management/course_types_controller.rb b/app/controllers/course_management/course_types_controller.rb index feec4ba63..eb78a1b8e 100644 --- a/app/controllers/course_management/course_types_controller.rb +++ b/app/controllers/course_management/course_types_controller.rb @@ -2,7 +2,7 @@ module CourseManagement class CourseTypesController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule before_action :set_course_type, only: %i[edit update destroy] diff --git a/app/controllers/course_management/courses_controller.rb b/app/controllers/course_management/courses_controller.rb index 6b7119353..839084d02 100644 --- a/app/controllers/course_management/courses_controller.rb +++ b/app/controllers/course_management/courses_controller.rb @@ -2,7 +2,7 @@ module CourseManagement class CoursesController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule before_action :set_course, only: %i[show edit update destroy] diff --git a/app/controllers/course_management/curriculums_controller.rb b/app/controllers/course_management/curriculums_controller.rb index 4553a6c94..fa6042c36 100644 --- a/app/controllers/course_management/curriculums_controller.rb +++ b/app/controllers/course_management/curriculums_controller.rb @@ -2,7 +2,8 @@ module CourseManagement class CurriculumsController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule + before_action :set_curriculum, only: %i[show edit update destroy openable_courses] def index diff --git a/app/controllers/first_registration/prospective_students_controller.rb b/app/controllers/first_registration/prospective_students_controller.rb index d6b3aa2d4..9cb0b920d 100644 --- a/app/controllers/first_registration/prospective_students_controller.rb +++ b/app/controllers/first_registration/prospective_students_controller.rb @@ -2,7 +2,7 @@ module FirstRegistration class ProspectiveStudentsController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule before_action :set_prospective_student, only: %i[show register] before_action :can_register?, only: :register diff --git a/app/controllers/first_registration/registration_documents_controller.rb b/app/controllers/first_registration/registration_documents_controller.rb index 2dd659032..18ea656b8 100644 --- a/app/controllers/first_registration/registration_documents_controller.rb +++ b/app/controllers/first_registration/registration_documents_controller.rb @@ -2,7 +2,7 @@ module FirstRegistration class RegistrationDocumentsController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule before_action :set_registration_document, only: %i[edit update destroy] diff --git a/app/controllers/public_profile_controller.rb b/app/controllers/public_profile_controller.rb index 356e9ecf7..b7336e931 100644 --- a/app/controllers/public_profile_controller.rb +++ b/app/controllers/public_profile_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class PublicProfileController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule skip_before_action :authenticate_user! before_action :set_user, only: %i[show vcard] diff --git a/app/controllers/references/academic_terms_controller.rb b/app/controllers/references/academic_terms_controller.rb index be7325f1f..7d6116247 100644 --- a/app/controllers/references/academic_terms_controller.rb +++ b/app/controllers/references/academic_terms_controller.rb @@ -2,7 +2,7 @@ module References class AcademicTermsController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule before_action :set_academic_term, only: %i[edit update destroy] diff --git a/app/controllers/units_controller.rb b/app/controllers/units_controller.rb index cce3d70aa..7e58b8d64 100644 --- a/app/controllers/units_controller.rb +++ b/app/controllers/units_controller.rb @@ -1,7 +1,8 @@ # frozen_string_literal: true class UnitsController < ApplicationController - include PagyBackendWithHelpers + include SearchableModule + before_action :set_unit, only: %i[edit update destroy show courses programs curriculums employees] def index diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 41bd85e2d..c907a7d90 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true class UsersController < ApplicationController - include PagyBackendWithHelpers - include LastUpdateFromMernis + include SearchableModule + include UpdateableFromMernis before_action :set_user, except: :index before_action :set_address_elapsed_time, only: %i[save_address_from_mernis] diff --git a/test/config/application_config_test.rb b/test/config/application_config_test.rb index 212c4d71a..f40fcf9be 100644 --- a/test/config/application_config_test.rb +++ b/test/config/application_config_test.rb @@ -40,4 +40,12 @@ class ApplicationConfigTest < ActiveSupport::TestCase test 'autoloader is set to :classic until Rails 6 stable' do assert_equal Rails.application.config.autoloader, :classic end + + test 'image_processor is set to :vips' do + assert_equal Rails.application.config.active_storage.variant_processor, :vips + end + + test 'schema format is set to :sql' do + assert_equal Rails.application.config.active_record.schema_format, :sql + end end diff --git a/test/controllers/admin/assessment_method_controller_test.rb b/test/controllers/admin/assessment_methods_controller_test.rb similarity index 97% rename from test/controllers/admin/assessment_method_controller_test.rb rename to test/controllers/admin/assessment_methods_controller_test.rb index 30b85f1c8..054410ec9 100644 --- a/test/controllers/admin/assessment_method_controller_test.rb +++ b/test/controllers/admin/assessment_methods_controller_test.rb @@ -3,7 +3,7 @@ require 'test_helper' module Admin - class AssessmentMethodControllerTest < ActionDispatch::IntegrationTest + class AssessmentMethodsControllerTest < ActionDispatch::IntegrationTest setup do sign_in users(:serhat) @assessment_method = assessment_methods(:exam) diff --git a/test/fixtures/addresses.yml b/test/fixtures/addresses.yml index 599292262..1f8ab876b 100644 --- a/test/fixtures/addresses.yml +++ b/test/fixtures/addresses.yml @@ -1,18 +1,18 @@ formal: type: formal - phone_number: 5554443322 + phone_number: <% TelephoneNumber.parse('5554443322', :tr) %> full_address: 'Lorem ipsum street' district: atakum user: serhat informal: type: informal - phone_number: 5554443322 + phone_number: <% TelephoneNumber.parse('5554443322', :tr) %> full_address: 'Cumhuriyet mahallesi' district: atakum user: serhat informal: type: informal - phone_number: 5554443322 + phone_number: <% TelephoneNumber.parse('5554443322', :tr) %> full_address: 'Cumhuriyet mahallesi' district: atakum user: john From 798ae9c93f818a351ce68271f55a851ef57a5b4f Mon Sep 17 00:00:00 2001 From: msdundar Date: Mon, 18 Feb 2019 05:10:48 +0300 Subject: [PATCH 2/2] Fix typo in PR template --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6402a3da7..69a0d0e8e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -12,7 +12,7 @@ **Sistem/Ops etkileri:** -[//]: # (Bu PR merge edildiğinde sunucular üzerinde bir değişiklik - paket kurulması, buildpack eklenmesi vb. - yapılması gerekecekmi, açıklayın.) +[//]: # (Bu PR merge edildiğinde sunucular üzerinde bir değişiklik - paket kurulması, buildpack eklenmesi vb. - yapılması gerekecek mi, açıklayın.) **Kontrol listesi:**