Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #813 from omu/rename-concerns
Browse files Browse the repository at this point in the history
Rename concerns with meaningful names
  • Loading branch information
msdundar authored Feb 18, 2019
2 parents b828fe8 + 798ae9c commit 87df955
Show file tree
Hide file tree
Showing 27 changed files with 39 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:**

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/account/addresses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/account/identities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/cities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/countries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Admin
class CountriesController < ApplicationController
include PagyBackendWithHelpers
include SearchableModule

before_action :set_country, only: %i[show edit update destroy]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module CalendarManagement
class CalendarEventTypesController < ApplicationController
include PagyBackendWithHelpers
include SearchableModule

before_action :set_calendar_event_type, only: %i[edit update destroy]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module CalendarManagement
class CalendarsController < ApplicationController
include PagyBackendWithHelpers
include SearchableModule

before_action :set_calendar, only: %i[show edit update destroy]

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/committee/agenda_types_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Committee
class AgendaTypesController < ApplicationController
include PagyBackendWithHelpers
include SearchableModule

before_action :set_agenda_type, only: %i[edit update destroy]

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/committee/agendas_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/committee/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Committee
class DashboardController < ApplicationController
include PagyBackendWithHelpers
include SearchableModule

def index
@committees = pagy_by_search(
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/reference_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module ReferenceResource
extend ActiveSupport::Concern
include PagyBackendWithHelpers
include SearchableModule

# rubocop:disable Metrics/BlockLength
# rubocop:disable Rails/LexicallyScopedActionFilter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module PagyBackendWithHelpers
module SearchableModule
extend ActiveSupport::Concern
include Pagy::Backend

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module LastUpdateFromMernis
module UpdateableFromMernis
extend ActiveSupport::Concern

def elapsed_time(resource)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module CourseManagement
class AvailableCoursesController < ApplicationController
include PagyBackendWithHelpers
include SearchableModule

before_action :set_available_course, only: %i[show edit update destroy]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module CourseManagement
class CourseGroupTypesController < ApplicationController
include PagyBackendWithHelpers
include SearchableModule

before_action :set_course_group_type, only: %i[edit update destroy]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module CourseManagement
class CourseTypesController < ApplicationController
include PagyBackendWithHelpers
include SearchableModule

before_action :set_course_type, only: %i[edit update destroy]

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/course_management/courses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module CourseManagement
class CoursesController < ApplicationController
include PagyBackendWithHelpers
include SearchableModule

before_action :set_course, only: %i[show edit update destroy]

Expand Down
3 changes: 2 additions & 1 deletion app/controllers/course_management/curriculums_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module FirstRegistration
class RegistrationDocumentsController < ApplicationController
include PagyBackendWithHelpers
include SearchableModule

before_action :set_registration_document, only: %i[edit update destroy]

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/public_profile_controller.rb
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/references/academic_terms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module References
class AcademicTermsController < ApplicationController
include PagyBackendWithHelpers
include SearchableModule

before_action :set_academic_term, only: %i[edit update destroy]

Expand Down
3 changes: 2 additions & 1 deletion app/controllers/units_controller.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
8 changes: 8 additions & 0 deletions test/config/application_config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/addresses.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 87df955

Please sign in to comment.