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 | osunyorg/admin | https://github.com/osunyorg/admin | app/models/communication/media/localization.rb | Ruby | mit | 48 | main | 1,324 | # == Schema Information
#
# Table name: communication_media_localizations
#
# id :uuid not null, primary key
# alt :text
# credit :text
# internal_description :text
# name :string
# created_at :datetime not null
# upda... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/communication/media/with_origin.rb | Ruby | mit | 48 | main | 281 | module Communication::Media::WithOrigin
extend ActiveSupport::Concern
included do
enum :origin, {
upload: 1, # file uploaded (default)
unsplash: 11, # file imported from Unsplash
pexels: 12 # file imported from Pexels
}, prefix: :from
end
end |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/communication/media/category/localization.rb | Ruby | mit | 48 | main | 1,323 | # == Schema Information
#
# Table name: communication_media_category_localizations
#
# id :uuid not null, primary key
# featured_image_alt :text
# featured_image_credit :text
# meta_description :text
# name :string
# slug :string
# summary ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/communication/media/localization/with_open_api.rb | Ruby | mit | 48 | main | 634 | module Communication::Media::Localization::WithOpenApi
extend ActiveSupport::Concern
included do
OPENAPI_SCHEMA = {
type: :object,
title: "Communication::Media::Localization",
properties: {
id: { type: :string, format: :uuid, nullable: true },
name: { type: :string, nullable: ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/communication/media/collection/localization.rb | Ruby | mit | 48 | main | 1,367 | # == Schema Information
#
# Table name: communication_media_collection_localizations
#
# id :uuid not null, primary key
# featured_image_alt :text
# featured_image_credit :text
# name :string
# created_at :datetime not null
# updated_at ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/program.rb | Ruby | mit | 48 | main | 3,840 | # == Schema Information
#
# Table name: education_programs
#
# id :uuid not null, primary key
# apprenticeship :boolean
# bodyclass :string
# capacity :integer
# continuing :boolean
# deleted_at :datetime
# initial :boolean
# qualiopi... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/diploma.rb | Ruby | mit | 48 | main | 1,686 | # == Schema Information
#
# Table name: education_diplomas
#
# id :uuid not null, primary key
# certification :string
# deleted_at :datetime
# ects :integer
# level :integer default("not_applicable")
# position :integer not null
# created_at :d... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/academic_year.rb | Ruby | mit | 48 | main | 2,063 | # == Schema Information
#
# Table name: education_academic_years
#
# id :uuid not null, primary key
# deleted_at :datetime
# year :integer
# created_at :datetime not null
# updated_at :datetime not null
# university_id :uuid not null, indexed
#
... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/school.rb | Ruby | mit | 48 | main | 2,966 | # == Schema Information
#
# Table name: education_schools
#
# id :uuid not null, primary key
# address :string
# city :string
# country :string
# deleted_at :datetime
# latitude :float
# longitude :float
# phone :string
# zipcode :string
# ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/cohort.rb | Ruby | mit | 48 | main | 2,600 | # == Schema Information
#
# Table name: education_cohorts
#
# id :uuid not null, primary key
# deleted_at :datetime
# name :string
# created_at :datetime not null
# updated_at :datetime not null
# academic_year_id :uuid not null, ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/cohort/facets.rb | Ruby | mit | 48 | main | 639 | class Education::Cohort::Facets < FacetedSearch::Facets
def initialize(params, options)
super params
@model = options[:model]
@about = options[:about]
@language = options[:language]
filter_with_list :academic_year_id, {
source: @about.academic_years.ordered,
title: Education::Academi... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/cohort/localization.rb | Ruby | mit | 48 | main | 2,012 | # == Schema Information
#
# Table name: education_cohort_localizations
#
# id :uuid not null, primary key
# deleted_at :datetime
# slug :string
# created_at :datetime not null
# updated_at :datetime not null
# about_id :uuid not null, uniqu... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/diploma/localization.rb | Ruby | mit | 48 | main | 2,659 | # == Schema Information
#
# Table name: education_diploma_localizations
#
# id :uuid not null, primary key
# accessibility :text
# contacts :text
# deleted_at :datetime
# duration :text
# evaluation :text
# name ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/school/with_locations.rb | Ruby | mit | 48 | main | 505 | module Education::School::WithLocations
extend ActiveSupport::Concern
included do
has_and_belongs_to_many :administration_locations,
class_name: 'Administration::Location',
foreign_key: :education_school_id,
association_foreign... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/school/with_team.rb | Ruby | mit | 48 | main | 1,799 | module Education::School::WithTeam
extend ActiveSupport::Concern
included do
has_many :university_roles,
class_name: 'University::Role',
as: :target,
dependent: :destroy
has_many :involvements_through_roles,
through: :university_roles,
... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/school/with_programs.rb | Ruby | mit | 48 | main | 677 | module Education::School::WithPrograms
extend ActiveSupport::Concern
included do
has_and_belongs_to_many :programs,
class_name: 'Education::Program',
join_table: :education_programs_schools,
foreign_key: :education_school_id,
... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/school/localization.rb | Ruby | mit | 48 | main | 1,818 | # == Schema Information
#
# Table name: education_school_localizations
#
# id :uuid not null, primary key
# deleted_at :datetime
# name :string
# slug :string
# url :string
# created_at :datetime not null
# updated_at :datetime not null
... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/school/with_alumni.rb | Ruby | mit | 48 | main | 1,325 | module Education::School::WithAlumni
extend ActiveSupport::Concern
included do
has_many :education_cohorts,
class_name: 'Education::Cohort',
dependent: :destroy
alias_method :cohorts, :education_cohorts
has_many :alumni, -> { distinct },
... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/program/localization.rb | Ruby | mit | 48 | main | 5,534 | # == Schema Information
#
# Table name: education_program_localizations
#
# id :uuid not null, primary key
# accessibility :text
# contacts :text
# content :text
# deleted_at :datetime
# duration :string
# evaluation ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/program/category.rb | Ruby | mit | 48 | main | 1,160 | # == Schema Information
#
# Table name: education_program_categories
#
# id :uuid not null, primary key
# bodyclass :string
# is_taxonomy :boolean default(FALSE)
# position :integer not null
# position_in_tree :integer
# created_at :datetime ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/program/with_schools.rb | Ruby | mit | 48 | main | 402 | module Education::Program::WithSchools
extend ActiveSupport::Concern
included do
has_and_belongs_to_many :schools,
class_name: 'Education::School',
join_table: :education_programs_schools,
foreign_key: :education_program_id,
... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/program/with_team.rb | Ruby | mit | 48 | main | 1,949 | module Education::Program::WithTeam
extend ActiveSupport::Concern
included do
has_many :university_roles,
class_name: 'University::Role',
as: :target,
dependent: :destroy
has_many :involvements_through_roles,
through: :university_roles,
... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/program/with_locations.rb | Ruby | mit | 48 | main | 507 | module Education::Program::WithLocations
extend ActiveSupport::Concern
included do
has_and_belongs_to_many :administration_locations,
class_name: 'Administration::Location',
foreign_key: :education_program_id,
association_forei... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/program/with_websites_categories.rb | Ruby | mit | 48 | main | 1,458 | module Education::Program::WithWebsitesCategories
extend ActiveSupport::Concern
included do
after_save_commit :set_websites_categories
has_many :website_agenda_categories,
class_name: 'Communication::Website::Agenda::Category',
dependent: :destroy
has_many :website_p... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/program/with_alumni.rb | Ruby | mit | 48 | main | 1,929 | module Education::Program::WithAlumni
extend ActiveSupport::Concern
included do
has_many :education_cohorts,
class_name: 'Education::Cohort'
alias_method :cohorts, :education_cohorts
has_many :alumni,
through: :education_cohorts,
source: :peo... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/program/with_diploma.rb | Ruby | mit | 48 | main | 417 | module Education::Program::WithDiploma
extend ActiveSupport::Concern
included do
belongs_to :diploma,
class_name: 'Education::Diploma',
optional: true
alias :education_diploma :diploma
alias :education_diplomas :diplomas
end
# Used by website
# https://github.co... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/program/localization/with_inheritance.rb | Ruby | mit | 48 | main | 1,764 | module Education::Program::Localization::WithInheritance
extend ActiveSupport::Concern
included do
def self.rich_text_areas_with_inheritance(*properties)
properties.each do |property|
has_summernote property
class_eval <<-CODE, __FILE__, __LINE__ + 1
def best_#{property}
... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/program/category/localization.rb | Ruby | mit | 48 | main | 1,641 | # == Schema Information
#
# Table name: education_program_category_localizations
#
# id :uuid not null, primary key
# breadcrumb_title :string
# featured_image_alt :text
# featured_image_credit :text
# header_cta :boolean default(FALSE)
# header_cta_label... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/education/academic_year/localization.rb | Ruby | mit | 48 | main | 1,491 | # == Schema Information
#
# Table name: education_academic_year_localizations
#
# id :uuid not null, primary key
# deleted_at :datetime
# slug :string
# created_at :datetime not null
# updated_at :datetime not null
# about_id :uuid not null... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/user/with_omniauth.rb | Ruby | mit | 48 | main | 2,559 | module User::WithOmniauth
extend ActiveSupport::Concern
included do
def self.from_omniauth(context, attributes)
mapping = context.sso_mapping || []
university = context.is_a?(University) ? context : context.university
# first step: we find the email (we are supposed to have an email mapping... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/user/with_authorship.rb | Ruby | mit | 48 | main | 658 | module User::WithAuthorship
extend ActiveSupport::Concern
included do
has_many :research_journal_papers,
class_name: "Research::Journal::Paper",
foreign_key: :updated_by_id,
dependent: :nullify
has_many :communication_website_agenda_events,
class_na... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/user/with_favorites.rb | Ruby | mit | 48 | main | 689 | module User::WithFavorites
extend ActiveSupport::Concern
included do
has_many :favorites, dependent: :destroy
after_save :autoset_favorites
end
def add_favorite(about)
favorites_for(about).first_or_create
end
def remove_favorite(about)
favorites_for(about).destroy_all
end
def favorit... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/user/with_person.rb | Ruby | mit | 48 | main | 1,278 | module User::WithPerson
extend ActiveSupport::Concern
included do
# Original person
has_one :person, class_name: 'University::Person', dependent: :nullify
delegate :experiences, to: :person
after_save_commit :sync_person, if: :person
after_create :find_or_create_person, unless: :server_admin?... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/user/with_roles.rb | Ruby | mit | 48 | main | 2,041 | module User::WithRoles
extend ActiveSupport::Concern
included do
attr_accessor :modified_by, :just_autopromoted
enum :role, {
visitor: 0,
contributor: 4,
author: 5,
teacher: 10,
program_manager: 12,
website_manager: 15,
admin: 20,
server_admin: 30
}
... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/user/with_registration_context.rb | Ruby | mit | 48 | main | 1,438 | module User::WithRegistrationContext
extend ActiveSupport::Concern
included do
attr_accessor :registration_context
validate :extranet_access, on: :create, if: -> { registration_context.is_a?(Communication::Extranet) }
after_create :send_notification_to_admins, unless: -> { registration_context.is_a?(... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/user/with_brevo.rb | Ruby | mit | 48 | main | 926 | module User::WithBrevo
extend ActiveSupport::Concern
included do
attr_accessor :from_brevo_webhook
after_commit :sync_with_brevo, on: [:create, :update], if: :should_sync_with_brevo?
after_commit :destroy_from_brevo, on: :destroy
end
private
def sync_with_brevo
Brevo::UserSyncJob.perform_la... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/user/favorite.rb | Ruby | mit | 48 | main | 813 | # == Schema Information
#
# Table name: user_favorites
#
# id :uuid not null, primary key
# about_type :string not null, indexed => [about_id]
# created_at :datetime not null
# updated_at :datetime not null
# about_id :uuid not null, indexed => [about_typ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/user/with_authentication.rb | Ruby | mit | 48 | main | 5,202 | module User::WithAuthentication
extend ActiveSupport::Concern
included do
devise :database_authenticatable, :registerable, :recoverable, :rememberable,
:timeoutable, :confirmable, :trackable, :lockable, :two_factor_authenticatable, :omniauthable, omniauth_providers: [:saml]
# note : i ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/user/with_created_elements.rb | Ruby | mit | 48 | main | 1,260 | module User::WithCreatedElements
extend ActiveSupport::Concern
included do
has_many :created_communication_website_agenda_events,
class_name: "Communication::Website::Agenda::Event",
foreign_key: "created_by_id",
dependent: :nullify
has_many :created_communication_we... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/user/with_avatar.rb | Ruby | mit | 48 | main | 1,123 | module User::WithAvatar
extend ActiveSupport::Concern
included do
has_one_attached_deletable :picture # Nota: user has a picture_url property for SSO mapping. If picture_url is set it will use the url to change the picture
validates :picture, size: { less_than: 5.megabytes }
before_save :update_pictu... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/user/with_sync_between_universities.rb | Ruby | mit | 48 | main | 2,347 | module User::WithSyncBetweenUniversities
extend ActiveSupport::Concern
included do
attr_accessor :skip_server_admin_sync
after_save :sync_between_universities, if: Proc.new { |user| user.server_admin? && !user.skip_server_admin_sync }
after_destroy :remove_from_all_universities, if: Proc.new { |user| ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/with_users.rb | Ruby | mit | 48 | main | 412 | module University::WithUsers
extend ActiveSupport::Concern
included do
attr_accessor :source_university_id
has_many :users, dependent: :destroy
after_commit :synchronize_server_admin_users, on: :create
private
def synchronize_server_admin_users
return unless source_university_id.prese... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/with_education.rb | Ruby | mit | 48 | main | 1,140 | module University::WithEducation
extend ActiveSupport::Concern
included do
has_many :education_cohorts,
class_name: 'Education::Cohort',
dependent: :destroy
alias_method :cohorts, :education_cohorts
has_many :education_diplomas,
class_name: 'Education::Diplo... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/app.rb | Ruby | mit | 48 | main | 1,198 | # == Schema Information
#
# Table name: university_apps
#
# id :uuid not null, primary key
# name :string
# token :string uniquely indexed
# token_was_displayed :boolean default(FALSE)
# created_at :datetime not null
# u... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/organization.rb | Ruby | mit | 48 | main | 3,953 | # == Schema Information
#
# Table name: university_organizations
#
# id :uuid not null, primary key
# address :string
# bodyclass :string
# city :string
# country :string
# deleted_at :datetime
# email :st... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/with_invoice.rb | Ruby | mit | 48 | main | 844 | module University::WithInvoice
extend ActiveSupport::Concern
included do
before_save :denormalize_invoice_date
scope :contributing, -> { where.not(contribution_amount: [nil, 0.0, '', 0]) }
scope :not_contributing, -> { where(contribution_amount: [nil, 0.0, '', 0]) }
def invoice_proximity
i... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/role.rb | Ruby | mit | 48 | main | 1,314 | # == Schema Information
#
# Table name: university_roles
#
# id :uuid not null, primary key
# deleted_at :datetime
# position :integer not null
# target_type :string indexed => [target_id]
# created_at :datetime not null
# updated_at :datetime ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person.rb | Ruby | mit | 48 | main | 8,031 | # == Schema Information
#
# Table name: university_people
#
# id :uuid not null, primary key
# address :string
# address_visibility :integer default("private")
# birthdate :date
# bodyclass :str... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/with_people_and_organizations.rb | Ruby | mit | 48 | main | 1,087 | module University::WithPeopleAndOrganizations
extend ActiveSupport::Concern
included do
has_many :university_people,
class_name: 'University::Person',
dependent: :destroy
alias_method :people, :university_people
has_many :university_person_categories,
class_... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/with_communication.rb | Ruby | mit | 48 | main | 1,656 | module University::WithCommunication
extend ActiveSupport::Concern
included do
has_many :communication_blocks,
class_name: 'Communication::Block',
dependent: :destroy
alias_method :blocks, :communication_blocks
has_many :communication_extranets,
class_name: ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/with_research.rb | Ruby | mit | 48 | main | 973 | module University::WithResearch
extend ActiveSupport::Concern
included do
has_many :research_journals,
class_name: 'Research::Journal',
dependent: :destroy
has_many :research_journal_volumes,
class_name: 'Research::Journal::Volume',
dependent: :des... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/with_languages.rb | Ruby | mit | 48 | main | 601 | module University::WithLanguages
extend ActiveSupport::Concern
included do
belongs_to :default_language, class_name: "Language"
has_and_belongs_to_many :languages
scope :for_language, -> (language_ids, language = nil) { joins(:languages).where(languages: { id: language_ids } ).distinct }
end
de... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/with_administration.rb | Ruby | mit | 48 | main | 279 | module University::WithAdministration
extend ActiveSupport::Concern
included do
has_many :administration_locations,
class_name: 'Administration::Location',
dependent: :destroy
alias_method :locations, :administration_locations
end
end |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/with_identifier.rb | Ruby | mit | 48 | main | 1,138 | module University::WithIdentifier
extend ActiveSupport::Concern
included do
# TODO restrict to lower case, numbers, -, _
validates :identifier, presence: true, uniqueness: true
def host
@host ||= [identifier, self.class.send("#{ENV['APPLICATION_ENV']}_domain")].join
end
def url
@u... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/role/localization.rb | Ruby | mit | 48 | main | 1,163 | # == Schema Information
#
# Table name: university_role_localizations
#
# id :uuid not null, primary key
# deleted_at :datetime
# description :string
# created_at :datetime not null
# updated_at :datetime not null
# about_id :uuid uniquely indexed... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/organization/facets.rb | Ruby | mit | 48 | main | 780 | class University::Organization::Facets < FacetedSearch::Facets
attr_reader :language, :categories
def initialize(params, options)
super params
@model = options[:model]
@about = options[:about]
@language = options[:language]
@categories = options[:categories]
add_name
a... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/organization/category.rb | Ruby | mit | 48 | main | 1,306 | # == Schema Information
#
# Table name: university_organization_categories
#
# id :uuid not null, primary key
# bodyclass :string
# is_taxonomy :boolean default(FALSE)
# migration_identifier :string
# position :integer not null
# posi... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/organization/with_open_api.rb | Ruby | mit | 48 | main | 1,468 | module University::Organization::WithOpenApi
extend ActiveSupport::Concern
included do
OPENAPI_SCHEMA = {
type: :object,
title: "University::Organization",
properties: {
id: { type: :string, format: :uuid },
migration_identifier: { type: :string, nullable: true },
kind... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/organization/with_kind.rb | Ruby | mit | 48 | main | 314 | module University::Organization::WithKind
extend ActiveSupport::Concern
included do
enum :kind, {
company: 10,
non_profit: 20,
government: 30,
public_organization: 40,
collective: 50
}
scope :for_kind, -> (kind, language = nil) { where(kind: kind) }
end
end |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/organization/localization.rb | Ruby | mit | 48 | main | 3,352 | # == Schema Information
#
# Table name: university_organization_localizations
#
# id :uuid not null, primary key
# address_additional :string
# address_name :string
# deleted_at :datetime
# featured_image_alt :string
# featured_image_credit :text
# linkedi... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/organization/localization/with_open_api.rb | Ruby | mit | 48 | main | 1,707 | module University::Organization::Localization::WithOpenApi
extend ActiveSupport::Concern
included do
OPENAPI_SCHEMA = {
type: :object,
title: "University::Organization::Localization",
properties: {
id: { type: :string, format: :uuid },
migration_identifier: { type: :string, nu... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/organization/category/with_open_api.rb | Ruby | mit | 48 | main | 914 | module University::Organization::Category::WithOpenApi
extend ActiveSupport::Concern
included do
OPENAPI_SCHEMA = {
type: :object,
title: "University::Organization::Category",
properties: {
id: { type: :string, format: :uuid },
migration_identifier: { type: :string, nullable: ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/organization/category/localization.rb | Ruby | mit | 48 | main | 1,805 | # == Schema Information
#
# Table name: university_organization_category_localizations
#
# id :uuid not null, primary key
# breadcrumb_title :string
# featured_image_alt :text
# featured_image_credit :text
# header_cta :boolean default(FALSE)
# header_cta... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/organization/category/localization/with_open_api.rb | Ruby | mit | 48 | main | 1,511 | module University::Organization::Category::Localization::WithOpenApi
extend ActiveSupport::Concern
included do
OPENAPI_SCHEMA = {
type: :object,
title: "University::Organization::Category::Localization",
properties: {
id: { type: :string, format: :uuid },
migration_identifier:... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/with_realm_communication.rb | Ruby | mit | 48 | main | 901 | module University::Person::WithRealmCommunication
extend ActiveSupport::Concern
included do
has_and_belongs_to_many :communication_website_posts,
class_name: 'Communication::Website::Post',
foreign_key: :university_person_id,
association_foreign_key: :communication_web... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/with_realm_research.rb | Ruby | mit | 48 | main | 2,692 | module University::Person::WithRealmResearch
extend ActiveSupport::Concern
included do
has_and_belongs_to_many :research_hal_authors,
class_name: 'Research::Hal::Author',
foreign_key: :university_person_id,
association_foreign_... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/experience.rb | Ruby | mit | 48 | main | 2,003 | # == Schema Information
#
# Table name: university_person_experiences
#
# id :uuid not null, primary key
# deleted_at :datetime
# from_year :integer
# to_year :integer
# created_at :datetime not null
# updated_at :datetime not null
# organizat... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/with_personal_data.rb | Ruby | mit | 48 | main | 1,144 | module University::Person::WithPersonalData
extend ActiveSupport::Concern
VISIBILITY_ENUM = { private: 0, restricted: 10, public: 20 }
included do
enum :address_visibility, VISIBILITY_ENUM, prefix: :address_is
enum :linkedin_visibility, VISIBILITY_ENUM, prefix: :linkedin_is
enum... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/with_alumnus.rb | Ruby | mit | 48 | main | 3,265 | module University::Person::WithAlumnus
extend ActiveSupport::Concern
included do
has_and_belongs_to_many :cohorts,
class_name: '::Education::Cohort',
foreign_key: :university_person_id,
association_forei... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/involvement.rb | Ruby | mit | 48 | main | 3,642 | # == Schema Information
#
# Table name: university_person_involvements
#
# id :uuid not null, primary key
# deleted_at :datetime
# kind :integer
# position :integer not null
# target_type :string not null, indexed => [target_id]
# created_at :datetim... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/alumnus.rb | Ruby | mit | 48 | main | 2,512 | # == Schema Information
#
# Table name: university_people
#
# id :uuid not null, primary key
# address :string
# address_visibility :integer default("private")
# birthdate :date
# bodyclass :str... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/with_realm_administration.rb | Ruby | mit | 48 | main | 682 | module University::Person::WithRealmAdministration
extend ActiveSupport::Concern
included do
has_many :involvements_as_administrator,
-> { where(kind: 'administrator') },
class_name: 'University::Person::Involvement',
dependent: :destroy
has_many :roles_as_admin... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/category.rb | Ruby | mit | 48 | main | 1,218 | # == Schema Information
#
# Table name: university_person_categories
#
# id :uuid not null, primary key
# bodyclass :string
# is_taxonomy :boolean default(FALSE)
# position :integer not null
# position_in_tree :integer
# created_at :datetime ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/with_facets.rb | Ruby | mit | 48 | main | 1,289 | module University::Person::WithFacets
extend ActiveSupport::Concern
included do
LIST_OF_FACETS = [
:administration,
:teacher,
:researcher,
:alumnus,
:author
].freeze
scope :administration, -> { where(is_administration: true) }
scope :authors, -> { where(i... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/with_realm_education.rb | Ruby | mit | 48 | main | 599 | module University::Person::WithRealmEducation
extend ActiveSupport::Concern
included do
has_many :involvements_as_teacher,
-> { where(kind: 'teacher') },
class_name: 'University::Person::Involvement',
dependent: :destroy
has_many :education_programs_as_teacher,
... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/localization.rb | Ruby | mit | 48 | main | 3,798 | # == Schema Information
#
# Table name: university_person_localizations
#
# id :uuid not null, primary key
# biography :text
# deleted_at :datetime
# featured_image_alt :text
# featured_image_credit :text
# first_name :string
# last_name ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/with_involvements.rb | Ruby | mit | 48 | main | 274 | module University::Person::WithInvolvements
extend ActiveSupport::Concern
included do
has_many :involvements,
class_name: 'University::Person::Involvement',
dependent: :destroy
accepts_nested_attributes_for :involvements
end
end |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/with_picture.rb | Ruby | mit | 48 | main | 514 | module University::Person::WithPicture
extend ActiveSupport::Concern
included do
has_one_attached_deletable :picture
validates :picture, size: { less_than: 5.megabytes }
alias :featured_image :best_picture
end
def best_picture
@best_picture ||= begin
best_picture = picture
best_p... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/experience/localization.rb | Ruby | mit | 48 | main | 1,232 | # == Schema Information
#
# Table name: university_person_experience_localizations
#
# id :uuid not null, primary key
# deleted_at :datetime
# description :string
# created_at :datetime not null
# updated_at :datetime not null
# about_id :uuid uni... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/alumnus/facets.rb | Ruby | mit | 48 | main | 1,331 | class University::Person::Alumnus::Facets < FacetedSearch::Facets
attr_reader :language, :categories
def initialize(params, options)
super params
@model = options[:model]
@about = options[:about]
@language = options[:language]
@categories = options[:categories]
add_name
... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/category/localization.rb | Ruby | mit | 48 | main | 1,731 | # == Schema Information
#
# Table name: university_person_category_localizations
#
# id :uuid not null, primary key
# breadcrumb_title :string
# featured_image_alt :text
# featured_image_credit :text
# header_cta :boolean default(FALSE)
# header_cta_label... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/involvement/localization.rb | Ruby | mit | 48 | main | 1,204 | # == Schema Information
#
# Table name: university_person_involvement_localizations
#
# id :uuid not null, primary key
# deleted_at :datetime
# description :string
# created_at :datetime not null
# updated_at :datetime not null
# about_id :uuid un... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/localization/author.rb | Ruby | mit | 48 | main | 2,279 | # == Schema Information
#
# Table name: university_person_localizations
#
# id :uuid not null, primary key
# biography :text
# deleted_at :datetime
# featured_image_alt :text
# featured_image_credit :text
# first_name :string
# last_name ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/localization/researcher.rb | Ruby | mit | 48 | main | 2,321 | # == Schema Information
#
# Table name: university_person_localizations
#
# id :uuid not null, primary key
# biography :text
# deleted_at :datetime
# featured_image_alt :text
# featured_image_credit :text
# first_name :string
# last_name ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/localization/administrator.rb | Ruby | mit | 48 | main | 2,322 | # == Schema Information
#
# Table name: university_person_localizations
#
# id :uuid not null, primary key
# biography :text
# deleted_at :datetime
# featured_image_alt :text
# featured_image_credit :text
# first_name :string
# last_name ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/university/person/localization/teacher.rb | Ruby | mit | 48 | main | 2,279 | # == Schema Information
#
# Table name: university_person_localizations
#
# id :uuid not null, primary key
# biography :text
# deleted_at :datetime
# featured_image_alt :text
# featured_image_credit :text
# first_name :string
# last_name ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/administration/location.rb | Ruby | mit | 48 | main | 2,698 | # == Schema Information
#
# Table name: administration_locations
#
# id :uuid not null, primary key
# address :string
# city :string
# country :string
# deleted_at :datetime
# latitude :float
# longitude :float
# phone :string
# zipcode :str... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/administration/qualiopi/indicator.rb | Ruby | mit | 48 | main | 838 | # == Schema Information
#
# Table name: administration_qualiopi_indicators
#
# id :uuid not null, primary key
# glossary :text
# level_expected :text
# name :text
# non_conformity :text
# number :integer
# proof :text
# requirement :text
# created_at ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/administration/qualiopi/criterion.rb | Ruby | mit | 48 | main | 499 | # == Schema Information
#
# Table name: administration_qualiopi_criterions
#
# id :uuid not null, primary key
# description :text
# name :text
# number :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class Administration::Qualiopi::Crit... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/administration/location/localization.rb | Ruby | mit | 48 | main | 2,114 | # == Schema Information
#
# Table name: administration_location_localizations
#
# id :uuid not null, primary key
# address_additional :string
# address_name :string
# deleted_at :datetime
# featured_image_alt :string
# featured_image_credit :text
# meta_de... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/ability/admin.rb | Ruby | mit | 48 | main | 5,919 | class Ability::Admin < Ability
def initialize(user)
super
admin_university
admin_education
admin_research
admin_communication
admin_communication_extranet
admin_administration
can :manage, Import, university_id: @user.university_id
end
protected
def admin_university
can :m... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/ability/website_manager.rb | Ruby | mit | 48 | main | 9,291 | class Ability::WebsiteManager < Ability
def initialize(user)
super
manage_blocks
can [:read, :analytics, :synchronize], Communication::Website, university_id: @user.university_id, id: managed_websites_ids
can :manage, Communication::Website::Localization, university_id: @user.university_id, communica... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/ability/program_manager.rb | Ruby | mit | 48 | main | 6,468 | class Ability::ProgramManager < Ability
def initialize(user)
super
manage_records_based_on_abouts(Communication::Website::Permalink)
manage_records_based_on_abouts(Communication::Block)
can :read, Communication::Website, university_id: @user.university_id
can :manage, Communication::Website::Agen... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/ability/contributor.rb | Ruby | mit | 48 | main | 385 | class Ability::Contributor < Ability::Author
def initialize(user)
super
cannot :publish, Communication::Website::Post
cannot :publish, Communication::Website::Agenda::Event
cannot :publish, Communication::Website::Agenda::Exhibition
cannot :publish, Communication::Website::Portfolio::Project
... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/ability/teacher.rb | Ruby | mit | 48 | main | 1,432 | class Ability::Teacher < Ability
def initialize(user)
super
can :manage, Communication::Block, university_id: @user.university_id, about_type: 'Education::Program::Localization', about_id: managed_program_localization_ids
can :manage, Communication::Block, university_id: @user.university_id, about_type: ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/ability/author.rb | Ruby | mit | 48 | main | 8,780 | class Ability::Author < Ability
def initialize(user)
super
can :manage, Communication::Website::Agenda::Event, university_id: @user.university_id, id: managed_agenda_event_ids
can :create, Communication::Website::Agenda::Event, university_id: @user.university_id, communication_website_id: managed_website... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/research/thesis.rb | Ruby | mit | 48 | main | 2,085 | # == Schema Information
#
# Table name: research_theses
#
# id :uuid not null, primary key
# completed :boolean default(FALSE)
# completed_at :date
# deleted_at :datetime
# started_at :date
# created_at :datetime ... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/research/journal.rb | Ruby | mit | 48 | main | 2,663 | # == Schema Information
#
# Table name: research_journals
#
# id :uuid not null, primary key
# deleted_at :datetime
# created_at :datetime not null
# updated_at :datetime not null
# university_id :uuid not null, indexed
#
# Indexes
#
# index_research_jou... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/research/hal.rb | Ruby | mit | 48 | main | 522 | module Research::Hal
extend ActiveModel::Naming
extend ActiveModel::Translation
def self.table_name_prefix
'research_hal_'
end
def self.update_from_api!
Research::Hal::Author.find_each do |author|
author.import_research_hal_publications!
end
University::Person.joins(:research_hal_autho... |
github | osunyorg/admin | https://github.com/osunyorg/admin | app/models/research/laboratory.rb | Ruby | mit | 48 | main | 2,929 | # == Schema Information
#
# Table name: research_laboratories
#
# id :uuid not null, primary key
# address :string
# city :string
# country :string
# deleted_at :datetime
# zipcode :string
# created_at :datetime not null
# updated_at :datetime ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.