This repository has been archived by the owner on Jun 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #888 from omu/develop
Merge develop into master
- Loading branch information
Showing
77 changed files
with
1,208 additions
and
913 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class ConcatenationError < StandardError | ||
def message | ||
I18n.t('errors.can_not_be_concatenated') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class EncodingMismatchError < StandardError | ||
def message | ||
I18n.t('errors.encoding_mismatch') | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class InvalidPhoneNumberError < StandardError | ||
def message | ||
I18n.t('errors.invalid_phone_number') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class UnicodeSupportError < StandardError | ||
def message | ||
I18n.t('errors.unicode_not_supported') | ||
end | ||
end |
20 changes: 20 additions & 0 deletions
20
app/services/academic_calendars/duplicate_calendar_service.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
module AcademicCalendars | ||
class DuplicateCalendarService | ||
attr_reader :record, :prefixed_param | ||
|
||
def initialize(record, prefixed_param) | ||
@record = record | ||
@prefixed_param = prefixed_param | ||
end | ||
|
||
def duplicate | ||
clone_record = @record.dup | ||
clone_record.send(@prefixed_param).prepend('[Kopyası] ') | ||
clone_record.committee_decisions << @record.committee_decisions | ||
clone_record.save | ||
clone_record | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# frozen_string_literal: true | ||
|
||
module Nexmo | ||
module ErrorHandler | ||
SOFT_FAIL_CODES = { | ||
'2' => 'Missing Parameters', | ||
'3' => 'Invalid Parameters', | ||
'6' => 'Invalid Message', | ||
'12' => 'Message Too Long', | ||
'22' => 'Invalid Network Code', | ||
'33' => 'Number De-activated' | ||
}.freeze | ||
|
||
HARD_FAIL_CODES = { | ||
'1' => 'Throttled', | ||
'4' => 'Invalid Credentials', | ||
'5' => 'Internal Error', | ||
'7' => 'Number Barred', | ||
'8' => 'Partner Account Barred', | ||
'9' => 'Partner Quota Violation', | ||
'10' => 'Too Many Existing Binds', | ||
'11' => 'Account Not Enabled For HTTP', | ||
'14' => 'Invalid Signature', | ||
'15' => 'Invalid Sender Address', | ||
'23' => 'Invalid Callback Url', | ||
'32' => 'Signature And API Secret Disallowed' | ||
}.freeze | ||
|
||
def log_or_notify_admin(response) | ||
status = response.status | ||
notifier = Slack::Notifier.new Tenant.credentials.slack[:panik_hook] | ||
|
||
if status == '0' | ||
Rails.logger.info "Sent message id=#{response.message_id}" | ||
elsif SOFT_FAIL_CODES.key?(status) || HARD_FAIL_CODES.key?(status) | ||
notifier.ping "Nexmo SMS Error (code: #{status}, text: #{response.error_text})" | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.