source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/carrier_api/v1/phone_numbers/stats_controller.rb
Ruby
mit
95
develop
776
module CarrierAPI module V1 module PhoneNumbers class StatsController < CarrierAPIController def index validate_request_schema( with: PhoneNumberStatsRequestSchema, input_params: request.query_parameters, **serializer_options ) do |permitted_pa...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/twilio_api/available_phone_numbers_controller.rb
Ruby
mit
95
develop
573
module TwilioAPI class AvailablePhoneNumbersController < TwilioAPIController def index validate_request_schema( with: AvailablePhoneNumberFilterRequestSchema, schema_options: { account: current_account }, input_params: request.params, **serializer_options ) do |permitte...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/twilio_api/messages_controller.rb
Ruby
mit
95
develop
1,450
module TwilioAPI class MessagesController < TwilioAPIController def index respond_with(scope, serializer_options) end def create validate_request_schema( with: MessageRequestSchema, schema_options: { account: current_account }, **serializer_options ) do |permitte...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/twilio_api/available_phone_number_countries_controller.rb
Ruby
mit
95
develop
635
module TwilioAPI class AvailablePhoneNumberCountriesController < TwilioAPIController def index respond_with(scope, serializer_options) end def show country = scope.find_by!(iso_country_code: params[:id]) respond_with_resource(country, serializer_options) end private def sc...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/twilio_api/phone_calls_controller.rb
Ruby
mit
95
develop
1,203
module TwilioAPI class PhoneCallsController < TwilioAPIController def index respond_with(scope.includes(:call_data_record), serializer_options) end def create validate_request_schema( with: PhoneCallRequestSchema, schema_options: { account: current_account }, **seriali...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/twilio_api/incoming_phone_numbers_controller.rb
Ruby
mit
95
develop
1,716
module TwilioAPI class IncomingPhoneNumbersController < TwilioAPIController def index validate_request_schema( with: IncomingPhoneNumberFilterRequestSchema, schema_options: { account: current_account }, input_params: request.params, **serializer_options ) do |permitted_...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/twilio_api/verify_api_controller.rb
Ruby
mit
95
develop
360
module TwilioAPI class VerifyAPIController < TwilioAPIController private def verify_account_param? false end def verification_service @verification_service ||= current_account.verification_services.find(params[:service_id]) end def verifications_scope verification_service....
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/twilio_api/recordings_controller.rb
Ruby
mit
95
develop
2,030
module TwilioAPI class RecordingsController < TwilioAPIController include ActiveStorage::SetCurrent include ActionController::MimeResponds skip_before_action :doorkeeper_authorize!, only: :show skip_before_action :authorize_account!, only: :show def index recordings = recordings_scope.page...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/twilio_api/accounts_controller.rb
Ruby
mit
95
develop
257
module TwilioAPI class AccountsController < TwilioAPIController def show respond_with_resource(current_account, serializer_options) end private def serializer_options { serializer_class: AccountSerializer } end end end
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/twilio_api/documentation_controller.rb
Ruby
mit
95
develop
309
module TwilioAPI class DocumentationController < ApplicationController def show renderer = DocumentationRenderer.new( carrier: app_request.find_carrier!, template: Rails.root.join("public/docs/twilio_api/index.html") ) render(inline: renderer.render) end end end
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/twilio_api/verify/verification_checks_controller.rb
Ruby
mit
95
develop
871
module TwilioAPI module Verify class VerificationChecksController < VerifyAPIController def create validate_request_schema( with: VerificationCheckRequestSchema, schema_options: { account: current_account, verification_service:, verifications_s...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/twilio_api/verify/services_controller.rb
Ruby
mit
95
develop
1,384
module TwilioAPI module Verify class ServicesController < VerifyAPIController def index respond_with(scope, serializer_options) end def show service = scope.find(params[:id]) respond_with_resource(service, **serializer_options) end def create validat...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/twilio_api/verify/verifications_controller.rb
Ruby
mit
95
develop
1,405
module TwilioAPI module Verify class VerificationsController < VerifyAPIController def show verification = verifications_scope.find(params[:id]) respond_with_resource(verification, **serializer_options) end def create validate_request_schema( with: Verification...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/users/sessions_controller.rb
Ruby
mit
95
develop
310
class Users::SessionsController < Devise::SessionsController include CaptchaHelper def create verify_captcha(action: :sign_in, on_failure: -> { on_captcha_failure }) { super } end private def on_captcha_failure self.resource = resource_class.new(sign_in_params) render(:new) end end
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/users/forgot_subdomain_controller.rb
Ruby
mit
95
develop
556
module Users class ForgotSubdomainController < ApplicationController respond_to :html layout "devise" def new @resource = ForgotSubdomainForm.new end def create @resource = ForgotSubdomainForm.new(permitted_params) if @resource.save flash[:notice] = "You will receive an...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/users/registrations_controller.rb
Ruby
mit
95
develop
1,697
class Users::RegistrationsController < Devise::RegistrationsController include UserAuthorization include CaptchaHelper skip_before_action :select_account_membership!, only: %i[new create] skip_before_action :authorize_user!, only: %i[new create] skip_before_action :authorize_carrier!, only: %i[new create] ...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/services/outbound_phone_calls_controller.rb
Ruby
mit
95
develop
375
module Services class OutboundPhoneCallsController < ServicesController def create validate_request_schema( with: OutboundPhoneCallsRequestSchema, serializer_class: OutboundPhoneCallSerializer, location: nil ) do |permitted_params| CreatePhoneCallsFromOutboundDial.call(...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/services/call_service_capacities_controller.rb
Ruby
mit
95
develop
380
module Services class CallServiceCapacitiesController < ServicesController def create validate_request_schema( with: CallServiceCapacityRequestSchema, location: nil, ) do |permitted_params| UpdateCallServiceCapacity.call(permitted_params) end end private def...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/services/recordings_controller.rb
Ruby
mit
95
develop
740
module Services class RecordingsController < ServicesController def create validate_request_schema( with: RecordingRequestSchema, serializer_class: RecordingSerializer, location: nil ) do |permitted_params| Recording.create!(permitted_params) end end def ...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/services/media_streams_controller.rb
Ruby
mit
95
develop
329
module Services class MediaStreamsController < ServicesController def create validate_request_schema( with: MediaStreamRequestSchema, serializer_class: MediaStreamSerializer, location: nil ) do |permitted_params| MediaStream.create!(permitted_params) end end ...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/services/media_stream_events_controller.rb
Ruby
mit
95
develop
402
module Services class MediaStreamEventsController < ServicesController def create validate_request_schema( with: MediaStreamEventRequestSchema, location: nil ) do |permitted_params| event = MediaStreamEvent.create!(permitted_params) ProcessMediaStreamEvent.call(event) end...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/services/inbound_phone_calls_controller.rb
Ruby
mit
95
develop
857
module Services class InboundPhoneCallsController < ServicesController def create validate_request_schema( with: InboundPhoneCallRequestSchema, serializer_class: InboundPhoneCallSerializer, location: nil, schema_options: { error_log_messages: }, on_error: ->(schema) {...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/services/tts_events_controller.rb
Ruby
mit
95
develop
348
module Services class TTSEventsController < ServicesController def create validate_request_schema( with: TTSEventRequestSchema, location: nil, ) do |permitted_params| TTSEvent.create!(permitted_params) end end private def respond_with_resource(*) head(...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/services/call_data_records_controller.rb
Ruby
mit
95
develop
287
module Services class CallDataRecordsController < ServicesController def create payload = Base64.encode64( ActiveSupport::Gzip.compress( request.raw_post ) ) ProcessCDRJob.perform_later(payload) head(:no_content) end end end
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/services/call_heartbeats_controller.rb
Ruby
mit
95
develop
348
module Services class CallHeartbeatsController < ServicesController def create validate_request_schema(with: CallHeartbeatsRequestSchema) do |permitted_params| HandleCallHeartbeats.call(permitted_params.fetch(:call_ids)) end end private def respond_with_resource(*) head(:no...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/services/phone_call_events_controller.rb
Ruby
mit
95
develop
382
module Services class PhoneCallEventsController < ServicesController def create validate_request_schema( with: PhoneCallEventRequestSchema, location: nil ) do |permitted_params| CreatePhoneCallEventJob.perform_later(**permitted_params) end end private def re...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/tariff_packages_controller.rb
Ruby
mit
95
develop
1,277
module Dashboard class TariffPackagesController < DashboardController def index @resources = apply_filters(scope.includes(:plans)) @resources = paginate_resources(@resources) end def new @resource = TariffPackageForm.new(carrier: current_carrier) end def create @resource ...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/destination_groups_controller.rb
Ruby
mit
95
develop
1,302
module Dashboard class DestinationGroupsController < DashboardController def index @resources = apply_filters(scope.includes(:prefixes, :tariff_schedules)) @resources = paginate_resources(@resources) end def new @resource = DestinationGroupForm.new(carrier: current_carrier) end ...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/phone_number_plans_controller.rb
Ruby
mit
95
develop
1,143
module Dashboard class PhoneNumberPlansController < DashboardController def index @resources = paginate_resources(apply_filters(scope.includes(:account))) end def show @resource = record end def new @resource = initialize_form(phone_number_id: params[:phone_number_id]) end ...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/balance_transactions_controller.rb
Ruby
mit
95
develop
1,277
module Dashboard class BalanceTransactionsController < DashboardController def index @resources = apply_filters(scope) @resources = paginate_resources(@resources) end def new @resource = BalanceTransactionForm.new(carrier: current_carrier) end def create @resource = Balan...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/verification_services_controller.rb
Ruby
mit
95
develop
1,422
module Dashboard class VerificationServicesController < DashboardController def index @resources = apply_filters(scope.includes(:account)) @resources = paginate_resources(@resources) end def show @resource = record end def new @resource = initialize_form end def ...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/user_invitations_controller.rb
Ruby
mit
95
develop
395
module Dashboard class UserInvitationsController < DashboardController def update record.invite!(current_user) redirect_back( fallback_location: dashboard_root_url, notice: "An invitation email has been sent to #{record.email}.", status: :see_other ) end private ...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/carrier_users_controller.rb
Ruby
mit
95
develop
1,386
module Dashboard class CarrierUsersController < DashboardController def index @resources = apply_filters(users_scope) @resources = paginate_resources(@resources) end def show @resource = record end def new @resource = initialize_form end def create @resourc...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/two_factor_authentications_controller.rb
Ruby
mit
95
develop
908
module Dashboard class TwoFactorAuthenticationsController < DashboardController skip_before_action :enforce_two_factor_authentication! def new @resource = TwoFactorAuthenticationForm.new end def create @resource = TwoFactorAuthenticationForm.new(permitted_params) @resource.user = c...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/home_controller.rb
Ruby
mit
95
develop
296
module Dashboard class HomeController < DashboardController def show if current_user.carrier_user? redirect_to(dashboard_carrier_settings_path, status: :see_other) else redirect_to(dashboard_account_settings_path, status: :see_other) end end end end
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/accounts_controller.rb
Ruby
mit
95
develop
1,432
module Dashboard class AccountsController < DashboardController def index @resources = apply_filters(accounts_scope) @resources = paginate_resources(@resources) end def show @resource = record end def new @resource = AccountForm.new(carrier: current_carrier, current_user:...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/phone_calls_controller.rb
Ruby
mit
95
develop
389
module Dashboard class PhoneCallsController < DashboardController def index @resources = apply_filters(scope.includes(:account)) @resources = paginate_resources(@resources) end def show @resource = record end private def scope parent_scope.phone_calls end de...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/exports_controller.rb
Ruby
mit
95
develop
967
module Dashboard class ExportsController < DashboardController def index @resources = paginate_resources(current_user.exports) end def create @resource = build_export @resource.save! ExportCSVJob.perform_later(@resource) redirect_back( fallback_location: dashboard_e...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/available_phone_numbers_controller.rb
Ruby
mit
95
develop
319
module Dashboard class AvailablePhoneNumbersController < DashboardController def index @resources = paginate_resources(apply_filters(scope)) end private def scope current_account.available_phone_numbers end def filter_class(*) AvailablePhoneNumberFilter end end end
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/imports_controller.rb
Ruby
mit
95
develop
895
module Dashboard class ImportsController < DashboardController def index @resources = paginate_resources(current_user.imports) end def create @import = build_import if @import.save ExecuteWorkflowJob.perform_later(ImportCSV.to_s, @import) flash[:notice] = "Your import is...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/carrier_settings_controller.rb
Ruby
mit
95
develop
940
module Dashboard class CarrierSettingsController < DashboardController self.action_on_open_redirect = :log def show @resource = current_carrier end def edit @resource = CarrierSettingsForm.initialize_with(current_carrier) end def update @resource = CarrierSettingsForm.new(...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/destination_tariffs_controller.rb
Ruby
mit
95
develop
206
module Dashboard class DestinationTariffsController < DashboardController def new @resource = DestinationTariffForm.new(schedule: TariffSchedule.new(carrier: current_carrier)) end end end
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/broadcasts_controller.rb
Ruby
mit
95
develop
1,045
module Dashboard class BroadcastsController < DashboardController Badge = Data.define(:color, :icon) helper_method :broadcast_badge def index @broadcasts = FakeResource::Broadcast.where(country_code: current_carrier.country_code) end def show @broadcast = FakeResource::Broadcast.fin...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/tariff_schedules_controller.rb
Ruby
mit
95
develop
1,612
module Dashboard class TariffSchedulesController < DashboardController def index @resources = apply_filters(scope.includes(destination_tariffs: [ :destination_group, :tariff ])) @resources = paginate_resources(@resources) end def new @resource = TariffScheduleForm.new(carrier: current_c...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/tariff_package_wizards_controller.rb
Ruby
mit
95
develop
618
module Dashboard class TariffPackageWizardsController < DashboardController def new @resource = TariffPackageWizardForm.new(carrier: current_carrier) end def create @resource = TariffPackageWizardForm.new(carrier: current_carrier, **permitted_params) CreateTariffPackageWizardForm.call(@...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/sms_gateways_controller.rb
Ruby
mit
95
develop
1,236
module Dashboard class SMSGatewaysController < DashboardController def index @resources = apply_filters(sms_gateways_scope.includes(:channel_groups, :channels)) @resources = paginate_resources(@resources) end def new @resource = initialize_form end def create @resource = ...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/webhook_request_logs_controller.rb
Ruby
mit
95
develop
397
module Dashboard class WebhookRequestLogsController < DashboardController def index @resources = apply_filters(request_logs_scope.includes(:event)) @resources = paginate_resources(@resources) end def show @resource = request_logs_scope.find(params[:id]) end private def req...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/sms_gateway_channel_groups_controller.rb
Ruby
mit
95
develop
1,391
module Dashboard class SMSGatewayChannelGroupsController < DashboardController def index @resources = apply_filters(scope.includes(:sms_gateway)) @resources = paginate_resources(@resources) end def new @resource = initialize_form end def create permitted_params = required...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/verifications_controller.rb
Ruby
mit
95
develop
417
module Dashboard class VerificationsController < DashboardController def index @resources = apply_filters(scope.includes(:verification_service, :account)) @resources = paginate_resources(@resources) end def show @resource = record end private def scope parent_scope.v...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/phone_numbers_controller.rb
Ruby
mit
95
develop
1,823
module Dashboard class PhoneNumbersController < DashboardController def index @filtered_resources = apply_filters(scope.includes(:active_plan)) @resources = paginate_resources(@filtered_resources) end def new @resource = initialize_form end def create @resource = initiali...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/account_memberships_controller.rb
Ruby
mit
95
develop
1,399
module Dashboard class AccountMembershipsController < DashboardController def index @resources = apply_filters(account_memberships_scope.includes(:user)) @resources = paginate_resources(@resources) end def show @resource = record end def new @resource = initialize_form ...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/account_sessions_controller.rb
Ruby
mit
95
develop
571
module Dashboard class AccountSessionsController < DashboardController def create account_membership = account_memberships_scope.find(permitted_params[:id]) current_user.update!(current_account_membership: account_membership) session[:current_account_membership] = account_membership.id red...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/tts_events_controller.rb
Ruby
mit
95
develop
423
module Dashboard class TTSEventsController < DashboardController def index @resources = apply_filters(tts_events_scope.includes(:account)) @resources = paginate_resources(@resources) end def show @resource = record end private def tts_events_scope current_carrier.tts...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/tariff_plans_controller.rb
Ruby
mit
95
develop
1,737
module Dashboard class TariffPlansController < DashboardController def index @resources = apply_filters(scope.includes(:schedules)) @resources = paginate_resources(@resources) end def new @resource = TariffPlanForm.new( carrier: current_carrier, **request.query_parameter...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/events_controller.rb
Ruby
mit
95
develop
347
module Dashboard class EventsController < DashboardController def index @resources = apply_filters(scope.includes(:phone_call, :message)) @resources = paginate_resources(@resources) end def show @resource = scope.find(params[:id]) end private def scope current_carrie...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/messaging_services_controller.rb
Ruby
mit
95
develop
1,708
module Dashboard class MessagingServicesController < DashboardController def index @resources = apply_filters(scope.includes(:account, :incoming_phone_numbers)) @resources = paginate_resources(@resources) end def show @resource = record end def edit @resource = MessagingS...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/messages_controller.rb
Ruby
mit
95
develop
384
module Dashboard class MessagesController < DashboardController def index @resources = apply_filters(scope.includes(:account)) @resources = paginate_resources(@resources) end def show @resource = record end private def scope parent_scope.messages end def rec...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/error_logs_controller.rb
Ruby
mit
95
develop
244
module Dashboard class ErrorLogsController < DashboardController def index @resources = paginate_resources(apply_filters(scope.includes(:account))) end private def scope parent_scope.error_logs end end end
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/sip_trunks_controller.rb
Ruby
mit
95
develop
1,468
module Dashboard class SIPTrunksController < DashboardController def index @resources = apply_filters(sip_trunks_scope) @resources = paginate_resources(@resources) end def new @resource = initialize_form end def create @resource = initialize_form(permitted_params) C...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/incoming_phone_numbers_controller.rb
Ruby
mit
95
develop
1,050
module Dashboard class IncomingPhoneNumbersController < DashboardController def index @resources = paginate_resources(apply_filters(scope)) end def show @resource = record end def edit @resource = IncomingPhoneNumberForm.initialize_with(record) end def update @re...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/notification_preferences_controller.rb
Ruby
mit
95
develop
694
module Dashboard class NotificationPreferencesController < DashboardController def edit @resource = NotificationPreferencesForm.initialize_with(current_user) end def update @resource = NotificationPreferencesForm.new(permitted_params) @resource.user = current_user @resource.save ...
github
somleng/somleng
https://github.com/somleng/somleng
app/controllers/dashboard/account_settings_controller.rb
Ruby
mit
95
develop
723
module Dashboard class AccountSettingsController < DashboardController def show @resource = current_account end def edit @resource = AccountSettingsForm.initialize_with(current_account) end def update @resource = AccountSettingsForm.new(permitted_params) @resource.account...
github
somleng/somleng
https://github.com/somleng/somleng
config/application.rb
Ruby
mit
95
develop
2,136
require_relative "boot" require "active_model/railtie" require "active_job/railtie" require "active_record/railtie" require "active_storage/engine" require "action_cable/engine" require "action_controller/railtie" require "action_view/railtie" require "action_mailer/railtie" require "rails/test_unit/railtie" # Requir...
github
somleng/somleng
https://github.com/somleng/somleng
config/puma.rb
Ruby
mit
95
develop
1,687
# This configuration file will be evaluated by Puma. The top-level methods that # are invoked here are part of Puma's configuration DSL. For more information # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. # Puma can serve each request in a thread from an internal thread pool. # The `threa...
github
somleng/somleng
https://github.com/somleng/somleng
config/routes.rb
Ruby
mit
95
develop
8,469
Rails.application.routes.draw do scope( as: :api, constraints: { subdomain: [ AppSettings.fetch(:api_subdomain) ] }, defaults: { format: "json" } ) do concern :recordings do resources :recordings, only: %i[index], path: "Recordings" resources :recordings, only: %i[show], path: ...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/recaptcha.rb
Ruby
mit
95
develop
246
Recaptcha.configure do |config| config.site_key = Rails.configuration.app_settings.fetch(:recaptcha_site_key) config.secret_key = Rails.configuration.app_settings.fetch(:recaptcha_secret_key) config.skip_verify_env += [ "development" ] end
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/call_service.rb
Ruby
mit
95
develop
548
CallService.configure do |config| config.default_host = Rails.configuration.app_settings.fetch(:call_service_default_host) config.default_region = Rails.configuration.app_settings.fetch(:call_service_default_region) config.username = Rails.configuration.app_settings.fetch(:call_service_username) config.password...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/devise.rb
Ruby
mit
95
develop
15,085
# frozen_string_literal: true # Assuming you have not yet modified this file, each configuration option below # is set to its default value. Note that some are commented out while others # are not: uncommented lines are intended to protect your configuration from # breaking changes in upgrades (i.e., in the event that...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/filter_parameter_logging.rb
Ruby
mit
95
develop
486
# Be sure to restart your server when you modify this file. # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. # Use this to limit dissemination of sensitive information. # See the ActiveSupport::ParameterFilter documentation for supported notations and behavio...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/assets.rb
Ruby
mit
95
develop
585
# Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = "1.0" # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path # Precompile additional...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/sentry.rb
Ruby
mit
95
develop
459
Sentry.init do |config| config.traces_sample_rate = 0.1 config.dsn = Rails.configuration.app_settings[:sentry_dsn] config.excluded_exceptions += [ "ProcessCDRJob::Handler::UnknownPhoneCallError", "ProcessCDRJob::Handler::InvalidStateTransitionError", "ProcessCDRJob::Handler::CDRAlreadyExistsError", ...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/country_select.rb
Ruby
mit
95
develop
243
CountrySelect::FORMATS[:with_dialing_country_code] = lambda do |country| "#{country.iso_short_name} (#{country.common_name})" end CountrySelect::FORMATS[:with_flag] = lambda do |country| "#{country.emoji_flag} #{country.common_name}" end
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/shoryuken.rb
Ruby
mit
95
develop
932
# Reduce the number of requests against SQS # https://github.com/ruby-shoryuken/shoryuken/wiki/Shoryuken-options#cache_visibility_timeout Shoryuken.cache_visibility_timeout = true Shoryuken.configure_server do |config| config.on(:startup) do @server_pid = OkComputer::RackServer.run! end config.on(:shutdown)...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/simple_form_bootstrap.rb
Ruby
mit
95
develop
14,674
# frozen_string_literal: true # These defaults are defined and maintained by the community at # https://github.com/heartcombo/simple_form-bootstrap # Please submit feedback, changes and tests only there. # Uncomment this and change the path if necessary to include your own # components. # See https://github.com/heart...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/mime_types.rb
Ruby
mit
95
develop
360
# Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf Mime::Type.register("audio/x-wav", :wav) Mime::Type.register("audio/mpeg", :mp3) Mime::Type.register( "application/vnd.api+json", :json, %w[application/vnd.a...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/app_settings.rb
Ruby
mit
95
develop
772
class AppSettings class << self attr_writer :redis_client def app_uri Addressable::URI.parse(fetch(:app_url_host)) end def fetch(key) value = config.fetch(key) raise "Missing configuration for: #{key}" if value.blank? value end def stub_rating_engine? Rails.env...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/show_for.rb
Ruby
mit
95
develop
2,054
# Use this setup block to configure all options available in ShowFor. ShowFor.setup do |config| # The tag which wraps show_for calls. config.show_for_tag = :dl # The DOM class set for show_for tag. Default is nil config.show_for_class = :row # The tag which wraps each attribute/association call. Default is ...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/doorkeeper.rb
Ruby
mit
95
develop
5,324
require_relative "../../app/models/api_authorization_request" Doorkeeper.configure do # Change the ORM that doorkeeper will use (needs plugins) orm :active_record # This block will be called to check whether the resource owner is authenticated or not. resource_owner_authenticator do # Put your resource ow...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/simple_form.rb
Ruby
mit
95
develop
6,904
# frozen_string_literal: true # # Uncomment this and change the path if necessary to include your own # components. # See https://github.com/heartcombo/simple_form#custom-components to know # more about custom components. # Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f } # # Use this setup block ...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/inflections.rb
Ruby
mit
95
develop
1,179
# Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: # ActiveSupport::Inflector.inflections(:en) do |inflec...
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/aws_stubs.rb
Ruby
mit
95
develop
1,563
if Rails.env.development? || Rails.env.test? ENV["AWS_DEFAULT_REGION"] ||= "ap-southeast-1" ENV["AWS_ACCESS_KEY_ID"] ||= "access-key-id" ENV["AWS_SECRET_ACCESS_KEY"] ||= "secret-key" Aws.config[:sqs] ||= { stub_responses: { send_message: Aws::SQS::Client.new.stub_data(:send_message) } } Aws....
github
somleng/somleng
https://github.com/somleng/somleng
config/initializers/rating_engine.rb
Ruby
mit
95
develop
278
CGRateS.configure do |config| config.host = Rails.configuration.app_settings.fetch(:rating_engine_host) config.username = Rails.configuration.app_settings.fetch(:rating_engine_username) config.password = Rails.configuration.app_settings.fetch(:rating_engine_password) end
github
somleng/somleng
https://github.com/somleng/somleng
config/environments/production.rb
Ruby
mit
95
develop
5,593
require "active_support/core_ext/integer/time" Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.enable_reloading = false # Eager load code on boot. This eager loads most of Rails and # your app...
github
somleng/somleng
https://github.com/somleng/somleng
config/environments/development.rb
Ruby
mit
95
develop
3,139
require "active_support/core_ext/integer/time" Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded any time # it changes. This slows down response time but is perfect for developme...
github
somleng/somleng
https://github.com/somleng/somleng
config/environments/test.rb
Ruby
mit
95
develop
2,693
require "active_support/core_ext/integer/time" # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data the...
github
somleng/somleng
https://github.com/somleng/somleng
db/application_seeder.rb
Ruby
mit
95
develop
7,236
class ApplicationSeeder USER_PASSWORD = "Somleng1234!".freeze BILLING_CURRENCY = "USD" RATES = { outbound_calls: InfinitePrecisionMoney.from_amount(0.10, BILLING_CURRENCY), inbound_calls: InfinitePrecisionMoney.from_amount(0.02, BILLING_CURRENCY), outbound_messages: InfinitePrecisionMoney.from_amount(...
github
somleng/somleng
https://github.com/somleng/somleng
db/schema.rb
Ruby
mit
95
develop
60,468
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # This file is the source Rails uses to define your schema when running `bin/rai...
github
somleng/somleng
https://github.com/somleng/somleng
db/migrate/20220209070302_remove_attr_encrypted_fields.rb
Ruby
mit
95
develop
265
class RemoveAttrEncryptedFields < ActiveRecord::Migration[7.0] def change remove_column :users, :encrypted_otp_secret, :string remove_column :users, :encrypted_otp_secret_salt, :string remove_column :users, :encrypted_otp_secret_iv, :string end end
github
somleng/somleng
https://github.com/somleng/somleng
db/migrate/20200905055706_remove_price_from_call_data_records.rb
Ruby
mit
95
develop
203
class RemovePriceFromCallDataRecords < ActiveRecord::Migration[6.0] def change remove_column(:call_data_records, :price_microunits) remove_column(:call_data_records, :price_currency) end end
github
somleng/somleng
https://github.com/somleng/somleng
db/migrate/20240111122818_add_internal_to_messages.rb
Ruby
mit
95
develop
229
class AddInternalToMessages < ActiveRecord::Migration[7.1] def change add_column :messages, :internal, :boolean, null: false, default: false add_index :messages, :internal add_index :messages, :created_at end end
github
somleng/somleng
https://github.com/somleng/somleng
db/migrate/20230208091053_create_pghero_query_stats.rb
Ruby
mit
95
develop
387
class CreatePgheroQueryStats < ActiveRecord::Migration[7.0] def change create_table :pghero_query_stats do |t| t.text :database t.text :user t.text :query t.integer :query_hash, limit: 8 t.float :total_time t.integer :calls, limit: 8 t.timestamp :captured_at end ...
github
somleng/somleng
https://github.com/somleng/somleng
db/migrate/20240118052751_set_beneficiary_data_to_nullable_for_interactions.rb
Ruby
mit
95
develop
245
class SetBeneficiaryDataToNullableForInteractions < ActiveRecord::Migration[7.1] def change change_column_null(:interactions, :beneficiary_country_code, true) change_column_null(:interactions, :beneficiary_fingerprint, true) end end
github
somleng/somleng
https://github.com/somleng/somleng
db/migrate/20250617070334_add_index_on_phone_calls_on_account_id_internal_and_sequence_number.rb
Ruby
mit
95
develop
310
class AddIndexOnPhoneCallsOnAccountIDInternalAndSequenceNumber < ActiveRecord::Migration[8.0] disable_ddl_transaction! def change add_index( :phone_calls, [ :account_id, :internal, :sequence_number ], order: { sequence_number: :desc }, algorithm: :concurrently ) end end
github
somleng/somleng
https://github.com/somleng/somleng
db/migrate/20240418142625_add_iso_country_code_to_phone_numbers.rb
Ruby
mit
95
develop
213
class AddISOCountryCodeToPhoneNumbers < ActiveRecord::Migration[7.1] def change add_column(:phone_numbers, :iso_country_code, :string, null: false) add_index(:phone_numbers, :iso_country_code) end end
github
somleng/somleng
https://github.com/somleng/somleng
db/migrate/20220207045007_migrate_otp_code.rb
Ruby
mit
95
develop
851
# We just need this to migrate from attr_encrypted to use Rails encryption. # We could remove the `encrypted_otp_*` after we run this migration. # https://github.com/tinfoil/devise-two-factor/issues/192#issuecomment-1022504126 class MigrateOTPCode < ActiveRecord::Migration[7.0] def up add_column :users, :otp_secr...
github
somleng/somleng
https://github.com/somleng/somleng
db/migrate/20220418074234_create_imports.rb
Ruby
mit
95
develop
523
class CreateImports < ActiveRecord::Migration[7.0] def change create_table :imports, id: :uuid do |t| t.string :resource_type, null: false t.string :status, null: false t.string :error_message t.references :user, foreign_key: { on_delete: :cascade }, type: :uuid, null: false t.refere...
github
somleng/somleng
https://github.com/somleng/somleng
db/migrate/20240120012810_add_phone_number_id_to_verification_delivery_attempts.rb
Ruby
mit
95
develop
224
class AddPhoneNumberIDToVerificationDeliveryAttempts < ActiveRecord::Migration[7.1] def change add_reference(:verification_delivery_attempts, :phone_number, type: :uuid, foreign_key: { on_delete: :nullify }) end end
github
somleng/somleng
https://github.com/somleng/somleng
db/migrate/20240118053629_set_beneficiary_data_to_nullable_for_phone_calls.rb
Ruby
mit
95
develop
241
class SetBeneficiaryDataToNullableForPhoneCalls < ActiveRecord::Migration[7.1] def change change_column_null(:phone_calls, :beneficiary_country_code, true) change_column_null(:phone_calls, :beneficiary_fingerprint, true) end end
github
somleng/somleng
https://github.com/somleng/somleng
db/migrate/20220422053524_update_foreign_keys_on_phone_calls.rb
Ruby
mit
95
develop
819
class UpdateForeignKeysOnPhoneCalls < ActiveRecord::Migration[7.0] def up remove_foreign_key :phone_calls, :inbound_sip_trunks remove_foreign_key :phone_calls, :outbound_sip_trunks remove_foreign_key :phone_calls, :phone_numbers add_foreign_key :phone_calls, :inbound_sip_trunks, on_delete: :nullify ...
github
somleng/somleng
https://github.com/somleng/somleng
db/migrate/20240504084912_add_columns_for_live_call_updates_to_phone_calls.rb
Ruby
mit
95
develop
371
class AddColumnsForLiveCallUpdatesToPhoneCalls < ActiveRecord::Migration[7.1] def change add_column(:phone_calls, :call_service_host, :inet) add_column(:phone_calls, :user_terminated_at, :datetime) add_index(:phone_calls, :user_terminated_at) add_column(:phone_calls, :user_updated_at, :datetime) a...