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 | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/jobs/lesson_rating_job_spec.rb | Ruby | mit | 19 | main | 380 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe LessonRatingJob do
after do
Sidekiq::Job.clear_all
end
describe '#perform_async' do
it 'ensures the job is enqueued' do
Sidekiq::Testing.fake! do
expect do
described_class.perform_async
end.to change(des... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/jobs/course_rating_job_spec.rb | Ruby | mit | 19 | main | 380 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe CourseRatingJob do
after do
Sidekiq::Job.clear_all
end
describe '#perform_async' do
it 'ensures the job is enqueued' do
Sidekiq::Testing.fake! do
expect do
described_class.perform_async
end.to change(des... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/jobs/extract_and_save_audio_job_spec.rb | Ruby | mit | 19 | main | 3,642 | # rubocop:disable RSpec/VerifiedDoubles
# frozen_string_literal: true
require 'rails_helper'
describe ExtractAndSaveAudioJob do
let(:job) { described_class.new }
let(:local_content) { instance_double(LocalContent, id: 1, video: video_attachment, audio: audio_attachment) }
let(:video_attachment) { double('video_... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/jobs/upload_video_to_vimeo_job_spec.rb | Ruby | mit | 19 | main | 386 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe UploadVideoToVimeoJob do
after do
Sidekiq::Job.clear_all
end
describe '#perform_async' do
it 'ensures the job is enqueued' do
Sidekiq::Testing.fake! do
expect do
described_class.perform_async
end.to chan... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/jobs/generate_course_certificate_job_spec.rb | Ruby | mit | 19 | main | 656 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe GenerateCourseCertificateJob do
let(:learner) { create :user, :learner }
let(:learning_partner) { create(:learning_partner) }
let(:course) { create :course }
let(:certificate_template) { create(:certificate_template, learning_partner:) }
a... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/jobs/communication_channels/send_whatsapp_message_job_spec.rb | Ruby | mit | 19 | main | 440 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe CommunicationChannels::SendWhatsappMessageJob do
after do
Sidekiq::Job.clear_all
end
describe '#perform_async' do
it 'ensures the job is enqueued' do
Sidekiq::Testing.fake! do
expect do
described_class.perform_a... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/jobs/communication_channels/send_sms_job_spec.rb | Ruby | mit | 19 | main | 441 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe CommunicationChannels::SendSmsJob do
after do
Sidekiq::Job.clear_all
end
describe '#perform_async' do
it 'ensures the job is enqueued' do
Sidekiq::Testing.fake! do
expect do
described_class.perform_async('12345'... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/channels/notifications_channel_spec.rb | Ruby | mit | 19 | main | 626 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe NotificationsChannel, type: :channel do
let(:user) { create(:user, :learner) }
before do
stub_connection current_user: user
end
it 'successfully subscribes and streams for the current_user' do
subscribe
expect(subscription).to ... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/audio_transcription_service_spec.rb | Ruby | mit | 19 | main | 1,470 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe AudioTranscriptionService do
let(:service) { described_class.instance }
let(:audio) { instance_double(ActiveStorage::Blob) }
let(:file) { instance_double(File, path: '/tmp/audio.mp3') }
let(:llm_instance) { instance_double(Integrations::Llm::... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/user_channel_notifier_service_spec.rb | Ruby | mit | 19 | main | 998 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe UserChannelNotifierService do
subject { described_class.instance }
let(:user) { create :user, :learner, communication_channels: %w[whatsapp] }
after do
Sidekiq::Job.clear_all
end
describe 'notify_user' do
it 'enqueues the WhatsAp... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/notification_service_spec.rb | Ruby | mit | 19 | main | 3,534 | # frozen_string_literal: true
RSpec.describe NotificationService do
subject { described_class.instance }
let(:queue_client) { instance_double(Utilities::QueueClient) }
let(:user) { instance_double(User, id: 1) }
let(:notification) { Notification.new(user, Faker::Lorem.sentence, Faker::Lorem.sentence) }
let(... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/ffmpeg_service_spec.rb | Ruby | mit | 19 | main | 2,731 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe FfmpegService do
let(:service) { described_class.instance }
let(:input_path) { Rails.root.join('spec/fixtures/files/sample.mp4').to_s }
before do
allow(File).to receive(:exist?).and_call_original
allow(File).to receive(:readable?).and_... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/create_certificate_template_service_spec.rb | Ruby | mit | 19 | main | 1,618 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe CreateCertificateTemplateService do
subject { described_class.instance }
let(:learning_partner) { create(:learning_partner) }
describe '#generate' do
before do
@zip_file = Rails.root.join('spec/fixtures/files/certificate_template.zi... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/app_config_service_spec.rb | Ruby | mit | 19 | main | 304 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe AppConfigService do
subject { described_class.instance }
describe '#external_video_hosting?' do
it 'returns false for test env' do
expect(described_class.instance.external_video_hosting?).to be(false)
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/auth/otp_service_spec.rb | Ruby | mit | 19 | main | 3,118 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Auth::OtpService, type: :service do
let(:phone) { MobileNumber.new(value: '9999999999', country_code: AVAILABLE_COUNTRIES[:india][:code]) }
let(:cache_key) { "otp:#{phone.value}" }
let(:service) { described_class.new(phone, name: 'Deepak') }
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/reporting/team_report_service_spec.rb | Ruby | mit | 19 | main | 3,687 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Reporting::TeamReportService do
let(:team) { create(:team) }
let(:user) { create(:user, :manager, team: team, learning_partner: team.learning_partner) }
let(:report) { create(:report, team: team, generator: user) }
let(:course) { create(:cour... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/vimeo/delete_video_service_spec.rb | Ruby | mit | 19 | main | 506 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Vimeo::DeleteVideoService do
subject { described_class.instance }
let(:lesson) { create :lesson }
let(:local_content) { lesson.local_contents.first }
describe '#delete_video' do
before do
video_id = '1234'
stub_vimeo_delete_... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/vimeo/upload_video_service_spec.rb | Ruby | mit | 19 | main | 1,039 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Vimeo::UploadVideoService do
subject { described_class.instance }
let(:lesson) { create :lesson }
let(:local_content) { lesson.local_contents.first }
describe '#upload_to_vimeo' do
before do
stub_vimeo_generate_upload_url_api(loca... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/courses/generate_certificate_service_spec.rb | Ruby | mit | 19 | main | 2,847 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Courses::GenerateCertificateService do
subject { described_class.instance }
let(:learner) { create :user, :learner }
let(:course) { create :course }
let(:learning_partner) { create(:learning_partner) }
let(:certificate_template) { create(:... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/courses/rating_service_spec.rb | Ruby | mit | 19 | main | 822 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Courses::RatingService do
subject { described_class.new }
before do
@course = create :course, :published
@course_module = create :course_module, course: @course
@lesson_one = create :lesson, course_module: @course_module
@lesson_... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/courses/filter_adapter_spec.rb | Ruby | mit | 19 | main | 2,752 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Courses::FilterAdapter do
let(:learning_partner) { create(:learning_partner) }
let(:service) { described_class.instance }
let(:category_tags) { create_list(:tag, 3) }
let(:level_tags) { create_list(:tag, 2, tag_type: :level) }
let(:user) {... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/courses/filter_service_spec.rb | Ruby | mit | 19 | main | 9,410 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Courses::FilterService do
let(:learning_partner) { create :learning_partner }
describe 'with search term' do
before do
title = 'My best course'
@published1 = create :course, :published, title: title
@published2 = create :co... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/webhooks/chatwoot_notifier_service_spec.rb | Ruby | mit | 19 | main | 2,543 | # frozen_string_literal: true
RSpec.describe Webhooks::ChatwootNotifierService, type: :service do
subject(:service) { described_class.instance }
let(:incoming_text) { 'Hello from user' }
describe '#notify' do
before do
@params = {
'conversation' => {
'id' => '999',
'messag... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/teams/update_total_members_count_service_spec.rb | Ruby | mit | 19 | main | 1,127 | # frozen_string_literal: true
RSpec.describe Teams::UpdateTotalMembersCountService do
subject { described_class.instance }
let(:learning_partner) { create :learning_partner }
let(:parent_team) { create :team, learning_partner: learning_partner }
let(:sub_team_one) { create :team, learning_partner: learning_pa... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/lessons/rating_service_spec.rb | Ruby | mit | 19 | main | 2,491 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Lessons::RatingService do
subject { described_class.instance }
let(:user) { create :user, :learner }
let(:lesson) { create :lesson }
describe '#rate_lesson!' do
it 'logs the lesson rating event' do
expect do
subject.rate_l... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/lessons/update_service_spec.rb | Ruby | mit | 19 | main | 1,075 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Lessons::UpdateService do
subject { described_class.instance }
let(:lesson) { create :lesson }
describe '#update_lesson' do
it 'Update lesson' do
allow(Lessons::PostProcessingService.instance).to receive(:process_local_contents)
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/lessons/create_service_spec.rb | Ruby | mit | 19 | main | 1,163 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Lessons::CreateService do
subject { described_class.instance }
let(:course_module) { create :course_module }
describe '#create_lesson' do
it 'creates lesson' do
allow(Lessons::PostProcessingService.instance).to receive(:process_loca... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/impersonations/find_or_create_support_user_service_spec.rb | Ruby | mit | 19 | main | 777 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Impersonations::FindOrCreateSupportUserService do
subject { described_class.instance }
before do
@team = create :team
end
describe '#find_or_create_user' do
it 'returns support user if already present' do
@support_user = creat... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/quizzes/generation_service_spec.rb | Ruby | mit | 19 | main | 3,474 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Quizzes::GenerationService, type: :service do
let(:course) { create(:course) }
let(:course_module) { create(:course_module, course: course) }
let!(:lesson_intro) { create(:lesson, course_module: course_module, title: 'Introduction') }
let!(:... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/services/users/filter_service_spec.rb | Ruby | mit | 19 | main | 1,644 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Users::FilterService do
describe 'with search term' do
before(:all) do
@team = create :team
@learning_partner = @team.learning_partner
@team2 = create :team, learning_partner: @learning_partner
@user1 = create :user, :l... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/stubs/chatwoot_stubs.rb | Ruby | mit | 19 | main | 541 | # frozen_string_literal: true
def stub_chatwoot_api(conversation_id, llm_response, account_id)
expected_body = { content: llm_response.data, message_type: 'outgoing' }.to_json
stub_request(:post, "https://app.chatwoot.com/api/v1/accounts/#{account_id}/conversations/#{conversation_id}/messages")
.with(
b... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/stubs/msg91_stubs.rb | Ruby | mit | 19 | main | 617 | # frozen_string_literal: true
def stub_msg91_sms_api(mobile_number, variables_values, template_id)
stub_request(
:post,
Rails.application.credentials.dig(:msg91, :url)
).with(
headers: {
'authkey' => Rails.application.credentials.dig(:msg91, :auth_key),
'accept' => 'application/json',
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/stubs/fast2sms_stubs.rb | Ruby | mit | 19 | main | 636 | # frozen_string_literal: true
def stub_fast2sms_api(mobile_number, variables_values, template_id)
stub_request(
:post,
'https://www.fast2sms.com/dev/bulkV2'
).with(
headers: {
'authorization' => Rails.application.credentials.dig(:fast2sms, :auth_key),
'Content-Type' => 'application/x-www-fo... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/stubs/whatsapp_stubs.rb | Ruby | mit | 19 | main | 608 | # frozen_string_literal: true
def stub_whatsapp_api(mobile_number, template)
stub_request(
:post,
Rails.application.credentials.dig(:whatsapp, :url)
).with(
headers: {
'Authorization' => "Bearer #{Rails.application.credentials.dig(:whatsapp, :auth_token)}",
'Content-Type' => 'application/js... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/stubs/vimeo_api_stubs.rb | Ruby | mit | 19 | main | 1,502 | # frozen_string_literal: true
def stub_vimeo_generate_upload_url_api(file)
stub_request(
:post,
'https://api.vimeo.com/me/videos'
).with(headers: {
'Authorization' => "bearer #{Rails.application.credentials.dig(:vimeo, :access_token)}",
'Accept' => 'application/vnd.vimeo.*+json;versio... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/controllers/application_controller_spec.rb | Ruby | mit | 19 | main | 1,669 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe ApplicationController, type: :controller do
controller do
def index
render plain: 'ok'
end
end
let(:user) { create(:user, :learner) }
before { sign_in user }
describe '#set_active_nav' do
context 'when on a top-level co... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/controllers/programs_controller_spec.rb | Ruby | mit | 19 | main | 1,103 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe ProgramsController, type: :controller do
let(:user) { create(:user, :manager) }
let(:program) { create(:program, learning_partner: user.learning_partner) }
before { sign_in user }
describe '#set_programs_active_nav' do
context 'when on ... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/controllers/courses_controller_spec.rb | Ruby | mit | 19 | main | 934 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe CoursesController, type: :controller do
let(:user) { create(:user, :admin) }
let(:course) { create(:course, :published) }
before { sign_in user }
describe '#set_course_active_nav' do
context 'when mode is manager' do
it 'sets @act... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | spec/adapters/scorm_adapter_spec.rb | Ruby | mit | 19 | main | 445 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe ScormAdapter do
let(:course) { create :course }
let(:learning_partner) { create :learning_partner }
let(:scorm) { create :scorm, learning_partner: }
describe '#process' do
it 'returns course object' do
scorm_adaptor_service = descr... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/puma.rb | Ruby | mit | 19 | main | 1,962 | # 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 starts a configurable number of processes (workers) and each process
# serve... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/application.rb | Ruby | mit | 19 | main | 1,276 | # frozen_string_literal: true
require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Blackboard
# Blackboard LMS application
class Application < Rails::Application
# I... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/importmap.rb | Ruby | mit | 19 | main | 862 | # frozen_string_literal: true
# Pin npm packages by running ./bin/importmap
pin 'application'
pin '@hotwired/turbo-rails', to: 'turbo.min.js'
pin '@hotwired/stimulus', to: 'stimulus.min.js'
pin '@hotwired/stimulus-loading', to: 'stimulus-loading.js'
pin_all_from 'app/javascript/controllers', under: 'controllers'
pin ... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/routes.rb | Ruby | mit | 19 | main | 5,804 | # frozen_string_literal: true
Rails.application.routes.draw do
resources :user_searches, only: %i[index create]
resources :reports, only: %i[new create show]
namespace :webhooks do
resources :chatwoot, only: :create, defaults: { format: :json }
end
resources :searches, only: [:index] do
collection ... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/routes/sidekiq_web.rb | Ruby | mit | 19 | main | 638 | # frozen_string_literal: true
Rails.application.routes.draw do
require 'sidekiq/web'
require 'sidekiq/cron/web'
def _secure_compare(sig1, sig2)
ActiveSupport::SecurityUtils.secure_compare(Digest::SHA256.hexdigest(sig1), Digest::SHA256.hexdigest(sig2))
end
if APP_CONFIG.sidekiq_auth_enabled?
Sidekiq... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/routes/catch_all.rb | Ruby | mit | 19 | main | 208 | # frozen_string_literal: true
Rails.application.routes.draw do
match ':url', to: 'application#not_found', via: :all, url: /.*/, constraints: lambda { |request|
request.path.exclude?('/rails/')
}
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/routes/v1_api.rb | Ruby | mit | 19 | main | 433 | # frozen_string_literal: true
Rails.application.routes.draw do
namespace :api, defaults: { format: :json } do
namespace :v1 do
resources :otps, only: [] do
collection do
post :generate
post :verify
end
end
resource :one_timer_task, only: [] do
collect... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/environments/staging.rb | Ruby | mit | 19 | main | 4,592 | # frozen_string_literal: true
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... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/environments/production.rb | Ruby | mit | 19 | main | 5,289 | # frozen_string_literal: true
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... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/environments/docker.rb | Ruby | mit | 19 | main | 4,614 | # frozen_string_literal: true
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... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/environments/test.rb | Ruby | mit | 19 | main | 2,913 | # frozen_string_literal: true
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 r... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/environments/development.rb | Ruby | mit | 19 | main | 3,185 | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Make code changes take effect immediately without server restart.
config.enable_reloading = true
# Do not eager load code on boot.
config.eager... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/initializers/sidekiq.rb | Ruby | mit | 19 | main | 1,756 | # frozen_string_literal: true
require 'sidekiq'
require 'sidekiq-cron'
require 'sidekiq-unique-jobs'
if Rails.env.test?
require 'sidekiq/testing'
Sidekiq::Testing.inline!
end
Sidekiq.logger.level = Logger::WARN if Rails.env.test?
Sidekiq.configure_server do |config|
config.redis = { url: Rails.application.cre... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/initializers/constants.rb | Ruby | mit | 19 | main | 1,220 | # frozen_string_literal: true
require Rails.root.join('app/services/event_service.rb').to_path
require Rails.root.join('app/services/app_config_service.rb').to_path
EVENT_LOGGER = EventService.instance
APP_CONFIG = AppConfigService.instance
REDIS_CLIENT = RedisClient
.config(url: Rails.application.cre... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/initializers/new_framework_defaults_8_0.rb | Ruby | mit | 19 | main | 1,340 | # frozen_string_literal: true
# Be sure to restart your server when you modify this file.
#
# This file eases your Rails 8.0 framework defaults upgrade.
#
# Uncomment each configuration one by one to switch to the new default.
# Once your application is ready to run with all new defaults, you can remove
# this file an... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/initializers/bullet.rb | Ruby | mit | 19 | main | 574 | # frozen_string_literal: true
if Rails.env.local? && defined?(Bullet)
Bullet.enable = true
Bullet.bullet_logger = true
Bullet.rails_logger = true
Bullet.raise = true
Bullet.n_plus_one_query_enable = true
Bullet.unused_eager_loading_enable = true
Bullet.counter_cache_enable = true
# Locally courses h... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/initializers/cors.rb | Ruby | mit | 19 | main | 203 | # frozen_string_literal: true
Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins '*'
resource '/embeds/*', headers: ['X-Scorm-Token'], methods: :get
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/initializers/devise.rb | Ruby | mit | 19 | main | 15,253 | # 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 | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/initializers/sentry.rb | Ruby | mit | 19 | main | 594 | # frozen_string_literal: true
Sentry.init do |config|
config.dsn = Rails.application.credentials.dig(:sentry, :dsn)
config.breadcrumbs_logger = %i[active_support_logger http_logger]
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for tracing.
# We recommend adjusting this value in producti... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/initializers/ruby_llm.rb | Ruby | mit | 19 | main | 313 | # frozen_string_literal: true
RubyLLM.configure do |config|
config.gemini_api_key = Rails.application.credentials.dig(:llm_token, :gemini)
config.openai_api_key = Rails.application.credentials.dig(:llm_token, :openai)
# to connect ollama locally
config.ollama_api_base = 'http://localhost:11434/v1'
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/initializers/kaminari_config.rb | Ruby | mit | 19 | main | 349 | # frozen_string_literal: true
Kaminari.configure do |config|
config.default_per_page = 12
# config.max_per_page = nil
config.window = 5
# config.outer_window = 0
# config.left = 0
# config.right = 0
# config.page_method_name = :page
# config.param_name = :page
# config.max_pages = nil
# config.para... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | config/initializers/active_storage_blob_extensions.rb | Ruby | mit | 19 | main | 371 | # frozen_string_literal: true
ActiveSupport.on_load(:active_storage_blob) do
before_destroy :delete_from_vimeo, if: :s3_video_store?
private
def s3_video_store?
service_name == 's3_video_store'
end
def delete_from_vimeo
blob = ActiveStorage::Blob.find_by!(key:)
url = blob.metadata[:url]
De... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/seeds.rb | Ruby | mit | 19 | main | 5,847 | # frozen_string_literal: true
# This file should ensure the existence of records required to run the application in every environment (production,
# development, test). The code here should be idempotent so that it can be executed at any point in every environment.
# The data can then be loaded with the bin/rails db:s... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/schema.rb | Ruby | mit | 19 | main | 18,543 | # 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 | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240325130945_create_courses.rb | Ruby | mit | 19 | main | 214 | # frozen_string_literal: true
class CreateCourses < ActiveRecord::Migration[7.1]
def change
create_table :courses do |t|
t.string :title
t.text :description
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240320122216_create_users.rb | Ruby | mit | 19 | main | 204 | # frozen_string_literal: true
class CreateUsers < ActiveRecord::Migration[7.1]
def change
create_table :users do |t|
t.string :name
t.string :role
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20241212040606_update_user_count_in_partners.rb | Ruby | mit | 19 | main | 232 | class UpdateUserCountInPartners < ActiveRecord::Migration[7.2]
def up
LearningPartner.all.each do |partner|
LearningPartner.reset_counters(partner.id, :users)
end
end
def down
# no rollback needed
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240625073539_create_quiz_answers.rb | Ruby | mit | 19 | main | 318 | # frozen_string_literal: true
class CreateQuizAnswers < ActiveRecord::Migration[7.1]
def change
create_table :quiz_answers do |t|
t.string :status
t.references :quiz, null: false, foreign_key: true
t.references :enrollment, null: false, foreign_key: true
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240612105726_add_fields_to_enrollments.rb | Ruby | mit | 19 | main | 230 | # frozen_string_literal: true
class AddFieldsToEnrollments < ActiveRecord::Migration[7.1]
def change
add_column :enrollments, :current_module_id, :integer
add_column :enrollments, :current_lesson_id, :integer
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20251110071325_add_visibility_column_to_courses.rb | Ruby | mit | 19 | main | 288 | class AddVisibilityColumnToCourses < ActiveRecord::Migration[8.0]
def up
add_column :courses, :visibility, :string
Course.update_all(visibility: "private")
change_column_null :courses, :visibility, false
end
def down
remove_column :courses, :visibility
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250710105051_team_and_user_to_reports.rb | Ruby | mit | 19 | main | 331 | class TeamAndUserToReports < ActiveRecord::Migration[8.0]
def change
add_reference :reports, :team, null: true, foreign_key: true
add_reference :reports, :user, null: true, foreign_key: true
# this is to take advantage of the add_reference function above
rename_column :reports, :user_id, :generated_by... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20241021122945_add_completed_moduels_to_enrollment.rb | Ruby | mit | 19 | main | 248 | class AddCompletedModuelsToEnrollment < ActiveRecord::Migration[7.1]
def change
add_column :enrollments, :completed_modules, :bigint, array: true, default: []
add_column :enrollments, :course_completed, :boolean, default: false
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20241204121313_create_tags.rb | Ruby | mit | 19 | main | 228 | class CreateTags < ActiveRecord::Migration[7.2]
def change
create_table :tags do |t|
t.string "name", null: false, index: { unique: true }
t.string "tag_type", null: false
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20251103045526_create_transcripts.rb | Ruby | mit | 19 | main | 319 | class CreateTranscripts < ActiveRecord::Migration[8.0]
def change
create_table :transcripts do |t|
t.integer :start_at, null: false
t.integer :end_at, null: false
t.string :text, null: false
t.references :local_content, null: false, foreign_key: true
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240723060933_move_about_partner_to_action_text.rb | Ruby | mit | 19 | main | 220 | # frozen_string_literal: true
class MoveAboutPartnerToActionText < ActiveRecord::Migration[7.1]
def change
LearningPartner.all.find_each do |partner|
partner.update(content: partner.about)
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240621102232_add_completed_lessons_to_enrollment.rb | Ruby | mit | 19 | main | 206 | # frozen_string_literal: true
class AddCompletedLessonsToEnrollment < ActiveRecord::Migration[7.1]
def change
add_column :enrollments, :completed_lessons, :bigint, array: true, default: []
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240721142926_remove_seq_no_from_tables.rb | Ruby | mit | 19 | main | 228 | # frozen_string_literal: true
class RemoveSeqNoFromTables < ActiveRecord::Migration[7.1]
def change
remove_column :course_modules, :seq_no
remove_column :lessons, :seq_no
remove_column :quizzes, :seq_no
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250317155053_add_video_published_at_to_local_contents.rb | Ruby | mit | 19 | main | 413 | class AddVideoPublishedAtToLocalContents < ActiveRecord::Migration[7.2]
def up
add_column :local_contents, :video_published_at, :datetime, null: false, default: -> { 'CURRENT_TIMESTAMP' }
LocalContent.find_each do |local_content|
local_content.update_column(:video_published_at, local_content.updated_at... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250213082939_rename_otp_digest_to_otp_in_users.rb | Ruby | mit | 19 | main | 221 | class RenameOtpDigestToOtpInUsers < ActiveRecord::Migration[7.2]
def change
change_column :users, :otp_digest, :string
rename_column :users, :otp_digest, :otp
add_index :users, :otp, unique: true
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20251212022139_create_questions.rb | Ruby | mit | 19 | main | 443 | class CreateQuestions < ActiveRecord::Migration[8.0]
def change
create_table :questions do |t|
t.text :content, null: false
t.text :options, array: true, null: false, default: []
t.text :answers, array: true, null: false, default: []
t.boolean :is_verified, default: false
t.boolean :... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250819184851_add_supported_countries_column_to_learning_partner.rb | Ruby | mit | 19 | main | 207 | class AddSupportedCountriesColumnToLearningPartner < ActiveRecord::Migration[8.0]
def change
add_column :learning_partners, :supported_countries, :text, array: true, default: [], null: false
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240723063003_move_lesson_description_to_action_text.rb | Ruby | mit | 19 | main | 228 | # frozen_string_literal: true
class MoveLessonDescriptionToActionText < ActiveRecord::Migration[7.1]
def change
Lesson.all.find_each do |lesson|
lesson.update(rich_description: lesson.description)
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20241204145309_create_course_tags.rb | Ruby | mit | 19 | main | 220 | class CreateCourseTags < ActiveRecord::Migration[7.2]
def change
create_table :courses_tags do |t|
t.belongs_to :course, null: false
t.belongs_to :tag, null: false
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250908123153_create_certificate_templates.rb | Ruby | mit | 19 | main | 358 | class CreateCertificateTemplates < ActiveRecord::Migration[8.0]
def change
create_table :certificate_templates do |t|
t.string :name, null: false
t.text :html_content, null: false
t.boolean :active, default: false, null: false
t.references :learning_partner, null: false, foreign_key: true... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20260107204958_create_assessments.rb | Ruby | mit | 19 | main | 739 | class CreateAssessments < ActiveRecord::Migration[8.0]
def change
create_table :assessments do |t|
t.references :user, null: false, foreign_key: true
t.references :course, null: false, foreign_key: true
t.jsonb :questions, default: [], null: false
t.jsonb :responses, default: {}, nu... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240723062238_move_module_description_to_action_text.rb | Ruby | mit | 19 | main | 219 | # frozen_string_literal: true
class MoveModuleDescriptionToActionText < ActiveRecord::Migration[7.1]
def change
CourseModule.all.find_each do |m|
m.update(rich_description: m.description)
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250205091834_add_onboarding_attributes_to_users.rb | Ruby | mit | 19 | main | 255 | # frozen_string_literal: true
class AddOnboardingAttributesToUsers < ActiveRecord::Migration[7.2]
def change
add_column :users, :preferred_local_language, :string
add_column :users, :gender, :string
add_column :users, :dob, :date
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240325132913_create_quizzes.rb | Ruby | mit | 19 | main | 406 | # frozen_string_literal: true
class CreateQuizzes < ActiveRecord::Migration[7.1]
def change
create_table :quizzes do |t|
t.string :question
t.string :quiz_type
t.string :option_a
t.string :option_b
t.string :option_c
t.string :option_d
t.string :answer
t.references... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240821085426_create_teams.rb | Ruby | mit | 19 | main | 274 | # frozen_string_literal: true
class CreateTeams < ActiveRecord::Migration[7.1]
def change
create_table :teams do |t|
t.string :name
t.string :banner
t.references :learning_partner, null: false, foreign_key: true
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250408152105_add_communication_channel_to_users.rb | Ruby | mit | 19 | main | 393 | class AddCommunicationChannelToUsers < ActiveRecord::Migration[7.2]
def up
add_column :users, :communication_channels, :string, array: true, default: ["sms"]
User.reset_column_information
User.update_all(communication_channels: ["sms"])
change_column_null :users, :communication_channels, false
end... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20251117134815_add_not_null_constraint_to_transcripts.rb | Ruby | mit | 19 | main | 250 | class AddNotNullConstraintToTranscripts < ActiveRecord::Migration[8.0]
def change
change_column_null :transcripts, :start_at, false
change_column_null :transcripts, :end_at, false
change_column_null :transcripts, :text, false
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240325131817_create_lessons.rb | Ruby | mit | 19 | main | 397 | # frozen_string_literal: true
class CreateLessons < ActiveRecord::Migration[7.1]
def change
create_table :lessons do |t|
t.string :title
t.text :description
t.string :video_url
t.string :pdf_url
t.string :lesson_type
t.string :video_streaming_source
t.references :course_... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20260115232134_create_issues.rb | Ruby | mit | 19 | main | 290 | class CreateIssues < ActiveRecord::Migration[8.0]
def change
create_table :issues do |t|
t.references :user, null: false, foreign_key: true
t.references :question, null: false, foreign_key: true
t.text :description, null: false
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240321084635_create_learning_partners.rb | Ruby | mit | 19 | main | 226 | # frozen_string_literal: true
class CreateLearningPartners < ActiveRecord::Migration[7.1]
def change
create_table :learning_partners do |t|
t.string :name
t.text :about
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240611160151_create_notifications.rb | Ruby | mit | 19 | main | 278 | # frozen_string_literal: true
class CreateNotifications < ActiveRecord::Migration[7.1]
def change
create_table :notifications do |t|
t.string :ntype
t.string :text
t.references :user, null: false, foreign_key: true
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250218062338_add_expires_at_to_scorms.rb | Ruby | mit | 19 | main | 233 | class AddExpiresAtToScorms < ActiveRecord::Migration[7.2]
def change
add_column :scorms, :expires_at, :datetime
Scorm.update_all(expires_at: 3.months.from_now)
change_column_null :scorms, :expires_at, false
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240723053052_create_action_text_tables.action_text.rb | Ruby | mit | 19 | main | 993 | # frozen_string_literal: true
# This migration comes from action_text (originally 20180528164100)
class CreateActionTextTables < ActiveRecord::Migration[6.0]
def change
# Use Active Record's configured type for primary and foreign keys
primary_key_type, foreign_key_type = primary_and_foreign_key_types
c... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250110092513_update_user_state_for_verified_users.rb | Ruby | mit | 19 | main | 200 | class UpdateUserStateForVerifiedUsers < ActiveRecord::Migration[7.2]
def up
User.where(state: 'unverified').where.not(confirmed_at: nil).update_all(state: 'active')
end
def down
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240710073245_create_local_contents.rb | Ruby | mit | 19 | main | 285 | # frozen_string_literal: true
class CreateLocalContents < ActiveRecord::Migration[7.1]
def change
create_table :local_contents do |t|
t.string :lang
t.string :video_url
t.references :lesson, null: false, foreign_key: true
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240328070717_create_events.rb | Ruby | mit | 19 | main | 277 | # frozen_string_literal: true
class CreateEvents < ActiveRecord::Migration[7.1]
def change
create_table :events do |t|
t.string :name
t.integer :partner_id
t.integer :user_id
t.timestamps
end
remove_column :events, :updated_at
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250402080125_create_payment_plans.rb | Ruby | mit | 19 | main | 724 | class CreatePaymentPlans < ActiveRecord::Migration[7.2]
def up
create_table :payment_plans do |t|
t.timestamps
t.datetime :start_date, null: false
t.datetime :end_date, null: false
t.integer :total_seats, null: false
t.decimal :per_seat_cost, null: false
t.references :learning_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.