├── .circleci └── config.yml ├── .eslintignore ├── .eslintrc ├── .github ├── .codecov.yml ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug-feature-via-meta.md │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── codeql-analysis.yml │ ├── mirror.yml │ └── typescript.yml ├── .gitignore ├── .npmrc ├── .rubocop.yml ├── .sample.irbrc ├── CODE-STANDARDS.md ├── CONTRIBUTING.md ├── Gemfile ├── Gemfile.lock ├── INSTALLATION.md ├── LICENSE ├── README.md ├── Rakefile ├── SECURITY.md ├── app ├── assets │ ├── config │ │ └── manifest.js │ ├── images │ │ ├── .keep │ │ ├── codidact.png │ │ ├── codidactyl.png │ │ ├── favicon.ico │ │ ├── fbm.ico │ │ ├── logo.png │ │ ├── scoring_3d.png │ │ ├── scoring_distribution.png │ │ ├── scoring_formula.png │ │ ├── scoring_table.png │ │ ├── scoring_table.svg │ │ ├── square.ico │ │ ├── stripe.png │ │ └── voting.png │ ├── imgfonts │ │ ├── LICENSE.txt │ │ ├── Roboto-Black-FRLHebrew.ttf │ │ ├── Roboto-Black.ttf │ │ ├── Roboto-BlackItalic.ttf │ │ ├── Roboto-Bold.ttf │ │ ├── Roboto-BoldItalic.ttf │ │ ├── Roboto-Italic.ttf │ │ ├── Roboto-Light.ttf │ │ ├── Roboto-LightItalic.ttf │ │ ├── Roboto-Medium.ttf │ │ ├── Roboto-MediumItalic.ttf │ │ ├── Roboto-Regular.ttf │ │ ├── Roboto-Thin.ttf │ │ ├── Roboto-ThinItalic.ttf │ │ └── Roboto.ttf │ ├── javascripts │ │ ├── admin.js │ │ ├── application.js │ │ ├── caret.js │ │ ├── categories.js │ │ ├── character_count.js │ │ ├── closure.js │ │ ├── codeblocks.js │ │ ├── comments.js │ │ ├── donations.js │ │ ├── embed.js │ │ ├── filters.js │ │ ├── flags.js │ │ ├── keyboard_tools.js │ │ ├── latex_escape.js │ │ ├── licenses.js │ │ ├── livestamp.min.js │ │ ├── markdown.js │ │ ├── micro_auth │ │ │ └── apps.js │ │ ├── mod_warning.js │ │ ├── modals.js │ │ ├── moderator.js │ │ ├── notifications.js │ │ ├── post_histories.js │ │ ├── posts.js │ │ ├── preferences.js │ │ ├── privileges.js │ │ ├── qpixel_api.js │ │ ├── qpixel_dom.js │ │ ├── reactions.js │ │ ├── search.js │ │ ├── site_settings.js │ │ ├── subscriptions.js │ │ ├── suggested_edit.js │ │ ├── tag_sets.js │ │ ├── tags.js │ │ ├── textarea_popup.js │ │ ├── tour.js │ │ ├── two_factor.js │ │ ├── users.js │ │ └── votes.js │ └── stylesheets │ │ ├── _variables.scss │ │ ├── abilities.scss │ │ ├── advertisement.scss │ │ ├── application.scss │ │ ├── articles.scss │ │ ├── categories.scss │ │ ├── close_reasons.scss │ │ ├── comment_threads.scss │ │ ├── comments.scss │ │ ├── donations.scss │ │ ├── errors.scss │ │ ├── fake_community.scss │ │ ├── forms.scss │ │ ├── keyboard_tools.scss │ │ ├── licenses.scss │ │ ├── markdown_tools.scss │ │ ├── micro_auth │ │ ├── apps.scss │ │ └── authentication.scss │ │ ├── mod_warning.scss │ │ ├── notifications.scss │ │ ├── pinned_links.scss │ │ ├── post_history.scss │ │ ├── post_types.scss │ │ ├── posts.scss │ │ ├── reactions.scss │ │ ├── reports.scss │ │ ├── site_settings.scss │ │ ├── subscriptions.scss │ │ ├── suggested_edit.scss │ │ ├── tables.scss │ │ ├── tabs.scss │ │ ├── tag_sets.scss │ │ ├── tags.scss │ │ ├── textarea_popup.scss │ │ ├── topbar.scss │ │ ├── tour.scss │ │ ├── two_factor.scss │ │ ├── users.scss │ │ └── utilities.scss ├── controllers │ ├── abilities_controller.rb │ ├── active_storage │ │ └── base_controller.rb │ ├── admin_controller.rb │ ├── advertisement_controller.rb │ ├── answers_controller.rb │ ├── application_controller.rb │ ├── categories_controller.rb │ ├── close_reasons_controller.rb │ ├── comments_controller.rb │ ├── concerns │ │ ├── .keep │ │ └── stripe_event_processor.rb │ ├── donations_controller.rb │ ├── email_logs_controller.rb │ ├── errors_controller.rb │ ├── fake_community_controller.rb │ ├── flags_controller.rb │ ├── licenses_controller.rb │ ├── micro_auth │ │ ├── apps_controller.rb │ │ └── authentication_controller.rb │ ├── mod_warning_controller.rb │ ├── moderator_controller.rb │ ├── notifications_controller.rb │ ├── pinned_links_controller.rb │ ├── post_history_controller.rb │ ├── post_types_controller.rb │ ├── posts_controller.rb │ ├── questions_controller.rb │ ├── reactions_controller.rb │ ├── reports_controller.rb │ ├── search_controller.rb │ ├── site_settings_controller.rb │ ├── subscriptions_controller.rb │ ├── suggested_edit_controller.rb │ ├── tag_sets_controller.rb │ ├── tags_controller.rb │ ├── tasks_controller.rb │ ├── tour_controller.rb │ ├── two_factor_controller.rb │ ├── users │ │ ├── registrations_controller.rb │ │ ├── saml_sessions_controller.rb │ │ └── sessions_controller.rb │ ├── users_controller.rb │ └── votes_controller.rb ├── helpers │ ├── abilities_helper.rb │ ├── admin_helper.rb │ ├── advertisement_helper.rb │ ├── advertisements │ │ ├── article_helper.rb │ │ ├── codidact_helper.rb │ │ ├── community_helper.rb │ │ └── question_helper.rb │ ├── answers_helper.rb │ ├── application_helper.rb │ ├── articles_helper.rb │ ├── categories_helper.rb │ ├── close_reasons_helper.rb │ ├── comments_helper.rb │ ├── donations_helper.rb │ ├── edit_helper.rb │ ├── email_logs_helper.rb │ ├── errors_helper.rb │ ├── fake_community_helper.rb │ ├── flags_helper.rb │ ├── licenses_helper.rb │ ├── markdown_tools_helper.rb │ ├── micro_auth │ │ ├── apps_helper.rb │ │ └── authentication_helper.rb │ ├── mod_warning_helper.rb │ ├── moderator_helper.rb │ ├── notifications_helper.rb │ ├── pinned_links_helper.rb │ ├── post_types_helper.rb │ ├── posts_helper.rb │ ├── questions_helper.rb │ ├── reactions_helper.rb │ ├── reports_helper.rb │ ├── search_helper.rb │ ├── seeds_helper.rb │ ├── site_settings_helper.rb │ ├── subscriptions_helper.rb │ ├── suggested_edit_helper.rb │ ├── tabs_helper.rb │ ├── tag_sets_helper.rb │ ├── tags_helper.rb │ ├── tour_helper.rb │ ├── two_factor_helper.rb │ ├── uploads_helper.rb │ ├── users │ │ └── avatar_helper.rb │ ├── users_helper.rb │ └── votes_helper.rb ├── jobs │ ├── application_job.rb │ ├── clean_up_spammy_users_job.rb │ └── cleanup_votes_job.rb ├── mailers │ ├── .keep │ ├── admin_mailer.rb │ ├── application_mailer.rb │ ├── donation_mailer.rb │ ├── flag_mailer.rb │ ├── subscription_mailer.rb │ └── two_factor_mailer.rb ├── models │ ├── .keep │ ├── ability.rb │ ├── ability_queue.rb │ ├── answer.rb │ ├── application_record.rb │ ├── article.rb │ ├── audit_log.rb │ ├── blocked_item.rb │ ├── category.rb │ ├── category_filter_default.rb │ ├── category_post_type.rb │ ├── close_reason.rb │ ├── comment.rb │ ├── comment_thread.rb │ ├── community.rb │ ├── community_user.rb │ ├── concerns │ │ ├── .keep │ │ ├── community_related.rb │ │ ├── edits_validations.rb │ │ ├── maybe_community_related.rb │ │ ├── post_related.rb │ │ ├── post_validations.rb │ │ ├── saml_init.rb │ │ └── user_merge.rb │ ├── email_log.rb │ ├── error_log.rb │ ├── filter.rb │ ├── flag.rb │ ├── help_doc.rb │ ├── license.rb │ ├── micro_auth.rb │ ├── micro_auth │ │ ├── app.rb │ │ └── token.rb │ ├── mod_warning.rb │ ├── notification.rb │ ├── pinned_link.rb │ ├── policy_doc.rb │ ├── post.rb │ ├── post_flag_type.rb │ ├── post_history.rb │ ├── post_history_tag.rb │ ├── post_history_type.rb │ ├── post_type.rb │ ├── posts_tag.rb │ ├── question.rb │ ├── reaction.rb │ ├── reaction_type.rb │ ├── request_context.rb │ ├── site_setting.rb │ ├── sso_profile.rb │ ├── subscription.rb │ ├── suggested_edit.rb │ ├── tag.rb │ ├── tag_set.rb │ ├── tag_synonym.rb │ ├── tag_with_path.rb │ ├── thread_follower.rb │ ├── user.rb │ ├── user_ability.rb │ ├── user_website.rb │ ├── vote.rb │ └── warning_template.rb ├── tasks │ └── maintenance │ │ └── initialize_user_websites_task.rb └── views │ ├── abilities │ ├── index.html.erb │ └── show.html.erb │ ├── admin │ ├── _error_report.html.erb │ ├── _log_table.html.erb │ ├── admin_email.html.erb │ ├── all_email.html.erb │ ├── audit_log.html.erb │ ├── change_back.html.erb │ ├── create_site.html.erb │ ├── error_reports.html.erb │ ├── impersonate.html.erb │ ├── index.html.erb │ ├── new_site.html.erb │ ├── privileges.html.erb │ ├── setup.html.erb │ └── setup_save.html.erb │ ├── admin_mailer │ ├── to_all_users.html.erb │ ├── to_all_users.text.erb │ ├── to_moderators.html.erb │ └── to_moderators.text.erb │ ├── advertisement │ └── index.html.erb │ ├── application │ ├── dashboard.html.erb │ ├── keyboard_tools.html.erb │ └── osd.xml.erb │ ├── categories │ ├── _category_post_type_edit.html.erb │ ├── _form.html.erb │ ├── category_post_types.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ ├── new.html.erb │ ├── post_types.html.erb │ ├── rss_feed.rss.builder │ └── show.html.erb │ ├── close_reasons │ ├── _form.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ └── new.html.erb │ ├── comments │ ├── _comment.html.erb │ ├── _new_thread_modal.html.erb │ ├── _post.html.erb │ ├── _skip_deleted.erb │ ├── post.html.erb │ ├── thread.html.erb │ └── thread_followers.html.erb │ ├── devise │ ├── confirmations │ │ └── new.html.erb │ ├── mailer │ │ ├── _friendly_footer.html.erb │ │ ├── confirmation_instructions.html.erb │ │ ├── email_changed.html.erb │ │ ├── password_change.html.erb │ │ ├── reset_password_instructions.html.erb │ │ └── unlock_instructions.html.erb │ ├── passwords │ │ ├── edit.html.erb │ │ └── new.html.erb │ ├── registrations │ │ ├── edit.html.erb │ │ └── new.html.erb │ ├── sessions │ │ └── new.html.erb │ ├── shared │ │ ├── _error_messages.html.erb │ │ └── _links.html.erb │ └── unlocks │ │ └── new.html.erb │ ├── donation_mailer │ ├── donation_successful.html.erb │ ├── donation_successful.text.erb │ ├── donation_uncaptured.html.erb │ └── donation_uncaptured.text.erb │ ├── donations │ ├── index.html.erb │ ├── intent.html.erb │ └── success.html.erb │ ├── errors │ ├── conflict.html.erb │ ├── error.html.erb │ ├── forbidden.html.erb │ ├── internal_server_error.html.erb │ ├── locked.html.erb │ ├── not_found.html.erb │ ├── read_only.html.erb │ ├── restricted_content.html.erb │ ├── stat.html.erb │ └── unprocessable_entity.html.erb │ ├── fake_community │ └── communities.html.erb │ ├── flag_mailer │ └── flag_escalated.html.erb │ ├── flags │ ├── _flag.html.erb │ ├── _handled.html.erb │ ├── handled.html.erb │ ├── history.html.erb │ └── queue.html.erb │ ├── layouts │ ├── _footer.html.erb │ ├── _head.html.erb │ ├── _header.html.erb │ ├── _matomo.html.erb │ ├── _sidebar.html.erb │ ├── application.html.erb │ ├── devise_mailer.html.erb │ ├── mailer.html.erb │ ├── mailer.text.erb │ ├── stripe.html.erb │ └── without_sidebar.html.erb │ ├── licenses │ ├── _form.html.erb │ ├── _license.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ └── new.html.erb │ ├── micro_auth │ ├── apps │ │ ├── _form.html.erb │ │ ├── edit.html.erb │ │ ├── index.html.erb │ │ ├── new.html.erb │ │ └── show.html.erb │ └── authentication │ │ ├── approval_redirect_error.html.erb │ │ ├── approved.html.erb │ │ ├── initiate.html.erb │ │ └── reject.html.erb │ ├── mod_warning │ ├── current.html.erb │ ├── log.html.erb │ └── new.html.erb │ ├── moderator │ ├── index.html.erb │ ├── promotions.html.erb │ ├── recent_comments.html.erb │ ├── recently_deleted_posts.html.erb │ └── user_vote_summary.html.erb │ ├── notifications │ └── index.html.erb │ ├── pinned_links │ ├── _form.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ └── new.html.erb │ ├── post_history │ ├── _diff.html.erb │ └── post.html.erb │ ├── post_types │ ├── _form.html.erb │ ├── _type.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ └── new.html.erb │ ├── posts │ ├── _article_list.html.erb │ ├── _edit_comment.html.erb │ ├── _edit_link.html.erb │ ├── _expanded.html.erb │ ├── _feed.rss.builder │ ├── _form.html.erb │ ├── _help_center_posts.html.erb │ ├── _image_upload.html.erb │ ├── _list.html.erb │ ├── _markdown_script.html.erb │ ├── _mdhint.html.erb │ ├── _post_tools.html.erb │ ├── _review_edit_link.html.erb │ ├── _toc_entry.html.erb │ ├── _type_agnostic.html.erb │ ├── document.html.erb │ ├── edit.html.erb │ ├── help_center.html.erb │ ├── new.html.erb │ └── show.html.erb │ ├── questions │ ├── _list.html.erb │ └── lottery.html.erb │ ├── reactions │ ├── _dialog.html.erb │ ├── _form.html.erb │ ├── _list.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ └── new.html.erb │ ├── reports │ ├── _tabs.html.erb │ ├── posts.html.erb │ ├── reactions.html.erb │ ├── subscriptions.html.erb │ └── users.html.erb │ ├── search │ ├── _filters.html.erb │ ├── _widget.html.erb │ └── search.html.erb │ ├── shared │ ├── _body_field.html.erb │ ├── _char_count.html.erb │ ├── _copy_link.html.erb │ ├── _lock_notice.html.erb │ ├── _markdown_tools.html.erb │ └── _rss_link.html.erb │ ├── site_settings │ ├── edit.html.erb │ └── index.html.erb │ ├── subscription_mailer │ ├── subscription.html.erb │ └── subscription.text.erb │ ├── subscriptions │ ├── error.html.erb │ ├── index.html.erb │ └── new.html.erb │ ├── suggested_edit │ ├── category_index.html.erb │ └── show.html.erb │ ├── tag_sets │ └── index.html.erb │ ├── tags │ ├── _form.html.erb │ ├── _list.html.erb │ ├── _tag.html.erb │ ├── category.html.erb │ ├── children.html.erb │ ├── edit.html.erb │ ├── new.html.erb │ ├── nuke_warning.html.erb │ ├── select_merge.html.erb │ ├── show.html.erb │ └── show.rss.builder │ ├── tour │ ├── end.html.erb │ ├── index.html.erb │ ├── more.html.erb │ ├── question1.html.erb │ ├── question2.html.erb │ └── question3.html.erb │ ├── two_factor │ ├── disable_code.html.erb │ ├── disable_link.html.erb │ ├── enable_2fa.html.erb │ ├── enable_code.html.erb │ └── tf_status.html.erb │ ├── two_factor_mailer │ ├── backup_code.html.erb │ ├── backup_code.text.erb │ ├── disable_email.html.erb │ ├── disable_email.text.erb │ ├── login_email.html.erb │ └── login_email.text.erb │ └── users │ ├── _activity_items.html.erb │ ├── _common_card.html.erb │ ├── _deleted.html.erb │ ├── _network.html.erb │ ├── _post_usercard.html.erb │ ├── _prefs.html.erb │ ├── _tabs.html.erb │ ├── _user.html.erb │ ├── activity.html.erb │ ├── annotations.html.erb │ ├── deleted_user.html.erb │ ├── disconnect_sso.html.erb │ ├── edit_profile.html.erb │ ├── filters.html.erb │ ├── full_log.html.erb │ ├── index.html.erb │ ├── mod.html.erb │ ├── mod_privileges.html.erb │ ├── network.html.erb │ ├── posts.html.erb │ ├── preferences.html.erb │ ├── qr_login_code.html.erb │ ├── sessions │ └── verify_2fa.html.erb │ ├── show.html.erb │ └── vote_summary.html.erb ├── bin ├── bundle ├── rails ├── rake ├── setup └── spring ├── config.ru ├── config ├── application.rb ├── attribute-map.yml ├── boot.rb ├── cable.yml ├── config │ └── preferences.yml ├── credentials.yml.enc ├── database.docker.yml ├── database.sample.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── activerecord_relation.rb │ ├── amazon_ses.rb │ ├── application_controller_renderer.rb │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── config.rb │ ├── content_security_policy.rb │ ├── cookie_rotator.rb │ ├── cookies_serializer.rb │ ├── devise.rb │ ├── devise_example.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── maintenance_tasks.rb │ ├── mime_types.rb │ ├── permissions_policy.rb │ ├── session_store.rb │ ├── stripe.rb │ ├── will_paginate_added_also_on_arrays.rb │ ├── wrap_parameters.rb │ ├── zz_cache_setup.rb │ └── zz_codidact_sites.rb ├── locales │ ├── devise.en.yml │ ├── en.yml │ ├── es.yml │ ├── strings │ │ ├── en.admin.yml │ │ ├── en.ads.yml │ │ ├── en.edits.yml │ │ ├── en.g.yml │ │ ├── en.posts.yml │ │ ├── en.rate_limit.yml │ │ ├── en.search.yml │ │ ├── en.votes.yml │ │ ├── es.admin.yml │ │ ├── es.ads.yml │ │ ├── es.g.yml │ │ ├── es.posts.yml │ │ └── es.rate_limit.yml │ ├── time.en_abbrev.yml │ └── time.es_abbrev.yml ├── puma.rb ├── routes.rb ├── schedule.rb ├── secrets.yml ├── spring.rb ├── storage.docker.yml └── storage.sample.yml ├── db ├── migrate │ ├── 20160424111225_devise_create_users.rb │ ├── 20160424111446_add_user_levels_to_users.rb │ ├── 20160424113217_create_site_settings.rb │ ├── 20160424143518_create_questions.rb │ ├── 20160424143813_add_user_to_questions.rb │ ├── 20160424162234_add_rep_and_name_to_users.rb │ ├── 20160424172308_create_answers.rb │ ├── 20160424172323_add_question_to_answer.rb │ ├── 20160424172807_add_user_to_answers.rb │ ├── 20160424183802_create_votes.rb │ ├── 20160424183824_add_user_and_post_to_votes.rb │ ├── 20160424191151_remove_post_from_votes.rb │ ├── 20160424191405_add_polymorphic_post_to_votes.rb │ ├── 20160424193831_rename_votes_type_to_votes_vote_type.rb │ ├── 20160428151443_add_user_to_privileges.rb │ ├── 20160428151900_add_name_to_privileges.rb │ ├── 20160428152011_add_threshold_to_privileges.rb │ ├── 20160428202611_add_is_deleted_to_questions.rb │ ├── 20160429150239_add_is_deleted_to_answers.rb │ ├── 20160429160133_add_deleted_at_to_questions.rb │ ├── 20160429160144_add_deleted_at_to_answers.rb │ ├── 20160430085505_create_notifications.rb │ ├── 20160430085520_add_user_to_notifications.rb │ ├── 20160430092324_add_default_false_value_to_notifications.rb │ ├── 20160501095155_create_comments.rb │ ├── 20160501095354_add_post_to_comments.rb │ ├── 20160501101156_add_content_to_comments.rb │ ├── 20160501103643_add_is_deleted_to_comments.rb │ ├── 20160501105740_add_user_to_comments.rb │ ├── 20160501150244_create_flags.rb │ ├── 20160501150316_create_flag_statuses.rb │ ├── 20160501150344_add_user_to_flags.rb │ ├── 20160501150355_add_polymorphic_post_to_flags.rb │ ├── 20160501150425_add_flag_to_flag_statuses.rb │ ├── 20160501203952_add_default_to_is_deleted.rb │ ├── 20160507112321_create_post_history_types.rb │ ├── 20160507112635_create_post_histories.rb │ ├── 20160507112646_add_post_to_post_history.rb │ ├── 20160507135329_remove_post_fields_from_post_history.rb │ ├── 20160615175537_add_defaults_to_deleted.rb │ ├── 20160619161305_add_receiving_user_to_votes.rb │ ├── 20160619162714_create_suspicious_votes.rb │ ├── 20160621093334_rename_user_attributes.rb │ ├── 20160621102440_create_join_table_privilege_user.rb │ ├── 20160621145835_add_close_fields_to_questions.rb │ ├── 20160621174102_rename_closed_by_to_closed_by_id.rb │ ├── 20191109211244_change_site_settings_value_type.rb │ ├── 20191110173829_move_to_single_post_model.rb │ ├── 20191110193734_remove_polymorphic_assoc_fields.rb │ ├── 20191110205100_rename_comments_is_deleted.rb │ ├── 20191110212601_add_post_defaults.rb │ ├── 20191120165535_remove_action_name_from_post_history_types.rb │ ├── 20191120170439_remove_user_id_from_privileges.rb │ ├── 20191122124913_change_recv_user_field_name_on_votes.rb │ ├── 20191124214828_add_value_type_to_site_settings.rb │ ├── 20191125135227_add_description_to_site_settings.rb │ ├── 20191125145708_add_name_indexes.rb │ ├── 20191127121809_add_body_markdown_to_posts.rb │ ├── 20191202195956_add_profile_attributes_to_user.rb │ ├── 20191202215751_add_profile_markdown_to_users.rb │ ├── 20191204172132_create_tags.rb │ ├── 20191204172148_create_post_tags_link_table.rb │ ├── 20191204172543_rename_posts_tags.rb │ ├── 20191205115827_add_answer_count_to_posts.rb │ ├── 20191205122016_add_default_to_answer_count.rb │ ├── 20191205122434_add_last_activity_to_posts.rb │ ├── 20191205123038_rework_flag_system_tables.rb │ ├── 20191205123408_add_handled_at_to_flags.rb │ ├── 20191205135001_create_active_storage_tables.active_storage.rb │ ├── 20191205155835_add_state_fields_to_post_history.rb │ ├── 20191205212204_add_attribution_fields_to_post.rb │ ├── 20191205225500_add_se_acct_id_to_users.rb │ ├── 20191206213515_add_transferred_content_to_users.rb │ ├── 20191207001359_add_search_fulltext_index_to_posts.rb │ ├── 20191207011614_add_is_meta_to_posts.rb │ ├── 20191208231830_add_doc_slug_to_posts.rb │ ├── 20191215183139_add_last_activity_by_to_posts.rb │ ├── 20191215211744_change_comments_content_field_type.rb │ ├── 20191216161051_add_users_username_index.rb │ ├── 20191217000359_add_comment_to_post_history.rb │ ├── 20191225135200_add_category_to_site_settings.rb │ ├── 20191225141700_add_setting_categories.rb │ ├── 20200109205444_change_settings_to_text_type.rb │ ├── 20200115221655_create_subscriptions.rb │ ├── 20200116005738_add_name_to_subscriptions.rb │ ├── 20200116132702_add_default_to_subscriptions_enabled.rb │ ├── 20200116132808_allow_null_subscriptions_last_sent.rb │ ├── 20200122151548_add_category_to_posts.rb │ ├── 20200128123353_move_is_meta_to_category.rb │ ├── 20200202052500_create_communities_table.rb │ ├── 20200317173232_close_reasons.rb │ ├── 20200318161617_add_comunity_scope_to_close_reasons.rb │ ├── 20200318164203_add_index_to_flags_status.rb │ ├── 20200321135935_create_tag_sets.rb │ ├── 20200321135945_add_tag_set_reference_to_tags.rb │ ├── 20200323131708_add_indexes_to_posts.rb │ ├── 20200411195247_create_categories.rb │ ├── 20200411195809_move_posts_to_category_reference.rb │ ├── 20200411210022_create_categories_post_types.rb │ ├── 20200412121936_correct_close_reasons_reference_attribute_name.rb │ ├── 20200412122236_add_display_post_types_to_categories.rb │ ├── 20200413144332_add_is_homepage_to_categories.rb │ ├── 20200413174714_add_tag_set_reference_to_categories.rb │ ├── 20200420151217_add_trust_level_to_users.rb │ ├── 20200420151720_add_min_trust_level_to_categories.rb │ ├── 20200422152359_add_button_text_to_categories.rb │ ├── 20200428172814_create_licenses.rb │ ├── 20200428173033_add_license_reference_to_posts.rb │ ├── 20200428181938_add_customization_fields_to_category.rb │ ├── 20200430123008_add_posting_tips_overrides_to_category.rb │ ├── 20200430220415_create_error_logs.rb │ ├── 20200430220944_add_uuid_to_error_logs.rb │ ├── 20200501215447_add_min_view_trust_level_to_categories.rb │ ├── 20200502001225_add_license_reference_to_categories.rb │ ├── 20200502152723_add_enabled_to_licenses.rb │ ├── 20200503110754_add_qr_login_attributes_to_user.rb │ ├── 20200504213143_add_two_factor_token_to_users.rb │ ├── 20200507235849_add_user_agent_to_error_logs.rb │ ├── 20200508112958_add_sequence_to_categories.rb │ ├── 20200508115752_add_category_tag_join_tables.rb │ ├── 20200512115318_create_suggested_edits.rb │ ├── 20200515212247_add_post_indexes.rb │ ├── 20200516162625_update_answer_count_column.rb │ ├── 20200517105207_add_confirmable_to_devise.rb │ ├── 20200528145307_add_two_factor_method_to_users.rb │ ├── 20200601113238_add_index_to_last_activity.rb │ ├── 20200610150214_add_help_attributes_to_posts.rb │ ├── 20200610152505_allow_post_community_id_null.rb │ ├── 20200610152647_allow_post_history_community_id_null.rb │ ├── 20200612154828_add_unique_index_to_posts_tags.rb │ ├── 20200616224440_change_to_wilson_scores.rb │ ├── 20200617140007_change_post_score_column_type.rb │ ├── 20200618094826_add_suspensions_and_warnings.rb │ ├── 20200618124645_add_warning_templates.rb │ ├── 20200625115618_add_mod_tags_join_table.rb │ ├── 20200629131408_update_tag_model.rb │ ├── 20200630001048_remove_excerpt_markdown.rb │ ├── 20200630105117_allow_tag_parents.rb │ ├── 20200701132522_add_index_to_post_score.rb │ ├── 20200701132654_add_indexes_to_vote_counts.rb │ ├── 20200709204628_create_audit_logs.rb │ ├── 20200709204728_add_audit_indexes.rb │ ├── 20200711121645_add_community_to_audit_logs.rb │ ├── 20200716081538_create_blocked_items.rb │ ├── 20200716191141_add_comments_disabled_to_posts.rb │ ├── 20200718163608_rename_type_column_of_blocked_items.rb │ ├── 20200721185048_add_title_and_tags_to_post_history.rb │ ├── 20200721185230_create_post_history_tags.rb │ ├── 20200727183756_create_pinned_links.rb │ ├── 20200728093322_add_eligible_for_hot_post_to_category.rb │ ├── 20200806103121_add_staff_to_users.rb │ ├── 20200810153141_create_trust_levels.rb │ ├── 20200810153831_create_user_privileges.rb │ ├── 20200813125349_rename_ability_tables.rb │ ├── 20200813132829_enforce_concurrence_of_is_moderator_and_mod_ability.rb │ ├── 20200813141412_have_two_descriptions_on_abilities.rb │ ├── 20200814203051_create_post_flag_types.rb │ ├── 20200815103111_add_post_flag_type_id_to_flags.rb │ ├── 20200815191909_add_locked_to_posts.rb │ ├── 20200815193704_add_locked_until_to_posts.rb │ ├── 20200829235149_add_edit_fields_to_post.rb │ ├── 20200910103140_add_before_columns_to_suggested_edit.rb │ ├── 20201001085031_add_read_to_mod_warning.rb │ ├── 20201112021641_add_cid_to_users.rb │ ├── 20201118222120_create_ability_queues.rb │ ├── 20201123132854_add_lockable_omniauthable.rb │ ├── 20201204170746_add_columns_to_post_type.rb │ ├── 20201212235514_move_trust_level_to_community_user.rb │ ├── 20201216202459_add_fake_community_option.rb │ ├── 20201216225353_add_is_freely_editable_to_post_types.rb │ ├── 20201217025220_add_icon_name_to_post_types.rb │ ├── 20201231124614_create_comment_threads.rb │ ├── 20201231130344_add_community_id_to_comment_threads.rb │ ├── 20201231192529_remove_archived_until.rb │ ├── 20210102143426_add_description_to_licenses.rb │ ├── 20210102162706_create_thread_followers.rb │ ├── 20210106230120_add_rep_attributes_to_post_types.rb │ ├── 20210107163304_add_developer_flag_to_users.rb │ ├── 20210112225651_add_hidden_flag_to_communities.rb │ ├── 20210422090732_change_flags_reason_field_type.rb │ ├── 20210609233417_add_defaults.rb │ ├── 20210609235441_add_requires_details_to_post_flag_types.rb │ ├── 20210627152246_make_flags_polymorphic.rb │ ├── 20210710203352_create_reaction_types.rb │ ├── 20210710203801_create_reactions.rb │ ├── 20210710204812_add_has_reactions_to_post_types.rb │ ├── 20210711210342_add_is_active_to_reaction_types.rb │ ├── 20210711230618_move_reputation_to_category_post_type.rb │ ├── 20210712144301_move_category_post_types_to_id_primary_key.rb │ ├── 20210723221136_add_answer_type_to_post_types.rb │ ├── 20210724224957_add_discord_link_to_users.rb │ ├── 20210728161257_add_deleted_to_users.rb │ ├── 20210729174224_remove_suspicious_votes.rb │ ├── 20210821080736_change_notifications_content_field_type.rb │ ├── 20210827143124_post_type_specific_reactions.rb │ ├── 20210827203013_normalize_keys_in_reactions.rb │ ├── 20211113223347_add_escalated_to_flags.rb │ ├── 20211121194612_create_micro_auth_apps.rb │ ├── 20211121195100_create_micro_auth_tokens.rb │ ├── 20220811131155_create_sso_profile.rb │ ├── 20220815130313_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb │ ├── 20220901194344_add_service_name_to_active_storage_blobs.active_storage.rb │ ├── 20220901194345_create_active_storage_variant_records.active_storage.rb │ ├── 20220903174045_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb │ ├── 20220913183826_add_post_to_thread_followers.rb │ ├── 20220915181608_create_tag_synonyms.rb │ ├── 20220916075849_create_filters.rb │ ├── 20221002043021_create_category_filter_defaults.rb │ ├── 20230613205236_add_min_title_length_to_categories.rb │ ├── 20230627035349_add_default_filter_to_category.rb │ ├── 20230726143348_add_hidden_to_post_history.rb │ ├── 20230803191600_add_backup_2fa_code_to_users.rb │ ├── 20230817213150_rename_site_setting_category_email_subscriptions.rb │ ├── 202309141441_disable_needs_author_attention_flag.rb │ ├── 20240405113618_create_email_logs.rb │ ├── 20241020193053_add_post_count_to_community_users.rb │ ├── 20250123141400_create_user_websites.rb │ ├── 20250128030354_create_maintenance_tasks_runs.maintenance_tasks.rb │ ├── 20250128030355_change_cursor_to_string.maintenance_tasks.rb │ ├── 20250128030356_remove_index_on_task_name.maintenance_tasks.rb │ ├── 20250128030357_add_arguments_to_maintenance_tasks_runs.maintenance_tasks.rb │ ├── 20250128030358_add_lock_version_to_maintenance_tasks_runs.maintenance_tasks.rb │ ├── 20250128030359_change_runs_tick_columns_to_bigints.maintenance_tasks.rb │ ├── 20250128030360_add_index_on_task_name_and_status_to_runs.maintenance_tasks.rb │ └── 20250128030361_add_metadata_to_runs.maintenance_tasks.rb ├── schema.rb ├── scripts │ ├── create_tags_path_view.rb │ ├── create_tags_path_view.sql │ ├── recalc_post_scores.sql │ ├── remove_exact_duplicates.sql │ ├── rep_recalc_community.sql │ ├── rep_recalc_user.sql │ ├── reset_answer_counts.sql │ ├── reset_collations.rb │ ├── reset_thread_reply_counts.sql │ └── tag_children.sql ├── seeds.rb └── seeds │ ├── abilities.yml │ ├── abilities │ ├── edit_posts.html │ ├── edit_tags.html │ ├── everyone.html │ ├── flag_close.html │ ├── flag_curate.html │ ├── mod.html │ └── unrestricted.html │ ├── categories.yml │ ├── close_reasons.yml │ ├── community_users.yml │ ├── filters.yml │ ├── licenses.yml │ ├── post_flag_types.yml │ ├── post_history_types.yml │ ├── post_types.yml │ ├── posts.yml │ ├── posts │ ├── abilities.html │ ├── accessibility-policy.html │ ├── accessibility.html │ ├── advanced-formatting.html │ ├── alt-text.html │ ├── articles.html │ ├── category-permissions.html │ ├── coc.html │ ├── deleted.html │ ├── formatting.html │ ├── global_faq.html │ ├── how-to-ask.html │ ├── licenses.html │ ├── local_faq.html │ ├── moderator.html │ ├── privacy-policy.html │ ├── referencing.html │ ├── scoring.html │ ├── search.html │ ├── spam.html │ ├── tos.html │ ├── voting.html │ └── warnings.html │ ├── reaction_types.yml │ ├── site_settings.yml │ ├── site_settings │ ├── asking_guidance.html │ ├── tour_meta_description.html │ ├── tour_more_information.html │ └── widgets_network_pitch.html │ ├── tag_sets.yml │ ├── users.yml │ ├── warning_templates.yml │ └── warning_templates │ ├── off-topic.md │ ├── rudeness.md │ └── spam.md ├── docker-compose.yml ├── docker ├── Dockerfile ├── Dockerfile.arm ├── Dockerfile.db ├── Dockerfile.dev ├── README.md ├── compose-env ├── create_admin_and_community.rb ├── dummy.env ├── entrypoint.sh ├── local-setup.sh └── mysql-init.sql ├── global.d.ts ├── img ├── categories.png ├── create-post.png ├── edit-category.png ├── example_screenshot_codidact.jpg ├── interface.png ├── logged-in.png ├── meta-tags.png ├── post.png ├── qpixel-dev.png ├── required-tags.png ├── tagset-selected.png └── tagset.png ├── lib ├── assets │ └── .keep ├── console_extension.rb ├── namespaced_env_cache.rb ├── rubocop │ └── path_in_helpers.rb └── tasks │ └── .keep ├── package-lock.json ├── package.json ├── public ├── 404.html ├── 422.html ├── 500.html ├── assets │ ├── ability-help │ │ ├── close-dialog.png │ │ ├── edit-link.png │ │ ├── flag-dialog.png │ │ ├── flag-inline-handling.png │ │ └── voting.png │ ├── codidact-org.png │ ├── codidactyl.png │ ├── community │ │ ├── codegolf.css │ │ ├── codegolf.js │ │ ├── judaism.css │ │ └── judaism.js │ ├── down-clear.png │ ├── down-fill.png │ ├── favicon.png │ ├── logo-writing.png │ ├── logo.png │ ├── scoring_3d.png │ ├── scoring_distribution.png │ ├── scoring_formula.png │ ├── scoring_table.png │ ├── scoring_table.svg │ ├── tour-clippy.png │ ├── tour-evil.png │ ├── up-clear.png │ └── up-fill.png ├── favicon.ico └── robots.txt ├── scripts ├── change_to_wilson_scores.rb ├── cleanup_drafts.rb ├── cleanup_votes.rb ├── clear_cache.rb ├── create_backup_2fa_codes.rb ├── create_general_thread_for_old_comments.rb ├── create_initial_tags.rb ├── import │ ├── api_import.rb │ ├── database_import.rb │ ├── dump_import.rb │ └── stack_import.rb ├── mail_uncaptured_donations.rb ├── prune_email_logs.rb ├── recalc_abilities.rb ├── recalc_abilities_upon_first_migration.rb ├── run_spam_cleanup.rb ├── send_subscription_emails.rb └── wipe_everything.rb ├── test ├── .rubocop.yml ├── application_system_test_case.rb ├── controllers │ ├── .keep │ ├── abilities_controller_test.rb │ ├── admin_controller_test.rb │ ├── advertisement_controller_test.rb │ ├── answers_controller_test.rb │ ├── articles_controller_test.rb │ ├── categories_controller_test.rb │ ├── close_reasons_controller_test.rb │ ├── comments_controller_test.rb │ ├── donations_controller_test.rb │ ├── email_logs_controller_test.rb │ ├── fake_community_controller_test.rb │ ├── flags_controller_test.rb │ ├── licenses_controller_test.rb │ ├── micro_auth │ │ ├── apps_controller_test.rb │ │ └── authentication_controller_test.rb │ ├── mod_warning_controller_test.rb │ ├── moderator_controller_test.rb │ ├── notifications_controller_test.rb │ ├── pinned_links_controller_test.rb │ ├── post_history_controller_test.rb │ ├── post_types_controller_test.rb │ ├── posts │ │ ├── change_category_test.rb │ │ ├── close_test.rb │ │ ├── create_test.rb │ │ ├── delete_test.rb │ │ ├── drafts_test.rb │ │ ├── edit_test.rb │ │ ├── feature_test.rb │ │ ├── help_test.rb │ │ ├── lock_test.rb │ │ ├── new_test.rb │ │ ├── reopen_test.rb │ │ ├── restore_test.rb │ │ ├── show_test.rb │ │ ├── toggle_comments_test.rb │ │ ├── unlock_test.rb │ │ └── update_test.rb │ ├── questions_controller_test.rb │ ├── reactions_controller_test.rb │ ├── reports_controller_test.rb │ ├── search_controller_test.rb │ ├── site_settings_controller_test.rb │ ├── subscriptions_controller_test.rb │ ├── suggested_edit_controller_test.rb │ ├── tag_sets_controller_test.rb │ ├── tags_controller_test.rb │ ├── tour_controller_test.rb │ ├── two_factor_controller_test.rb │ ├── users │ │ └── sessions_controller_test.rb │ ├── users_controller_test.rb │ └── votes_controller_test.rb ├── fixtures │ ├── .keep │ ├── abilities.yml │ ├── ability_queues.yml │ ├── audit_logs.yml │ ├── blocked_items.yml │ ├── categories.yml │ ├── category_filter_defaults.yml │ ├── category_post_types.yml │ ├── close_reasons.yml │ ├── comment_threads.yml │ ├── comments.yml │ ├── communities.yml │ ├── community_users.yml │ ├── email_logs.yml │ ├── error_logs.yml │ ├── filters.yml │ ├── flags.yml │ ├── licenses.yml │ ├── micro_auth │ │ ├── apps.yml │ │ └── tokens.yml │ ├── mod_warnings.yml │ ├── notifications.yml │ ├── pinned_links.yml │ ├── post_flag_types.yml │ ├── post_histories.yml │ ├── post_history_tags.yml │ ├── post_history_types.yml │ ├── post_types.yml │ ├── posts.yml │ ├── reaction_types.yml │ ├── reactions.yml │ ├── site_settings.yml │ ├── subscriptions.yml │ ├── suggested_edits.yml │ ├── tag_sets.yml │ ├── tag_synonyms.yml │ ├── tags.yml │ ├── thread_followers.yml │ ├── user_abilities.yml │ ├── users.yml │ ├── votes.yml │ └── warning_templates.yml ├── helpers │ ├── .keep │ ├── abilities_helper_test.rb │ ├── comments_helper_test.rb │ ├── search_helper_test.rb │ ├── seeds_helper_test.rb │ └── users_helper_test.rb ├── integration │ ├── .keep │ └── tasks_integration_test.rb ├── jobs │ └── clean_up_spammy_users_job_test.rb ├── mailers │ ├── .keep │ ├── admin_mailer_test.rb │ ├── donation_mailer_test.rb │ ├── flag_mailer_test.rb │ ├── previews │ │ ├── admin_mailer_preview.rb │ │ ├── devise_mailer_preview.rb │ │ ├── donation_mailer_preview.rb │ │ ├── flag_mailer_preview.rb │ │ ├── subscription_mailer_preview.rb │ │ └── two_factor_mailer_preview.rb │ ├── subscription_mailer_test.rb │ └── two_factor_mailer_test.rb ├── models │ ├── .keep │ ├── ability_queue_test.rb │ ├── ability_test.rb │ ├── audit_log_test.rb │ ├── blocked_item_test.rb │ ├── category_filter_default_test.rb │ ├── category_test.rb │ ├── comment_test.rb │ ├── comment_thread_test.rb │ ├── email_log_test.rb │ ├── error_log_test.rb │ ├── filter_test.rb │ ├── flag_status_test.rb │ ├── flag_test.rb │ ├── license_test.rb │ ├── micro_auth │ │ ├── app_test.rb │ │ └── token_test.rb │ ├── mod_warning_test.rb │ ├── notification_test.rb │ ├── pinned_link_test.rb │ ├── post_flag_type_test.rb │ ├── post_history_tag_test.rb │ ├── post_history_test.rb │ ├── post_history_type_test.rb │ ├── post_test.rb │ ├── reaction_test.rb │ ├── reaction_type_test.rb │ ├── request_context_test.rb │ ├── site_setting_test.rb │ ├── subscription_test.rb │ ├── suggested_edit_test.rb │ ├── tag_set_test.rb │ ├── tag_synonym_test.rb │ ├── tag_test.rb │ ├── thread_follower_test.rb │ ├── user_ability_test.rb │ ├── user_test.rb │ ├── vote_test.rb │ └── warning_template_test.rb ├── support │ ├── application_test_helper.rb │ └── community_related_helper.rb ├── system │ ├── login_test.rb │ └── post_test.rb └── test_helper.rb ├── tsconfig.json └── vendor └── assets ├── javascripts └── .keep └── stylesheets └── .keep /.eslintignore: -------------------------------------------------------------------------------- 1 | **/*{.,-}min.js 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: codidact 2 | custom: https://meta.codidact.com/donate 3 | -------------------------------------------------------------------------------- /.github/workflows/mirror.yml: -------------------------------------------------------------------------------- 1 | name: Mirror to Codeberg 2 | 3 | on: 4 | push: 5 | branches: 6 | - develop 7 | 8 | jobs: 9 | mirror: 10 | name: Mirror 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Checkout repo 15 | uses: actions/checkout@v3 16 | with: 17 | fetch-depth: 0 18 | 19 | - name: Mirror 20 | uses: yesolutions/mirror-action@master 21 | with: 22 | REMOTE: 'git@codeberg.org:codidact/qpixel' 23 | GIT_SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_PRIVATE_KEY }} 24 | GIT_SSH_NO_VERIFY_HOST: "true" 25 | -------------------------------------------------------------------------------- /.github/workflows/typescript.yml: -------------------------------------------------------------------------------- 1 | name: TypeScript check 2 | 3 | on: 4 | push: 5 | branches: 6 | - develop 7 | pull_request: 8 | branches: 9 | - develop 10 | 11 | jobs: 12 | typescript: 13 | name: TypeScript type checking 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - name: Checkout repo 18 | uses: actions/checkout@v3 19 | - name: Install Node 20 | uses: actions/setup-node@v1 21 | with: 22 | node-version: 22 23 | - name: npm install 24 | run: npm install 25 | - name: tsc 26 | run: tsc 27 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | save-exact = true -------------------------------------------------------------------------------- /.sample.irbrc: -------------------------------------------------------------------------------- 1 | Qpixel.irb! if defined?(Qpixel) 2 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('config/application', __dir__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/images/codidact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/images/codidact.png -------------------------------------------------------------------------------- /app/assets/images/codidactyl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/images/codidactyl.png -------------------------------------------------------------------------------- /app/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/images/favicon.ico -------------------------------------------------------------------------------- /app/assets/images/fbm.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/images/fbm.ico -------------------------------------------------------------------------------- /app/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/images/logo.png -------------------------------------------------------------------------------- /app/assets/images/scoring_3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/images/scoring_3d.png -------------------------------------------------------------------------------- /app/assets/images/scoring_distribution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/images/scoring_distribution.png -------------------------------------------------------------------------------- /app/assets/images/scoring_formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/images/scoring_formula.png -------------------------------------------------------------------------------- /app/assets/images/scoring_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/images/scoring_table.png -------------------------------------------------------------------------------- /app/assets/images/square.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/images/square.ico -------------------------------------------------------------------------------- /app/assets/images/stripe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/images/stripe.png -------------------------------------------------------------------------------- /app/assets/images/voting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/images/voting.png -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto-Black-FRLHebrew.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto-Black-FRLHebrew.ttf -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto-Black.ttf -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto-BlackItalic.ttf -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto-Bold.ttf -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto-BoldItalic.ttf -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto-Italic.ttf -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto-LightItalic.ttf -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto-MediumItalic.ttf -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto-Thin.ttf -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto-ThinItalic.ttf -------------------------------------------------------------------------------- /app/assets/imgfonts/Roboto.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/assets/imgfonts/Roboto.ttf -------------------------------------------------------------------------------- /app/assets/javascripts/micro_auth/apps.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', () => { 2 | QPixel.DOM.addSelectorListener('click', '.js-copy-key', (ev) => { 3 | const label = /** @type {HTMLElement} */ (ev.target).closest('label'); 4 | const field = /** @type {HTMLInputElement} */ (document.querySelector(`#${label.getAttribute('for')}`)); 5 | navigator.clipboard.writeText(field.value); 6 | field.focus(); 7 | field.setSelectionRange(0, field.value.length); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /app/assets/javascripts/mod_warning.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', () => { 2 | QPixel.DOM.addSelectorListener('input', '.js--warning-template-selection', (ev) => { 3 | const tgt = /** @type {HTMLInputElement} */ (ev.target); 4 | const input = /** @type {HTMLInputElement} */ (document.querySelector('.js--warning-template-target textarea')); 5 | input.value = atob(tgt.value); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /app/assets/javascripts/modals.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', () => { 2 | document.addEventListener('keypress', (ev) => { 3 | if (ev.code === 'Escape') { 4 | document.querySelectorAll('.modal').forEach((el) => el.classList.remove('is-active')); 5 | } 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /app/assets/javascripts/post_histories.js: -------------------------------------------------------------------------------- 1 | $(() => { 2 | const openRelevantEditOnly = () => { 3 | $("details.history-event").prop('open', false); 4 | $(location.hash).prop('open', true); 5 | } 6 | 7 | window.addEventListener("hashchange", openRelevantEditOnly); 8 | openRelevantEditOnly(); 9 | }); 10 | -------------------------------------------------------------------------------- /app/assets/stylesheets/abilities.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the abilities controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/advertisement.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Advertisement controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/articles.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Articles controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/close_reasons.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the CloseReasons controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/comment_threads.scss: -------------------------------------------------------------------------------- 1 | .post--comments-thread-wrapper { 2 | .post--comments-thread { 3 | .widget--body { 4 | padding: 0; 5 | 6 | .comment { 7 | margin: 0; 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app/assets/stylesheets/errors.scss: -------------------------------------------------------------------------------- 1 | .error-code { 2 | font-size: 8rem; 3 | padding: 0; 4 | margin: -0.3em 0; 5 | } 6 | 7 | .error-name { 8 | font-variant: small-caps; 9 | letter-spacing: 10px; 10 | font-weight: bold; 11 | padding: 0; 12 | margin: 0; 13 | } 14 | 15 | .error-trace { 16 | background: #EEE; 17 | height: unset; 18 | max-height: unset; 19 | white-space: pre-wrap; 20 | word-wrap: break-word; 21 | } 22 | 23 | .error-report-summary { 24 | display: flex; 25 | align-items: center; 26 | 27 | .details { 28 | flex: 1; 29 | } 30 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/fake_community.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the fake_community controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/licenses.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Licenses controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | 5 | .select2-results__option--highlighted .has-color-tertiary-600 { 6 | color: #DDD !important; 7 | } 8 | -------------------------------------------------------------------------------- /app/assets/stylesheets/markdown_tools.scss: -------------------------------------------------------------------------------- 1 | @import './variables'; 2 | 3 | .markdown-tools { 4 | display: flex; 5 | flex-direction: row; 6 | flex-wrap: wrap; 7 | align-items: flex-start; 8 | 9 | .button-list { 10 | margin: 0 0.3em 0.3em 0; 11 | } 12 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/micro_auth/apps.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the MicroAuth/Apps controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | 5 | @import '../variables'; 6 | 7 | .app-security { 8 | input[type="text"] { 9 | font-family: $font-stack-code; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app/assets/stylesheets/micro_auth/authentication.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the MicroAuth/Authentication controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | 5 | .auth-code { 6 | text-align: center; 7 | font-size: 40px; 8 | letter-spacing: 0.25em; 9 | font-weight: bold; 10 | } 11 | -------------------------------------------------------------------------------- /app/assets/stylesheets/mod_warning.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the ModWarning controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/notifications.scss: -------------------------------------------------------------------------------- 1 | @import 'variables'; 2 | 3 | .notification { 4 | border-top: 1px solid $muted-graphic; 5 | padding: 0.5em; 6 | 7 | @media screen and (min-width: $screen-md) { 8 | flex-direction: row; 9 | } 10 | 11 | & > * { 12 | margin: 0 0.2em; 13 | } 14 | 15 | &:last-of-type { 16 | border-bottom: 1px solid $muted-graphic; 17 | } 18 | 19 | .notification--timestamp { 20 | line-break: strict; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/assets/stylesheets/pinned_links.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the PinnedLinks controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/post_types.scss: -------------------------------------------------------------------------------- 1 | @import 'variables'; 2 | 3 | .checkbox-setting { 4 | border: 1px solid $muted-graphic; 5 | border-radius: 0.3em; 6 | display: flex; 7 | flex-direction: row; 8 | align-items: center; 9 | justify-content: space-between; 10 | padding: 0.5em 1em; 11 | margin: 0.5em 0; 12 | 13 | .checkbox-setting--desc label.form-element { 14 | margin: 0.1em 0; 15 | } 16 | 17 | .checkbox-setting--desc .desc { 18 | color: $muted-text; 19 | font-size: 0.8em; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/assets/stylesheets/reports.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Reports controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/site_settings.scss: -------------------------------------------------------------------------------- 1 | .site-setting--value { 2 | min-height: 1em; 3 | min-width: 2em; 4 | overflow-wrap: anywhere; 5 | } 6 | -------------------------------------------------------------------------------- /app/assets/stylesheets/subscriptions.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Subscriptions controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/suggested_edit.scss: -------------------------------------------------------------------------------- 1 | .js-suggested-edit-reject-dialog.is-hidden { 2 | display: none; 3 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/tables.scss: -------------------------------------------------------------------------------- 1 | .table { 2 | &.fixed { 3 | table-layout: fixed; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /app/assets/stylesheets/tabs.scss: -------------------------------------------------------------------------------- 1 | @import 'variables'; 2 | 3 | .tabs { 4 | margin-bottom: 1em; 5 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/tag_sets.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the TagSets controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | 5 | .item-list.is-flex-centered .item-list--text-value { 6 | display: flex; 7 | flex-direction: column; 8 | align-items: center; 9 | justify-content: center; 10 | 11 | &.is-primary { 12 | align-items: flex-start; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/assets/stylesheets/tags.scss: -------------------------------------------------------------------------------- 1 | .tag-cell { 2 | margin: 0.5em 0; 3 | 4 | &:hover { 5 | background: #f0f2ff; 6 | transition: all 0.3s ease; 7 | border-radius: 0.2em; 8 | } 9 | 10 | p { 11 | margin: 0; 12 | } 13 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/tour.scss: -------------------------------------------------------------------------------- 1 | .codidactyl { 2 | width: 80px; 3 | padding: 2rem; 4 | margin-top: 1rem; 5 | } 6 | .codidactyl + .is-flexible { width: 0; } 7 | 8 | .codidactyl-sticky { 9 | position: sticky; 10 | top: 0.5rem; 11 | padding: 1rem; 12 | } 13 | 14 | .codidactyl-small { 15 | max-height: 1em; 16 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/two_factor.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the two_factor controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/fake_community_controller.rb: -------------------------------------------------------------------------------- 1 | class FakeCommunityController < ApplicationController 2 | def communities 3 | @communities = Community.all 4 | render layout: 'without_sidebar' 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/controllers/search_controller.rb: -------------------------------------------------------------------------------- 1 | class SearchController < ApplicationController 2 | def search 3 | @posts, @qualifiers = helpers.search_posts 4 | 5 | @signed_out_me = @qualifiers.any? { |q| q[:param] == :user && q[:user_id].nil? } 6 | 7 | @active_filter = helpers.active_filter 8 | 9 | @count = begin 10 | @posts&.count 11 | rescue 12 | @posts = nil 13 | flash[:danger] = 'Your search syntax is incorrect.' 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /app/controllers/tasks_controller.rb: -------------------------------------------------------------------------------- 1 | class TasksController < ApplicationController 2 | before_action :check_permissions 3 | 4 | private 5 | 6 | def check_permissions 7 | # We can't use ApplicationController#verify_developer because it tries to render not_found with 8 | # layout: 'without_sidebar', which breaks because routing doesn't work under mounted applications. Bleugh. 9 | if !helpers.user_signed_in? || !helpers.current_user.developer? 10 | render plain: '403 Forbidden', status: :forbidden 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/controllers/tour_controller.rb: -------------------------------------------------------------------------------- 1 | class TourController < ApplicationController 2 | layout 'without_sidebar' 3 | 4 | def index; end 5 | 6 | def question1; end 7 | 8 | def question2 9 | @tagset_id = TagSet.find_by(name: 'Tour')&.id || -1 10 | end 11 | 12 | def question3; end 13 | 14 | def more 15 | @communities = Community.all 16 | end 17 | 18 | def end; end 19 | end 20 | -------------------------------------------------------------------------------- /app/helpers/admin_helper.rb: -------------------------------------------------------------------------------- 1 | # Provides helper methods for use by views under AdminController. 2 | module AdminHelper 3 | end 4 | -------------------------------------------------------------------------------- /app/helpers/answers_helper.rb: -------------------------------------------------------------------------------- 1 | # Provides helper methods for use by views under AnswersController. 2 | module AnswersHelper 3 | ## 4 | # Returns the current user's vote for the specified post, or nil if no user is signed in. 5 | # @param answer [Post] The post for which to find a vote. 6 | # @return [Vote, nil] 7 | def my_vote(answer) 8 | user_signed_in? ? answer.votes.where(user: current_user).first : nil 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/helpers/articles_helper.rb: -------------------------------------------------------------------------------- 1 | module ArticlesHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/close_reasons_helper.rb: -------------------------------------------------------------------------------- 1 | module CloseReasonsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/donations_helper.rb: -------------------------------------------------------------------------------- 1 | module DonationsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/edit_helper.rb: -------------------------------------------------------------------------------- 1 | module EditHelper 2 | ## 3 | # Get the maximum edit comment length for the current community, with a maximum of 255. 4 | # @return [Integer] 5 | def max_edit_comment_length 6 | [SiteSetting['MaxEditCommentLength'] || 255, 255].min 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /app/helpers/email_logs_helper.rb: -------------------------------------------------------------------------------- 1 | module EmailLogsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/errors_helper.rb: -------------------------------------------------------------------------------- 1 | module ErrorsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/fake_community_helper.rb: -------------------------------------------------------------------------------- 1 | module FakeCommunityHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/flags_helper.rb: -------------------------------------------------------------------------------- 1 | module FlagsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/licenses_helper.rb: -------------------------------------------------------------------------------- 1 | module LicensesHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/micro_auth/apps_helper.rb: -------------------------------------------------------------------------------- 1 | module MicroAuth::AppsHelper 2 | ## 3 | # Builds & returns a tag-style badge indicating whether a specified app is active for use or not. 4 | # @param app [MicroAuth::App] The app for which to build a badge. 5 | # @return [ActiveSupport::SafeBuffer] A badge; the result of a TagBuilder. 6 | def app_active_badge(app) 7 | tag.span app.active? ? 'active' : 'inactive', 8 | class: "badge is-tag #{app.active? ? 'is-green' : 'is-red'}" 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/helpers/mod_warning_helper.rb: -------------------------------------------------------------------------------- 1 | module ModWarningHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/notifications_helper.rb: -------------------------------------------------------------------------------- 1 | module NotificationsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/pinned_links_helper.rb: -------------------------------------------------------------------------------- 1 | module PinnedLinksHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/questions_helper.rb: -------------------------------------------------------------------------------- 1 | # Provides helper methods for use by views under QuestionsController. 2 | module QuestionsHelper 3 | ## 4 | # Returns the current user's vote for the specified post, or nil if no user is signed in. 5 | # @param question [Post] The post for which to find a vote. 6 | # @return [Vote, nil] 7 | def my_vote(question) 8 | user_signed_in? ? question.votes.where(user: current_user).first : nil 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/helpers/reactions_helper.rb: -------------------------------------------------------------------------------- 1 | module ReactionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/reports_helper.rb: -------------------------------------------------------------------------------- 1 | module ReportsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/site_settings_helper.rb: -------------------------------------------------------------------------------- 1 | # Provides helper methods for use by views under SiteSettingsController. 2 | module SiteSettingsHelper 3 | end 4 | -------------------------------------------------------------------------------- /app/helpers/subscriptions_helper.rb: -------------------------------------------------------------------------------- 1 | module SubscriptionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/suggested_edit_helper.rb: -------------------------------------------------------------------------------- 1 | module SuggestedEditHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/tag_sets_helper.rb: -------------------------------------------------------------------------------- 1 | module TagSetsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/tour_helper.rb: -------------------------------------------------------------------------------- 1 | module TourHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/two_factor_helper.rb: -------------------------------------------------------------------------------- 1 | module TwoFactorHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/votes_helper.rb: -------------------------------------------------------------------------------- 1 | # Provides helper methods for use by views under VotesController. 2 | module VotesHelper 3 | end 4 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /app/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/mailers/.keep -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: -> { "#{SiteSetting['NoReplySenderName']} <#{SiteSetting['NoReplySenderEmail']}>" } 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /app/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/models/.keep -------------------------------------------------------------------------------- /app/models/ability_queue.rb: -------------------------------------------------------------------------------- 1 | class AbilityQueue < ApplicationRecord 2 | belongs_to :community_user 3 | scope :pending, -> { where(completed: false) } 4 | 5 | def self.add(user, comment) 6 | unless AbilityQueue.pending.where(community_user: user.community_user).any? 7 | AbilityQueue.create(community_user: user.community_user, comment: comment, completed: false) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/models/answer.rb: -------------------------------------------------------------------------------- 1 | class Answer < Post 2 | default_scope { where(post_type_id: Answer.post_type_id) } 3 | 4 | def self.post_type_id 5 | PostType.mapping['Answer'] 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/models/article.rb: -------------------------------------------------------------------------------- 1 | class Article < Post 2 | default_scope { where(post_type_id: Article.post_type_id) } 3 | 4 | def self.post_type_id 5 | PostType.mapping['Article'] 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/models/audit_log.rb: -------------------------------------------------------------------------------- 1 | class AuditLog < ApplicationRecord 2 | include CommunityRelated 3 | 4 | belongs_to :related, polymorphic: true, optional: true 5 | belongs_to :user, optional: true 6 | 7 | class << self 8 | [:admin_audit, :moderator_audit, :action_audit, :user_annotation, :user_history, :pii_history, :block_log, 9 | :rate_limit_log].each do |log_type| 10 | define_method(log_type) do |**values| 11 | create(values.merge(log_type: log_type.to_s, community_id: RequestContext.community_id)) 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/models/blocked_item.rb: -------------------------------------------------------------------------------- 1 | class BlockedItem < ApplicationRecord 2 | scope :active, -> { where('expires IS NULL OR expires > NOW()') } 3 | 4 | # Allow for easy checking of type 5 | ['ip', 'email', 'email_host'].each do |bt| 6 | define_method "#{bt.underscore}?" do 7 | item_type == bt 8 | end 9 | scope "#{bt}s".to_sym, -> { active.where(item_type: bt) } 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/models/category_filter_default.rb: -------------------------------------------------------------------------------- 1 | class CategoryFilterDefault < ApplicationRecord 2 | belongs_to :user 3 | belongs_to :filter 4 | belongs_to :category 5 | end 6 | -------------------------------------------------------------------------------- /app/models/category_post_type.rb: -------------------------------------------------------------------------------- 1 | class CategoryPostType < ApplicationRecord 2 | self.table_name = 'categories_post_types' 3 | 4 | belongs_to :category 5 | belongs_to :post_type 6 | 7 | def self.rep_changes 8 | Rails.cache.fetch 'network/category_post_types/rep_changes', include_community: false do 9 | all.to_h { |cpt| [[cpt.category_id, cpt.post_type_id], { 1 => cpt.upvote_rep, -1 => cpt.downvote_rep }] } 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/models/close_reason.rb: -------------------------------------------------------------------------------- 1 | class CloseReason < ApplicationRecord 2 | include MaybeCommunityRelated 3 | 4 | scope :active, -> { where(active: true) } 5 | 6 | validates :name, uniqueness: { scope: [:community_id], case_sensitive: false } 7 | end 8 | -------------------------------------------------------------------------------- /app/models/community.rb: -------------------------------------------------------------------------------- 1 | class Community < ApplicationRecord 2 | has_many :community_users 3 | has_many :site_settings 4 | 5 | default_scope { where(is_fake: false) } 6 | 7 | validates :host, uniqueness: { case_sensitive: false } 8 | end 9 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/models/concerns/community_related.rb: -------------------------------------------------------------------------------- 1 | module CommunityRelated 2 | extend ActiveSupport::Concern 3 | 4 | included do 5 | belongs_to :community 6 | default_scope { where(community_id: RequestContext.community_id) } 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /app/models/concerns/maybe_community_related.rb: -------------------------------------------------------------------------------- 1 | module MaybeCommunityRelated 2 | extend ActiveSupport::Concern 3 | 4 | included do 5 | belongs_to :community, optional: true 6 | default_scope { where(community_id: RequestContext.community_id).or(where(community_id: nil)) } 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /app/models/concerns/post_related.rb: -------------------------------------------------------------------------------- 1 | module PostRelated 2 | extend ActiveSupport::Concern 3 | include CommunityRelated 4 | 5 | included do 6 | belongs_to :post 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /app/models/email_log.rb: -------------------------------------------------------------------------------- 1 | class EmailLog < ApplicationRecord 2 | end 3 | -------------------------------------------------------------------------------- /app/models/error_log.rb: -------------------------------------------------------------------------------- 1 | class ErrorLog < ApplicationRecord 2 | belongs_to :community, optional: true 3 | belongs_to :user, optional: true 4 | end 5 | -------------------------------------------------------------------------------- /app/models/filter.rb: -------------------------------------------------------------------------------- 1 | class Filter < ApplicationRecord 2 | belongs_to :user 3 | has_many :category_filter_defaults, dependent: :destroy 4 | validates :name, uniqueness: { scope: :user } 5 | serialize :include_tags, Array 6 | serialize :exclude_tags, Array 7 | end 8 | -------------------------------------------------------------------------------- /app/models/help_doc.rb: -------------------------------------------------------------------------------- 1 | class HelpDoc < Post 2 | def self.post_type_id 3 | PostType.mapping['HelpDoc'] 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/models/micro_auth.rb: -------------------------------------------------------------------------------- 1 | module MicroAuth 2 | def self.table_name_prefix 3 | 'micro_auth_' 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/models/micro_auth/token.rb: -------------------------------------------------------------------------------- 1 | class MicroAuth::Token < ApplicationRecord 2 | belongs_to :app, class_name: 'MicroAuth::App' 3 | belongs_to :user 4 | 5 | serialize :scope, JSON 6 | 7 | scope :active, -> { where('expires_at > ?', DateTime.now) } 8 | 9 | def active? 10 | expires_at.nil? || expires_at.future? 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/models/notification.rb: -------------------------------------------------------------------------------- 1 | class Notification < ApplicationRecord 2 | include CommunityRelated 3 | belongs_to :user 4 | 5 | delegate :name, to: :community, prefix: true 6 | end 7 | -------------------------------------------------------------------------------- /app/models/pinned_link.rb: -------------------------------------------------------------------------------- 1 | class PinnedLink < ApplicationRecord 2 | include MaybeCommunityRelated 3 | belongs_to :post 4 | end 5 | -------------------------------------------------------------------------------- /app/models/policy_doc.rb: -------------------------------------------------------------------------------- 1 | class PolicyDoc < Post 2 | def self.post_type_id 3 | PostType.mapping['PolicyDoc'] 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/models/post_flag_type.rb: -------------------------------------------------------------------------------- 1 | class PostFlagType < ApplicationRecord 2 | include CommunityRelated 3 | 4 | belongs_to :post_type, optional: true 5 | 6 | validates :name, uniqueness: { scope: [:community_id], case_sensitive: false } 7 | 8 | scope :not_confidential, -> { where(confidential: false) } 9 | scope :confidential, -> { where(confidential: true) } 10 | end 11 | -------------------------------------------------------------------------------- /app/models/post_history_tag.rb: -------------------------------------------------------------------------------- 1 | class PostHistoryTag < ApplicationRecord 2 | belongs_to :post_history 3 | belongs_to :tag 4 | 5 | validates :relationship, uniqueness: { scope: [:tag_id, :post_history_id], case_sensitive: false } 6 | end 7 | -------------------------------------------------------------------------------- /app/models/post_history_type.rb: -------------------------------------------------------------------------------- 1 | class PostHistoryType < ApplicationRecord 2 | has_many :post_histories 3 | 4 | validates :name, uniqueness: { case_sensitive: false } 5 | end 6 | -------------------------------------------------------------------------------- /app/models/posts_tag.rb: -------------------------------------------------------------------------------- 1 | class PostsTag < ApplicationRecord 2 | belongs_to :tag 3 | belongs_to :post 4 | end 5 | -------------------------------------------------------------------------------- /app/models/question.rb: -------------------------------------------------------------------------------- 1 | class Question < Post 2 | default_scope { where(post_type_id: Question.post_type_id) } 3 | 4 | scope :meta, -> { joins(:category).where(categories: { name: 'Meta' }) } 5 | scope :main, -> { joins(:category).where(categories: { name: 'Main' }) } 6 | 7 | def self.post_type_id 8 | PostType.mapping['Question'] 9 | end 10 | 11 | def answers 12 | Answer.where(parent: self) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/models/reaction.rb: -------------------------------------------------------------------------------- 1 | class Reaction < ApplicationRecord 2 | belongs_to :reaction_type 3 | belongs_to :user 4 | belongs_to :post 5 | belongs_to :comment, optional: true 6 | 7 | default_scope { joins(:reaction_type).where(reaction_types: { community_id: RequestContext.community_id }) } 8 | end 9 | -------------------------------------------------------------------------------- /app/models/reaction_type.rb: -------------------------------------------------------------------------------- 1 | class ReactionType < ApplicationRecord 2 | include CommunityRelated 3 | belongs_to :post_type, class_name: 'PostType', optional: true 4 | 5 | validates :name, uniqueness: { scope: [:community_id], case_sensitive: false } 6 | 7 | scope :active, -> { where(active: true) } 8 | end 9 | -------------------------------------------------------------------------------- /app/models/sso_profile.rb: -------------------------------------------------------------------------------- 1 | class SsoProfile < ApplicationRecord 2 | belongs_to :user, inverse_of: :sso_profile 3 | 4 | validates :saml_identifier, uniqueness: true, presence: true 5 | end 6 | -------------------------------------------------------------------------------- /app/models/tag_with_path.rb: -------------------------------------------------------------------------------- 1 | class TagWithPath < Tag 2 | self.table_name = 'tags_paths' 3 | end 4 | -------------------------------------------------------------------------------- /app/models/thread_follower.rb: -------------------------------------------------------------------------------- 1 | class ThreadFollower < ApplicationRecord 2 | belongs_to :comment_thread, optional: true 3 | belongs_to :post, optional: true 4 | belongs_to :user 5 | 6 | validate :thread_or_post 7 | 8 | private 9 | 10 | def thread_or_post 11 | if comment_thread.nil? && post.nil? 12 | errors.add(:base, 'Must refer to either a comment thread or a post.') 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/models/user_ability.rb: -------------------------------------------------------------------------------- 1 | class UserAbility < ApplicationRecord 2 | belongs_to :community_user 3 | belongs_to :ability 4 | 5 | def suspended? 6 | return true if is_suspended && suspension_end.nil? # permanent suspension 7 | return true if is_suspended && !suspension_end.past? 8 | 9 | if is_suspended 10 | update(is_suspended: false, suspension_message: nil, suspension_end: nil) 11 | end 12 | 13 | false 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/models/user_website.rb: -------------------------------------------------------------------------------- 1 | class UserWebsite < ApplicationRecord 2 | belongs_to :user 3 | default_scope { order(:position) } 4 | 5 | MAX_ROWS = 3 6 | end 7 | -------------------------------------------------------------------------------- /app/views/admin_mailer/to_all_users.html.erb: -------------------------------------------------------------------------------- 1 | <%= raw(sanitize(ApplicationController.helpers.render_markdown(@body_markdown), 2 | scrubber: ApplicationController.helpers.scrubber)) %> 3 | -------------------------------------------------------------------------------- /app/views/admin_mailer/to_all_users.text.erb: -------------------------------------------------------------------------------- 1 | <%= ApplicationController.helpers.strip_markdown @body_markdown %> 2 | -------------------------------------------------------------------------------- /app/views/admin_mailer/to_moderators.html.erb: -------------------------------------------------------------------------------- 1 | <%= raw(sanitize(ApplicationController.helpers.render_markdown(@body_markdown), 2 | scrubber: ApplicationController.helpers.scrubber)) %> -------------------------------------------------------------------------------- /app/views/admin_mailer/to_moderators.text.erb: -------------------------------------------------------------------------------- 1 | <%= ApplicationController.helpers.strip_markdown @body_markdown %> -------------------------------------------------------------------------------- /app/views/application/keyboard_tools.html.erb: -------------------------------------------------------------------------------- 1 |

Keyboard tools

2 |

Codidact supports keyboard tools to enhance user accessibility. You can activate (and then later deactivate) them here on this page:

3 |

You'll need JavaScript to be enabled for the tools to work.

4 | 5 |

Keyboard tools are currently unknown. 6 | 7 |

8 | 9 |

This setting is stored in your browser and not your user account, so you can set it as you want it on any device.

-------------------------------------------------------------------------------- /app/views/categories/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Edit Category

2 |

3 | If you need to change something about one of your site's categories, this is the place to do it. 4 |

5 | 6 | <%= render 'form', submit_path: update_category_path(@category) %> -------------------------------------------------------------------------------- /app/views/categories/new.html.erb: -------------------------------------------------------------------------------- 1 |

New Category

2 |

3 | If the standard two Q&A categories aren't enough for your site, you can add a new category here. 4 |

5 | 6 | <%= render 'form', submit_path: create_category_path %> 7 | -------------------------------------------------------------------------------- /app/views/categories/post_types.html.erb: -------------------------------------------------------------------------------- 1 |

What kind of post?

2 |

3 | This category has more than one type of post available. Pick a post type to get started. 4 |

5 | 6 | <% @post_types.each do |pt| %> 7 |

<%= link_to pt.name.underscore.humanize, new_category_post_path(post_type: pt, category: @category) %>

8 |

<%= pt.description %>

9 |
10 | <% end %> 11 | -------------------------------------------------------------------------------- /app/views/categories/rss_feed.rss.builder: -------------------------------------------------------------------------------- 1 | xml.instruct! :xml, version: '1.0' 2 | xml.feed xmlns: 'http://www.w3.org/2005/Atom' do 3 | xml.id category_feed_url(@category) 4 | xml.title "New Posts - #{@category.name} - #{SiteSetting['SiteName']}" 5 | xml.author do 6 | xml.name "#{SiteSetting['SiteName']} - Codidact" 7 | end 8 | xml.link nil, rel: 'self', href: category_url(@category) 9 | xml.updated @posts.maximum(:last_activity)&.iso8601 || RequestContext.community.created_at&.iso8601 10 | 11 | xml << render('posts/feed', posts: @posts, builder: xml) 12 | end 13 | -------------------------------------------------------------------------------- /app/views/close_reasons/new.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, "Close Reasons" %> 2 | 3 |

Add <%= (params[:global] == "1") ? "global" : "" %> close reason

4 | 5 | <% if @close_reason.errors.any? %> 6 |
7 | These errors prevented this close reason from being saved: 8 | 13 |
14 | <% end %> 15 | 16 | <%= render 'form', submit_url: create_close_reason_path(global: params[:global]) %> 17 | -------------------------------------------------------------------------------- /app/views/comments/_skip_deleted.erb: -------------------------------------------------------------------------------- 1 |
2 |

3 | Skipping <%= pluralize(skipped_deleted, 'deleted comment') %>. 4 | <% if current_user&.at_least_moderator? %> 5 | 6 | Show <%= skipped_deleted > 1 ? 'them' : 'it' %> anyway. 7 | 8 | <% end %> 9 |

10 |
11 | -------------------------------------------------------------------------------- /app/views/comments/post.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'post', comment_threads: @comment_threads %> -------------------------------------------------------------------------------- /app/views/comments/thread_followers.html.erb: -------------------------------------------------------------------------------- 1 |

<%= pluralize(@followers.count, 'follower') %>

2 | 3 | <% @followers.each do |tf| %> 4 | <%= render 'users/common_card', user: tf.user %> 5 | <% end %> 6 | -------------------------------------------------------------------------------- /app/views/devise/mailer/_friendly_footer.html.erb: -------------------------------------------------------------------------------- 1 |
2 |

Thanks!

3 |

Your Friendly Neighbourhood Codidactyl

-------------------------------------------------------------------------------- /app/views/devise/mailer/password_change.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.username %>!

2 | 3 |

4 | This email is just to let you know that your password has been changed. 5 |

6 |

7 | If this was you, you can safely ignore this email. If it wasn't, please 8 | <%= link_to 'change your password now', new_password_url(@resource) %> to protect your account. 9 |

10 | 11 | <%= render 'devise/mailer/friendly_footer' %> 12 | -------------------------------------------------------------------------------- /app/views/devise/mailer/unlock_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.username %>!

2 | 3 |

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

4 | 5 |

Click the link below to unlock your account:

6 | 7 |

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token), class: 'button is-filled' %>

8 | 9 | <%= render 'devise/mailer/friendly_footer' %> 10 | -------------------------------------------------------------------------------- /app/views/devise/shared/_error_messages.html.erb: -------------------------------------------------------------------------------- 1 | <% if resource.errors.any? %> 2 |
3 |

4 | <%= I18n.t("errors.messages.not_saved", 5 | count: resource.errors.count, 6 | resource: resource.class.model_name.human.downcase) 7 | %> 8 |

9 | 14 |
15 | <% end %>
16 | -------------------------------------------------------------------------------- /app/views/errors/conflict.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, 'Conflict' %> 2 | 3 |

409

4 |

conflict

5 | 6 |

Your request conflicted with another request.

7 | 8 |

Any changes you were trying to make are unlikely to have been saved - go back and try again.

9 | 10 | 11 |

12 | <%= link_to 'Go back', :back, class: 'button is-outlined' %> 13 | <%= link_to 'Go home', root_path, class: 'button is-outlined' %> 14 |

-------------------------------------------------------------------------------- /app/views/errors/error.html.erb: -------------------------------------------------------------------------------- 1 |

Error

-------------------------------------------------------------------------------- /app/views/errors/forbidden.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, 'Forbidden' %> 2 | 3 |

403

4 |

forbidden

5 | 6 |

You don't have the necessary permissions to do that.

7 | 8 |

You might have tried to access or change something you don't have access to.

9 | 10 | 11 |

12 | <%= link_to 'Go back', :back, class: 'button is-outlined' %> 13 | <%= link_to 'Go home', root_path, class: 'button is-outlined' %> 14 |

-------------------------------------------------------------------------------- /app/views/errors/locked.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, 'Locked' %> 2 | 3 |

401

4 |

locked

5 | 6 |

The post has been locked and cannot be edited, commented or voted on.

7 | 8 |

9 | <%= link_to 'Go back', :back, class: 'button is-outlined' %> 10 | <%= link_to 'Go home', root_path, class: 'button is-outlined' %> 11 |

-------------------------------------------------------------------------------- /app/views/errors/not_found.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, 'Not Found' %> 2 | 3 |

404

4 |

not found

5 | 6 |

The page you're looking for couldn't be found.

7 | 8 |

You might have followed an old link, or a post might have been deleted.

9 | 10 | 11 |

12 | <%= link_to 'Go back', :back, class: 'button is-outlined' %> 13 | <%= link_to 'Go home', root_path, class: 'button is-outlined' %> 14 |

-------------------------------------------------------------------------------- /app/views/errors/read_only.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, 'Read Only' %> 2 | 3 |

423

4 |

locked

5 | 6 |

This resource is locked because the site is in read-only mode.

7 |

8 | Any changes you were making have not been saved. Please retry this request once 9 | the site has been taken out of read only mode. 10 |

11 | 12 |

13 | <%= link_to 'Go back', :back, class: 'button is-outlined' %> 14 | <%= link_to 'Go home', root_path, class: 'button is-outlined' %> 15 |

-------------------------------------------------------------------------------- /app/views/errors/stat.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, 'Stat Error' %> 2 | 3 |

418

4 |

stat error

5 | 6 |

<%= ApplicationRecord.useful_err_msg.sample %>

-------------------------------------------------------------------------------- /app/views/flag_mailer/flag_escalated.html.erb: -------------------------------------------------------------------------------- 1 |

New Flag Escalation on <%= @flag.community.name %>

2 | 3 | <%= render 'flags/flag', flag: @flag, controls: false, escalation: true %> 4 | -------------------------------------------------------------------------------- /app/views/flags/history.html.erb: -------------------------------------------------------------------------------- 1 |

Flag History

2 |

3 | Below is a list of all the flags you have cast and the outcome of each of them. Moderators handling your flags may also 4 | have left you feedback. 5 |

6 | 7 |

8 | <%= pluralize(@flags.count, 'flag') %> 9 |

10 |

<%= @statuses.map { |s, c| "#{c} #{s.present? ? s : 'pending'}" }.join(', ') %>

11 | 12 | <% @flags.each do |flag| %> 13 | <%= render 'handled', flag: flag %> 14 | <% end %> 15 | 16 | <%= will_paginate @flags, renderer: BootstrapPagination::Rails %> 17 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | 3 | ----- 4 | 5 | (c) 2020- The Codidact Foundation 6 | 71-75 Shelton Street 7 | London, UK 8 | WC2H 9JQ 9 | <%= SiteSetting['SupportReceiverEmail'] || 'info@codidact.org' %> 10 | -------------------------------------------------------------------------------- /app/views/licenses/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Edit License

2 |

If you've made a mistake or something's changed, you can update license details here.

3 | 4 | <%= render 'form', submit_path: update_license_path(@license) %> -------------------------------------------------------------------------------- /app/views/licenses/new.html.erb: -------------------------------------------------------------------------------- 1 |

New License

2 |

You can add a new license for users to pick from here.

3 | 4 | <%= render 'form', submit_path: new_license_path %> -------------------------------------------------------------------------------- /app/views/micro_auth/apps/edit.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, 'Edit OAuth App' %> 2 | 3 |

Edit OAuth App

4 | 5 | <%= render 'form', submit_url: update_oauth_app_path(@app.app_id) %> 6 | -------------------------------------------------------------------------------- /app/views/micro_auth/apps/new.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, 'New OAuth App' %> 2 | 3 |

New OAuth App

4 | 5 | <%= render 'form', submit_url: create_oauth_app_path %> 6 | -------------------------------------------------------------------------------- /app/views/micro_auth/authentication/approved.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, 'App Approved' %> 2 | 3 |

App Approved

4 | 5 |

6 | You have successfully approved the app <%= @app.name %> to access your account. Please return to the 7 | app to continue where you left off. 8 |

9 | 10 |

Your code to complete authentication is:

11 | 12 |

<%= @token.code %>

13 | -------------------------------------------------------------------------------- /app/views/micro_auth/authentication/reject.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, 'OAuth Request Rejected' %> 2 | 3 |

Request Rejected

4 | 5 |

This request for access to your account has been rejected. No further action is necessary.

6 | -------------------------------------------------------------------------------- /app/views/moderator/recently_deleted_posts.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, "Recently Deleted Posts" %> 2 | <%= link_to moderator_path, class: 'has-font-size-small' do %> 3 | « Return to moderator tools 4 | <% end %> 5 | 6 |

Recently Deleted Posts

7 |
8 | <% @posts.each do |post| %> 9 | <%= render 'posts/type_agnostic', post: post %> 10 | <% end %> 11 |
12 | 13 | <%= will_paginate @posts, renderer: BootstrapPagination::Rails %> 14 | -------------------------------------------------------------------------------- /app/views/pinned_links/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Edit featured link

2 | 3 | <% if @link.errors.any? %> 4 |
5 | These errors prevented this link from being saved: 6 | 11 |
12 | <% end %> 13 | 14 | <%= render 'form', url: update_pinned_link_path(global: params[:global]) %> 15 | -------------------------------------------------------------------------------- /app/views/pinned_links/new.html.erb: -------------------------------------------------------------------------------- 1 |

New featured link

2 | 3 | <% if @link.errors.any? %> 4 |
5 | These errors prevented this link from being saved: 6 | 11 |
12 | <% end %> 13 | 14 | <%= render 'form', url: create_pinned_link_path %> 15 | -------------------------------------------------------------------------------- /app/views/post_types/_type.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <% if type.icon_name.present? %> 5 | 6 | <% end %> 7 | <%= type.name %> 8 |

9 | <% if type.description.present? %> 10 |

<%= type.description %>

11 | <% end %> 12 |
13 | 18 |
19 | -------------------------------------------------------------------------------- /app/views/post_types/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Edit Post Type

2 |

You're editing the <%= post_type_badge(@type) %> post type.

3 | 4 | <% if @type.errors.any? %> 5 |
6 | <%= pluralize(@type.errors.size, 'error') %> prevented this post type being saved: 7 | 8 | 13 |
14 | <% end %> 15 | 16 | <%= render 'form', submit_path: update_post_type_path(@type) %> 17 | -------------------------------------------------------------------------------- /app/views/post_types/new.html.erb: -------------------------------------------------------------------------------- 1 |

New Post Type

2 |

You're creating a new post type.

3 | 4 | <%= render 'form', submit_path: create_post_type_path %> 5 | -------------------------------------------------------------------------------- /app/views/posts/_edit_link.html.erb: -------------------------------------------------------------------------------- 1 | <%# 2 | Helper for rendering post edit link buttons 3 | 4 | Variables: 5 | post : Post to create the link for 6 | %> 7 | 8 | <%= link_to edit_post_path(post), class: 'tools--item', 'aria-label': 'Edit this post' do %> 9 | 10 | Edit 11 | <% end %> 12 | -------------------------------------------------------------------------------- /app/views/posts/_feed.rss.builder: -------------------------------------------------------------------------------- 1 | posts.each do |post| 2 | builder.entry do 3 | builder.id generic_show_link(post) 4 | builder.title post.title 5 | builder.author do 6 | builder.name rtl_safe_username(post.user) 7 | builder.uri deleted_user?(post.user) ? '#' : user_url(post.user) 8 | end 9 | builder.published post.created_at&.iso8601 10 | builder.updated post.last_activity&.iso8601 11 | builder.link href: generic_show_link(post) 12 | builder.summary post.body.truncate(200), type: 'html' 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/views/posts/_markdown_script.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/views/posts/_review_edit_link.html.erb: -------------------------------------------------------------------------------- 1 | <%# 2 | Helper for rendering suggested edit review link buttons 3 | 4 | Variables: 5 | post : Post to create the link for 6 | %> 7 | 8 | <%= link_to suggested_edit_url(post.pending_suggested_edit.id), class: 'tools--item is-danger is-filled' do %> 9 | 10 | Review suggested edit 11 | <% end %> 12 | -------------------------------------------------------------------------------- /app/views/questions/lottery.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, 'Questions Lottery' %> 2 | 3 |

Questions

4 | 5 | <%= render 'list' %> 6 | -------------------------------------------------------------------------------- /app/views/reactions/new.html.erb: -------------------------------------------------------------------------------- 1 |

New reaction

2 | 3 | <% if @reaction_type.errors.any? %> 4 |
5 | These errors prevented this reaction type being saved: 6 | 11 |
12 | <% end %> 13 | 14 | <%= render 'form', submit_url: create_reaction_path, method: :post %> 15 | -------------------------------------------------------------------------------- /app/views/reports/subscriptions.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'tabs' %> 2 | 3 |
4 | <%= stat_panel 'all', @types.map { |_, v| v }.sum %> 5 | <%= stat_panel 'interesting', @types['interesting'] %> 6 | <%= stat_panel 'tag', @types['tag'] %> 7 | <%= stat_panel 'user', @types['user'] %> 8 |
9 | 10 |

New subscriptions

11 | <%= line_chart Subscription.where('created_at >= ?', 1.year.ago).group_by_week(:created_at).count %> -------------------------------------------------------------------------------- /app/views/shared/_lock_notice.html.erb: -------------------------------------------------------------------------------- 1 | <%# 2 | Reusable helper view for lock notices (posts & comments). 3 | 4 | Variables: 5 | level : notice severity level (one of: 'info', 'error', default 'error') 6 | text : notice text to display 7 | %> 8 | 9 | <% 10 | #defaults 11 | level ||= defined?(level) && !level.nil? ? level : 'error' 12 | %> 13 | 14 |

15 | <%= sanitize(text) %> 16 |

-------------------------------------------------------------------------------- /app/views/shared/_rss_link.html.erb: -------------------------------------------------------------------------------- 1 | <%# 2 | 'Adds an RSS link. 3 | Variables: 4 | url : [String] URL to the feed 5 | text : [String, Nil] text to visibly show 6 | tooltip : [String, Nil] text to show in the tooltip 7 | ' 8 | %> 9 | 10 | <% 11 | # Defaults 12 | text = defined?(text) ? text : 'RSS' 13 | tooltip = defined?(tooltip) ? tooltip : 'RSS Feed' 14 | %> 15 | 16 | 17 | <%= link_to url, class: 'has-display-inline-block' do %> 18 | RSS 19 | <% end %> 20 | -------------------------------------------------------------------------------- /app/views/subscriptions/error.html.erb: -------------------------------------------------------------------------------- 1 |

New Questions Subscription

2 |
3 |

4 | There was a problem saving your subscription: 5 | 6 |

11 |

12 | 13 |

If you came here from a link and had filled in the requested details, this may be a bug. Please let us know on 14 | <%= link_to 'Meta', 'https://meta.codidact.com/' %>.

15 |
16 | -------------------------------------------------------------------------------- /app/views/tags/edit.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, 'Edit tag' %> 2 | 3 |

4 | Edit <%= @tag.name %> 5 |

6 | 7 | <%= render 'form', submit_path: update_tag_path(id: @category.id, tag_id: @tag.id) %> -------------------------------------------------------------------------------- /app/views/tags/new.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title, 'Create tag' %> 2 | 3 |

4 | Create Tag 5 |

6 | 7 | <%= render 'form', submit_path: create_tag_path %> -------------------------------------------------------------------------------- /app/views/two_factor/disable_link.html.erb: -------------------------------------------------------------------------------- 1 |

Disabling two-factor authentication

2 | 3 |

Please click the button below to confirm you want to disable two-factor authentication on your account.

4 | 5 |

<%= link_to 'Disable 2FA', two_factor_confirm_disable_link_path, method: :post, class: 'button is-filled is-danger', role: 'button' %>

-------------------------------------------------------------------------------- /app/views/two_factor_mailer/disable_email.html.erb: -------------------------------------------------------------------------------- 1 |

Disable two-factor authentication

2 |

3 | Someone recently requested a link to turn off two-factor authentication on your Codidact account. 4 | If that was you, great! <%= link_to 'Use this link to disable 2FA', two_factor_disable_link_url(@token, host: @host) %> 5 |

6 | 7 |

If this wasn't you, you should <%= link_to 'change your password', edit_user_registration_url(host: @host) %>

-------------------------------------------------------------------------------- /app/views/two_factor_mailer/disable_email.text.erb: -------------------------------------------------------------------------------- 1 | ### Disable two-factor authentication ### 2 | 3 | Someone recently requested a link to turn off two-factor authentication on your Codidact account. 4 | If that was you, great! Use this link to disable 2FA: <%= two_factor_disable_link_url(@token, host: @host) %> 5 | 6 | If this wasn't you, you should change your password: <%= edit_user_registration_url(host: @host) %> -------------------------------------------------------------------------------- /app/views/two_factor_mailer/login_email.html.erb: -------------------------------------------------------------------------------- 1 |

Welcome back to Codidact!

2 |

<%= link_to 'Use this link to sign in', qr_login_url(@token, host: @host) %>

3 |

We'll see you soon!

-------------------------------------------------------------------------------- /app/views/two_factor_mailer/login_email.text.erb: -------------------------------------------------------------------------------- 1 | ### Welcome back to Codidact! ### 2 | 3 | Use this link to sign in: <%= qr_login_url(@token, host: @host) %> 4 | 5 | We'll see you soon! -------------------------------------------------------------------------------- /app/views/users/_post_usercard.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= render 'users/common_card', user: post.user, ckb: false %> 3 |
-------------------------------------------------------------------------------- /app/views/users/_user.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= render 'users/common_card', user: user, ckb: true , small: true%> 3 |
4 | -------------------------------------------------------------------------------- /app/views/users/filters.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'tabs', user: current_user %> 2 | 3 |

Filters

4 |

5 | Manage your filters here 6 |

7 | 8 | <%# Just a nominal form so that stuff like validation works %> 9 |
10 | <%= render 'search/filters', allow_apply: false, allow_delete: true %> 11 | -------------------------------------------------------------------------------- /app/views/users/network.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'tabs', user: @user %> 2 | 3 |

Profiles for <%= user_link @user %>

4 | 5 |

6 | Links to profiles on other communities on this network. 7 |

8 | 9 | <%= render 'network' %> 10 | 11 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('spring', __dir__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('spring', __dir__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: qpixel_production 11 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/initializers/amazon_ses.rb: -------------------------------------------------------------------------------- 1 | ActionMailer::Base.add_delivery_method :ses, AWS::SES::Base, 2 | access_key_id: Rails.application.credentials.ses_access_key, 3 | secret_access_key: Rails.application.credentials.ses_secret_key, 4 | server: 'email.us-east-1.amazonaws.com', 5 | signature_version: 4 6 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in the app/assets 11 | # folder are already added. 12 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 13 | -------------------------------------------------------------------------------- /config/initializers/config.rb: -------------------------------------------------------------------------------- 1 | AppConfig ||= OpenStruct.new 2 | 3 | Dir.glob(Rails.root.join('config/config/*.yml')).each do |f| 4 | basename = Pathname.new(f).relative_path_from(Pathname.new(Rails.root.join('config/config'))).to_s 5 | root_key = basename.gsub('.yml', '') 6 | processed = ERB.new(File.read(f)).result(binding) 7 | AppConfig[root_key] = YAML.load(processed) 8 | end -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure parameters to be filtered from the log file. Use this to limit dissemination of 4 | # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported 5 | # notations and behaviors. 6 | Rails.application.config.filter_parameters += [ 7 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 8 | ] 9 | -------------------------------------------------------------------------------- /config/initializers/maintenance_tasks.rb: -------------------------------------------------------------------------------- 1 | MaintenanceTasks.parent_controller = 'TasksController' 2 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide HTTP permissions policy. For further 2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 3 | # 4 | # Rails.application.config.permissions_policy do |f| 5 | # f.camera :none 6 | # f.gyroscope :none 7 | # f.microphone :none 8 | # f.usb :none 9 | # f.fullscreen :self 10 | # f.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | if Rails.env.production? 4 | Rails.application.config.session_store :cookie_store, key: 'codidact_acct', domain: :all 5 | else 6 | Rails.application.config.session_store :cookie_store, key: 'codidact_acct' 7 | end 8 | -------------------------------------------------------------------------------- /config/initializers/stripe.rb: -------------------------------------------------------------------------------- 1 | class StripeHelpers 2 | def self.secret_key 3 | if Rails.env.production? 4 | Rails.application.credentials.stripe_live_secret 5 | else 6 | Rails.application.credentials.stripe_test_secret 7 | end 8 | end 9 | 10 | def self.public_key 11 | if Rails.env.production? 12 | Rails.application.credentials.stripe_live_public 13 | else 14 | Rails.application.credentials.stripe_test_public 15 | end 16 | end 17 | end 18 | 19 | Stripe.api_key = StripeHelpers.secret_key 20 | -------------------------------------------------------------------------------- /config/initializers/will_paginate_added_also_on_arrays.rb: -------------------------------------------------------------------------------- 1 | require 'will_paginate/array' -------------------------------------------------------------------------------- /config/initializers/zz_cache_setup.rb: -------------------------------------------------------------------------------- 1 | Rails.cache.persistent 'current_commit', clear: true do 2 | commit_sha = `git rev-parse HEAD`.strip 3 | commit_date = `git log -1 --date=iso-strict --pretty=format:%cd`.strip 4 | [commit_sha, commit_date] 5 | end 6 | -------------------------------------------------------------------------------- /config/locales/es.yml: -------------------------------------------------------------------------------- 1 | es: 2 | hello: "Hola mundo" 3 | -------------------------------------------------------------------------------- /config/locales/strings/en.edits.yml: -------------------------------------------------------------------------------- 1 | en: 2 | edits: 3 | # validation error messages 4 | max_edit_comment_length: 5 | one: Edit comment can't be more than 1 character long. 6 | other: Edit comment can't be more than :length characters long. -------------------------------------------------------------------------------- /config/locales/strings/en.search.yml: -------------------------------------------------------------------------------- 1 | en: 2 | search: 3 | # used on the users page (not the main search) 4 | no_users: 5 | No users found. 6 | -------------------------------------------------------------------------------- /config/locales/strings/en.votes.yml: -------------------------------------------------------------------------------- 1 | en: 2 | votes: 3 | summary: 4 | post_missing: 'Post not found' -------------------------------------------------------------------------------- /config/locales/time.en_abbrev.yml: -------------------------------------------------------------------------------- 1 | en_abbrev: 2 | datetime: 3 | distance_in_words: 4 | x_seconds: '%{count}s' 5 | less_than_x_minutes: '<%{count}m' 6 | x_minutes: '%{count}m' 7 | about_x_hours: '%{count}h' 8 | x_hours: '%{count}h' 9 | x_days: '%{count}d' 10 | x_weeks: '%{count}w' 11 | about_x_months: '%{count}mo' 12 | x_months: '%{count}mo' 13 | about_x_years: '%{count}y' 14 | almost_x_years: '%{count}y' 15 | x_years: '%{count}y' 16 | over_x_years: '%{count}y' -------------------------------------------------------------------------------- /config/spring.rb: -------------------------------------------------------------------------------- 1 | Spring.watch( 2 | ".ruby-version", 3 | ".rbenv-vars", 4 | "tmp/restart.txt", 5 | "tmp/caching-dev.txt" 6 | ) 7 | -------------------------------------------------------------------------------- /config/storage.docker.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join('tmp/storage') %> 4 | 5 | local: 6 | service: Disk 7 | root: <%= Rails.root.join('storage') %> 8 | 9 | s3: 10 | service: S3 11 | access_key_id: "" 12 | secret_access_key: "" 13 | region: us-east-1 14 | bucket: "" 15 | -------------------------------------------------------------------------------- /db/migrate/20160424111446_add_user_levels_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddUserLevelsToUsers < ActiveRecord::Migration 2 | def change 3 | add_column :users, :is_moderator, :boolean 4 | add_column :users, :is_admin, :boolean 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20160424113217_create_site_settings.rb: -------------------------------------------------------------------------------- 1 | class CreateSiteSettings < ActiveRecord::Migration 2 | def change 3 | create_table :site_settings do |t| 4 | t.string :name 5 | t.string :value 6 | 7 | t.timestamps null: false 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20160424143518_create_questions.rb: -------------------------------------------------------------------------------- 1 | class CreateQuestions < ActiveRecord::Migration 2 | def change 3 | create_table :questions do |t| 4 | t.string :title 5 | t.string :body 6 | t.text :tags 7 | t.integer :score 8 | 9 | t.timestamps null: false 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20160424143813_add_user_to_questions.rb: -------------------------------------------------------------------------------- 1 | class AddUserToQuestions < ActiveRecord::Migration 2 | def change 3 | add_reference :questions, :user, index: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160424162234_add_rep_and_name_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddRepAndNameToUsers < ActiveRecord::Migration 2 | def change 3 | add_column :users, :reputation, :integer 4 | add_column :users, :username, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20160424172308_create_answers.rb: -------------------------------------------------------------------------------- 1 | class CreateAnswers < ActiveRecord::Migration 2 | def change 3 | create_table :answers do |t| 4 | t.string :body 5 | t.integer :score 6 | 7 | t.timestamps null: false 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20160424172323_add_question_to_answer.rb: -------------------------------------------------------------------------------- 1 | class AddQuestionToAnswer < ActiveRecord::Migration 2 | def change 3 | add_reference :answers, :question, index: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160424172807_add_user_to_answers.rb: -------------------------------------------------------------------------------- 1 | class AddUserToAnswers < ActiveRecord::Migration 2 | def change 3 | add_reference :answers, :user, index: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160424183802_create_votes.rb: -------------------------------------------------------------------------------- 1 | class CreateVotes < ActiveRecord::Migration 2 | def change 3 | create_table :votes do |t| 4 | t.integer :type 5 | 6 | t.timestamps null: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20160424183824_add_user_and_post_to_votes.rb: -------------------------------------------------------------------------------- 1 | class AddUserAndPostToVotes < ActiveRecord::Migration 2 | def change 3 | add_reference :votes, :user, index: true, foreign_key: true 4 | add_reference :votes, :post, index: true, foreign_key: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20160424191151_remove_post_from_votes.rb: -------------------------------------------------------------------------------- 1 | class RemovePostFromVotes < ActiveRecord::Migration 2 | def change 3 | remove_reference :votes, :post, index: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160424191405_add_polymorphic_post_to_votes.rb: -------------------------------------------------------------------------------- 1 | class AddPolymorphicPostToVotes < ActiveRecord::Migration 2 | def change 3 | add_reference :votes, :post, polymorphic: true, index: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160424193831_rename_votes_type_to_votes_vote_type.rb: -------------------------------------------------------------------------------- 1 | class RenameVotesTypeToVotesVoteType < ActiveRecord::Migration 2 | def change 3 | rename_column :votes, :type, :vote_type 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160428151443_add_user_to_privileges.rb: -------------------------------------------------------------------------------- 1 | class AddUserToPrivileges < ActiveRecord::Migration 2 | def change 3 | add_reference :privileges, :user, index: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160428151900_add_name_to_privileges.rb: -------------------------------------------------------------------------------- 1 | class AddNameToPrivileges < ActiveRecord::Migration 2 | def change 3 | add_column :privileges, :name, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160428152011_add_threshold_to_privileges.rb: -------------------------------------------------------------------------------- 1 | class AddThresholdToPrivileges < ActiveRecord::Migration 2 | def change 3 | add_column :privileges, :threshold, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160428202611_add_is_deleted_to_questions.rb: -------------------------------------------------------------------------------- 1 | class AddIsDeletedToQuestions < ActiveRecord::Migration 2 | def change 3 | add_column :questions, :is_deleted, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160429150239_add_is_deleted_to_answers.rb: -------------------------------------------------------------------------------- 1 | class AddIsDeletedToAnswers < ActiveRecord::Migration 2 | def change 3 | add_column :answers, :is_deleted, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160429160133_add_deleted_at_to_questions.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToQuestions < ActiveRecord::Migration 2 | def change 3 | add_column :questions, :deleted_at, :timestamp 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160429160144_add_deleted_at_to_answers.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToAnswers < ActiveRecord::Migration 2 | def change 3 | add_column :answers, :deleted_at, :timestamp 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160430085505_create_notifications.rb: -------------------------------------------------------------------------------- 1 | class CreateNotifications < ActiveRecord::Migration 2 | def change 3 | create_table :notifications do |t| 4 | t.string :content 5 | t.string :link 6 | t.boolean :is_read 7 | 8 | t.timestamps null: false 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20160430085520_add_user_to_notifications.rb: -------------------------------------------------------------------------------- 1 | class AddUserToNotifications < ActiveRecord::Migration 2 | def change 3 | add_reference :notifications, :user, index: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160430092324_add_default_false_value_to_notifications.rb: -------------------------------------------------------------------------------- 1 | class AddDefaultFalseValueToNotifications < ActiveRecord::Migration 2 | def change 3 | change_column :notifications, :is_read, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160501095155_create_comments.rb: -------------------------------------------------------------------------------- 1 | class CreateComments < ActiveRecord::Migration 2 | def change 3 | create_table :comments do |t| 4 | 5 | t.timestamps null: false 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20160501095354_add_post_to_comments.rb: -------------------------------------------------------------------------------- 1 | class AddPostToComments < ActiveRecord::Migration 2 | def change 3 | add_reference :comments, :post, polymorphic: true, index: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160501101156_add_content_to_comments.rb: -------------------------------------------------------------------------------- 1 | class AddContentToComments < ActiveRecord::Migration 2 | def change 3 | add_column :comments, :content, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160501103643_add_is_deleted_to_comments.rb: -------------------------------------------------------------------------------- 1 | class AddIsDeletedToComments < ActiveRecord::Migration 2 | def change 3 | add_column :comments, :is_deleted, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160501105740_add_user_to_comments.rb: -------------------------------------------------------------------------------- 1 | class AddUserToComments < ActiveRecord::Migration 2 | def change 3 | add_reference :comments, :user, index: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160501150244_create_flags.rb: -------------------------------------------------------------------------------- 1 | class CreateFlags < ActiveRecord::Migration 2 | def change 3 | create_table :flags do |t| 4 | t.string :reason 5 | 6 | t.timestamps null: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20160501150316_create_flag_statuses.rb: -------------------------------------------------------------------------------- 1 | class CreateFlagStatuses < ActiveRecord::Migration 2 | def change 3 | create_table :flag_statuses do |t| 4 | t.string :result 5 | t.string :message 6 | 7 | t.timestamps null: false 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20160501150344_add_user_to_flags.rb: -------------------------------------------------------------------------------- 1 | class AddUserToFlags < ActiveRecord::Migration 2 | def change 3 | add_reference :flags, :user, index: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160501150355_add_polymorphic_post_to_flags.rb: -------------------------------------------------------------------------------- 1 | class AddPolymorphicPostToFlags < ActiveRecord::Migration 2 | def change 3 | add_reference :flags, :post, polymorphic: true, index: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160501150425_add_flag_to_flag_statuses.rb: -------------------------------------------------------------------------------- 1 | class AddFlagToFlagStatuses < ActiveRecord::Migration 2 | def change 3 | add_reference :flag_statuses, :flag, index: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160501203952_add_default_to_is_deleted.rb: -------------------------------------------------------------------------------- 1 | class AddDefaultToIsDeleted < ActiveRecord::Migration 2 | def change 3 | change_column :answers, :is_deleted, :boolean, default: false 4 | change_column :comments, :is_deleted, :boolean, default: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20160507112321_create_post_history_types.rb: -------------------------------------------------------------------------------- 1 | class CreatePostHistoryTypes < ActiveRecord::Migration 2 | def change 3 | create_table :post_history_types do |t| 4 | t.string :name 5 | t.string :description 6 | t.string :action_name 7 | 8 | t.timestamps null: false 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20160507112635_create_post_histories.rb: -------------------------------------------------------------------------------- 1 | class CreatePostHistories < ActiveRecord::Migration 2 | def change 3 | create_table :post_histories do |t| 4 | t.references :post_history_type, index: true, foreign_key: true 5 | t.references :user, index: true, foreign_key: true 6 | t.string :title 7 | t.string :body 8 | t.string :tags 9 | 10 | t.timestamps null: false 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20160507112646_add_post_to_post_history.rb: -------------------------------------------------------------------------------- 1 | class AddPostToPostHistory < ActiveRecord::Migration 2 | def change 3 | add_reference :post_histories, :post, polymorphic: true, index: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160507135329_remove_post_fields_from_post_history.rb: -------------------------------------------------------------------------------- 1 | class RemovePostFieldsFromPostHistory < ActiveRecord::Migration 2 | def change 3 | remove_column :post_histories, :title, :string 4 | remove_column :post_histories, :body, :string 5 | remove_column :post_histories, :tags, :string 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20160615175537_add_defaults_to_deleted.rb: -------------------------------------------------------------------------------- 1 | class AddDefaultsToDeleted < ActiveRecord::Migration 2 | def change 3 | change_column :answers, :is_deleted, :boolean, default: false 4 | change_column :questions, :is_deleted, :boolean, default: false 5 | change_column :comments, :is_deleted, :boolean, default: false 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20160619161305_add_receiving_user_to_votes.rb: -------------------------------------------------------------------------------- 1 | class AddReceivingUserToVotes < ActiveRecord::Migration 2 | def change 3 | add_column :votes, :recv_user, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160619162714_create_suspicious_votes.rb: -------------------------------------------------------------------------------- 1 | class CreateSuspiciousVotes < ActiveRecord::Migration 2 | def change 3 | create_table :suspicious_votes do |t| 4 | t.integer :from_user 5 | t.integer :to_user 6 | t.boolean :was_investigated, default: false 7 | t.integer :investigated_by 8 | t.timestamp :investigated_at 9 | t.integer :suspicious_count 10 | t.integer :total_count 11 | 12 | t.timestamps null: false 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20160621093334_rename_user_attributes.rb: -------------------------------------------------------------------------------- 1 | class RenameUserAttributes < ActiveRecord::Migration 2 | def change 3 | rename_column :suspicious_votes, :from_user, :from_user_id 4 | rename_column :suspicious_votes, :to_user, :to_user_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20160621102440_create_join_table_privilege_user.rb: -------------------------------------------------------------------------------- 1 | class CreateJoinTablePrivilegeUser < ActiveRecord::Migration 2 | def change 3 | create_join_table :privileges, :users do |t| 4 | t.index [:privilege_id, :user_id] 5 | t.index [:user_id, :privilege_id] 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20160621145835_add_close_fields_to_questions.rb: -------------------------------------------------------------------------------- 1 | class AddCloseFieldsToQuestions < ActiveRecord::Migration 2 | def change 3 | add_column :questions, :is_closed, :boolean 4 | add_column :questions, :closed_by, :integer 5 | add_column :questions, :closed_at, :timestamp 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20160621174102_rename_closed_by_to_closed_by_id.rb: -------------------------------------------------------------------------------- 1 | class RenameClosedByToClosedById < ActiveRecord::Migration 2 | def change 3 | rename_column :questions, :closed_by, :closed_by_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191109211244_change_site_settings_value_type.rb: -------------------------------------------------------------------------------- 1 | class ChangeSiteSettingsValueType < ActiveRecord::Migration[5.0] 2 | def change 3 | change_column :site_settings, :value, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191110193734_remove_polymorphic_assoc_fields.rb: -------------------------------------------------------------------------------- 1 | class RemovePolymorphicAssocFields < ActiveRecord::Migration[5.0] 2 | def change 3 | drop_table :answers 4 | drop_table :questions 5 | remove_column :comments, :post_type 6 | remove_column :flags, :post_type 7 | remove_column :post_histories, :post_type 8 | remove_column :votes, :post_type 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20191110205100_rename_comments_is_deleted.rb: -------------------------------------------------------------------------------- 1 | class RenameCommentsIsDeleted < ActiveRecord::Migration[5.0] 2 | def change 3 | rename_column :comments, :is_deleted, :deleted 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191110212601_add_post_defaults.rb: -------------------------------------------------------------------------------- 1 | class AddPostDefaults < ActiveRecord::Migration[5.0] 2 | def change 3 | change_column :posts, :deleted, :boolean, null: false, default: false 4 | change_column :posts, :closed, :boolean, null: false, default: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20191120165535_remove_action_name_from_post_history_types.rb: -------------------------------------------------------------------------------- 1 | class RemoveActionNameFromPostHistoryTypes < ActiveRecord::Migration[5.0] 2 | def change 3 | remove_column :post_history_types, :action_name 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191120170439_remove_user_id_from_privileges.rb: -------------------------------------------------------------------------------- 1 | class RemoveUserIdFromPrivileges < ActiveRecord::Migration[5.0] 2 | def change 3 | remove_column :privileges, :user_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191122124913_change_recv_user_field_name_on_votes.rb: -------------------------------------------------------------------------------- 1 | class ChangeRecvUserFieldNameOnVotes < ActiveRecord::Migration[5.0] 2 | def change 3 | rename_column :votes, :recv_user, :recv_user_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191124214828_add_value_type_to_site_settings.rb: -------------------------------------------------------------------------------- 1 | class AddValueTypeToSiteSettings < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :site_settings, :value_type, :string, null: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191125135227_add_description_to_site_settings.rb: -------------------------------------------------------------------------------- 1 | class AddDescriptionToSiteSettings < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :site_settings, :description, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191125145708_add_name_indexes.rb: -------------------------------------------------------------------------------- 1 | class AddNameIndexes < ActiveRecord::Migration[5.2] 2 | def change 3 | add_index :site_settings, :name 4 | add_index :privileges, :name 5 | add_index :post_types, :name 6 | add_index :post_history_types, :name 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20191127121809_add_body_markdown_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddBodyMarkdownToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :posts, :body_markdown, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191202195956_add_profile_attributes_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddProfileAttributesToUser < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :users, :profile, :text 4 | add_column :users, :website, :text 5 | add_column :users, :twitter, :string 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20191202215751_add_profile_markdown_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddProfileMarkdownToUsers < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :users, :profile_markdown, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191204172132_create_tags.rb: -------------------------------------------------------------------------------- 1 | class CreateTags < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :tags do |t| 4 | t.string :name 5 | t.text :description 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20191204172148_create_post_tags_link_table.rb: -------------------------------------------------------------------------------- 1 | class CreatePostTagsLinkTable < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :posts_tags, id: false, primary_key: [:post_id, :tag_id] do |t| 4 | t.references :tag 5 | t.references :post 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20191204172543_rename_posts_tags.rb: -------------------------------------------------------------------------------- 1 | class RenamePostsTags < ActiveRecord::Migration[5.2] 2 | def change 3 | rename_column :posts, :tags, :tags_cache 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191205115827_add_answer_count_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddAnswerCountToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :posts, :answer_count, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191205122016_add_default_to_answer_count.rb: -------------------------------------------------------------------------------- 1 | class AddDefaultToAnswerCount < ActiveRecord::Migration[5.2] 2 | def change 3 | change_column :posts, :answer_count, :integer, default: 0, null: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191205122434_add_last_activity_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddLastActivityToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :posts, :last_activity, :datetime, default: -> { 'CURRENT_TIMESTAMP' }, null: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191205123038_rework_flag_system_tables.rb: -------------------------------------------------------------------------------- 1 | class ReworkFlagSystemTables < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :flags, :status, :string 4 | add_column :flags, :message, :text 5 | add_column :flags, :handled_by_id, :integer 6 | 7 | drop_table :flag_statuses 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20191205123408_add_handled_at_to_flags.rb: -------------------------------------------------------------------------------- 1 | class AddHandledAtToFlags < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :flags, :handled_at, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191205155835_add_state_fields_to_post_history.rb: -------------------------------------------------------------------------------- 1 | class AddStateFieldsToPostHistory < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :post_histories, :before_state, :text 4 | add_column :post_histories, :after_state, :text 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20191205212204_add_attribution_fields_to_post.rb: -------------------------------------------------------------------------------- 1 | class AddAttributionFieldsToPost < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :posts, :att_source, :text 4 | add_column :posts, :att_license_name, :string 5 | add_column :posts, :att_license_link, :string 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20191205225500_add_se_acct_id_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddSeAcctIdToUsers < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :users, :se_acct_id, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191206213515_add_transferred_content_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddTransferredContentToUsers < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :users, :transferred_content, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191207001359_add_search_fulltext_index_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddSearchFulltextIndexToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_index :posts, :body_markdown, type: :fulltext 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191207011614_add_is_meta_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddIsMetaToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :posts, :is_meta, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191208231830_add_doc_slug_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddDocSlugToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :posts, :doc_slug, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191215183139_add_last_activity_by_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddLastActivityByToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :posts, :last_activity_by, class_name: 'User' 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191215211744_change_comments_content_field_type.rb: -------------------------------------------------------------------------------- 1 | class ChangeCommentsContentFieldType < ActiveRecord::Migration[5.2] 2 | def change 3 | change_column :comments, :content, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191216161051_add_users_username_index.rb: -------------------------------------------------------------------------------- 1 | class AddUsersUsernameIndex < ActiveRecord::Migration[5.2] 2 | def change 3 | add_index :users, :username 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191217000359_add_comment_to_post_history.rb: -------------------------------------------------------------------------------- 1 | class AddCommentToPostHistory < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :post_histories, :comment, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191225135200_add_category_to_site_settings.rb: -------------------------------------------------------------------------------- 1 | class AddCategoryToSiteSettings < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :site_settings, :category, :string 4 | add_index :site_settings, :category 5 | end 6 | end -------------------------------------------------------------------------------- /db/migrate/20200109205444_change_settings_to_text_type.rb: -------------------------------------------------------------------------------- 1 | class ChangeSettingsToTextType < ActiveRecord::Migration[5.2] 2 | def change 3 | SiteSetting.find_by(name: 'AskingGuidance').update(value_type: 'text') 4 | SiteSetting.find_by(name: 'AnsweringGuidance').update(value_type: 'text') 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200115221655_create_subscriptions.rb: -------------------------------------------------------------------------------- 1 | class CreateSubscriptions < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :subscriptions do |t| 4 | t.string :type, null: false 5 | t.string :qualifier 6 | t.references :user, foreign_key: true 7 | t.boolean :enabled, null: false 8 | t.integer :frequency, null: false 9 | t.datetime :last_sent_at, null: false 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20200116005738_add_name_to_subscriptions.rb: -------------------------------------------------------------------------------- 1 | class AddNameToSubscriptions < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :subscriptions, :name, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200116132702_add_default_to_subscriptions_enabled.rb: -------------------------------------------------------------------------------- 1 | class AddDefaultToSubscriptionsEnabled < ActiveRecord::Migration[5.2] 2 | def change 3 | change_column :subscriptions, :enabled, :boolean, default: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200116132808_allow_null_subscriptions_last_sent.rb: -------------------------------------------------------------------------------- 1 | class AllowNullSubscriptionsLastSent < ActiveRecord::Migration[5.2] 2 | def change 3 | change_column :subscriptions, :last_sent_at, :datetime, null: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200122151548_add_category_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddCategoryToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :posts, :category, :string 4 | add_index :posts, :category 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200128123353_move_is_meta_to_category.rb: -------------------------------------------------------------------------------- 1 | class MoveIsMetaToCategory < ActiveRecord::Migration[5.2] 2 | def change 3 | change_column :posts, :category, :string, default: 'Main' 4 | Post.where(is_meta: true).update_all(category: 'Meta') 5 | Post.where(is_meta: [false, nil]).update_all(category: 'Main') 6 | remove_column :posts, :is_meta 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20200317173232_close_reasons.rb: -------------------------------------------------------------------------------- 1 | class CloseReasons < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :close_reasons do |t| 4 | t.string :name 5 | t.text :description 6 | t.boolean :active 7 | t.boolean :requires_other_post 8 | end 9 | add_reference :posts, :close_reasons, foreign_key: true, null: true 10 | add_reference :posts, :duplicate_post, foreign_key: {to_table: :posts}, null: true 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20200318161617_add_comunity_scope_to_close_reasons.rb: -------------------------------------------------------------------------------- 1 | class AddComunityScopeToCloseReasons < ActiveRecord::Migration[5.2] 2 | def change 3 | change_table :close_reasons do |t| 4 | t.references :community 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20200318164203_add_index_to_flags_status.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToFlagsStatus < ActiveRecord::Migration[5.2] 2 | def change 3 | add_index :flags, :status 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200321135935_create_tag_sets.rb: -------------------------------------------------------------------------------- 1 | class CreateTagSets < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :tag_sets do |t| 4 | t.string :name 5 | t.references :community, index: true, null: false 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20200323131708_add_indexes_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddIndexesToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_index :posts, :deleted 4 | add_index :posts, :parent_id 5 | add_index :posts, :user_id 6 | add_index :posts, :post_type_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20200411195247_create_categories.rb: -------------------------------------------------------------------------------- 1 | class CreateCategories < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :categories do |t| 4 | t.string :name 5 | t.text :short_wiki 6 | t.references :community 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200411210022_create_categories_post_types.rb: -------------------------------------------------------------------------------- 1 | class CreateCategoriesPostTypes < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :categories_post_types, id: false, primary_key: [:category_id, :post_type_id] do |t| 4 | t.bigint :category_id, null: false 5 | t.bigint :post_type_id, null: false 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20200412121936_correct_close_reasons_reference_attribute_name.rb: -------------------------------------------------------------------------------- 1 | class CorrectCloseReasonsReferenceAttributeName < ActiveRecord::Migration[5.2] 2 | def change 3 | rename_column :posts, :close_reasons_id, :close_reason_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200412122236_add_display_post_types_to_categories.rb: -------------------------------------------------------------------------------- 1 | class AddDisplayPostTypesToCategories < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :categories, :display_post_types, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200413144332_add_is_homepage_to_categories.rb: -------------------------------------------------------------------------------- 1 | class AddIsHomepageToCategories < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :categories, :is_homepage, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200413174714_add_tag_set_reference_to_categories.rb: -------------------------------------------------------------------------------- 1 | class AddTagSetReferenceToCategories < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :categories, :tag_set, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200420151217_add_trust_level_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddTrustLevelToUsers < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :users, :trust_level, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200420151720_add_min_trust_level_to_categories.rb: -------------------------------------------------------------------------------- 1 | class AddMinTrustLevelToCategories < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :categories, :min_trust_level, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200422152359_add_button_text_to_categories.rb: -------------------------------------------------------------------------------- 1 | class AddButtonTextToCategories < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :categories, :button_text, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200428172814_create_licenses.rb: -------------------------------------------------------------------------------- 1 | class CreateLicenses < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :licenses do |t| 4 | t.string :name 5 | t.string :url 6 | t.boolean :default 7 | t.bigint :community_id, null: false 8 | 9 | t.timestamps 10 | end 11 | 12 | add_index :licenses, :community_id 13 | add_index :licenses, :name 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20200428173033_add_license_reference_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddLicenseReferenceToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :posts, :license, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200428181938_add_customization_fields_to_category.rb: -------------------------------------------------------------------------------- 1 | class AddCustomizationFieldsToCategory < ActiveRecord::Migration[5.2] 2 | def change 3 | change_table :categories do |t| 4 | t.string :color_code 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20200430123008_add_posting_tips_overrides_to_category.rb: -------------------------------------------------------------------------------- 1 | class AddPostingTipsOverridesToCategory < ActiveRecord::Migration[5.2] 2 | def change 3 | change_table :categories do |t| 4 | t.text :asking_guidance_override 5 | t.text :answering_guidance_override 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20200430220415_create_error_logs.rb: -------------------------------------------------------------------------------- 1 | class CreateErrorLogs < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :error_logs do |t| 4 | t.references :community, foreign_key: true 5 | t.references :user, foreign_key: true 6 | t.string :klass 7 | t.text :message 8 | t.text :backtrace 9 | t.text :request_uri, null: false 10 | t.string :host, null: false 11 | 12 | t.timestamps 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20200430220944_add_uuid_to_error_logs.rb: -------------------------------------------------------------------------------- 1 | class AddUuidToErrorLogs < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :error_logs, :uuid, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200501215447_add_min_view_trust_level_to_categories.rb: -------------------------------------------------------------------------------- 1 | class AddMinViewTrustLevelToCategories < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :categories, :min_view_trust_level, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200502001225_add_license_reference_to_categories.rb: -------------------------------------------------------------------------------- 1 | class AddLicenseReferenceToCategories < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :categories, :license, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200502152723_add_enabled_to_licenses.rb: -------------------------------------------------------------------------------- 1 | class AddEnabledToLicenses < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :licenses, :enabled, :boolean, default: 1 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200503110754_add_qr_login_attributes_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddQrLoginAttributesToUser < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :users, :login_token, :string, unique: true 4 | add_column :users, :login_token_expires_at, :datetime 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200504213143_add_two_factor_token_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddTwoFactorTokenToUsers < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :users, :two_factor_token, :string 4 | add_column :users, :enabled_2fa, :boolean, default: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200507235849_add_user_agent_to_error_logs.rb: -------------------------------------------------------------------------------- 1 | class AddUserAgentToErrorLogs < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :error_logs, :user_agent, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200508112958_add_sequence_to_categories.rb: -------------------------------------------------------------------------------- 1 | class AddSequenceToCategories < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :categories, :sequence, :integer 4 | add_index :categories, :sequence 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200508115752_add_category_tag_join_tables.rb: -------------------------------------------------------------------------------- 1 | class AddCategoryTagJoinTables < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :categories_required_tags, id: false, primary_key: [:category_id, :tag_id] do |t| 4 | t.bigint :category_id 5 | t.bigint :tag_id 6 | end 7 | 8 | create_table :categories_topic_tags, id: false, primary_key: [:category_id, :tag_id] do |t| 9 | t.bigint :category_id 10 | t.bigint :tag_id 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20200515212247_add_post_indexes.rb: -------------------------------------------------------------------------------- 1 | class AddPostIndexes < ActiveRecord::Migration[5.2] 2 | def change 3 | change_column :posts, :att_source, :string 4 | add_index :posts, :att_source 5 | add_index :posts, :tags_cache 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20200516162625_update_answer_count_column.rb: -------------------------------------------------------------------------------- 1 | class UpdateAnswerCountColumn < ActiveRecord::Migration[5.2] 2 | def change 3 | change_column :posts, :answer_count, :integer, null: false, default: 0 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200528145307_add_two_factor_method_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddTwoFactorMethodToUsers < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :users, :two_factor_method, :string 4 | User.where(enabled_2fa: true).update_all(two_factor_method: 'app') 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200601113238_add_index_to_last_activity.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToLastActivity < ActiveRecord::Migration[5.2] 2 | def change 3 | add_index :posts, :last_activity 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200610150214_add_help_attributes_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddHelpAttributesToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :posts, :help_category, :string 4 | add_column :posts, :help_ordering, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200610152505_allow_post_community_id_null.rb: -------------------------------------------------------------------------------- 1 | class AllowPostCommunityIdNull < ActiveRecord::Migration[5.2] 2 | def change 3 | change_column_null :posts, :community_id, true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200610152647_allow_post_history_community_id_null.rb: -------------------------------------------------------------------------------- 1 | class AllowPostHistoryCommunityIdNull < ActiveRecord::Migration[5.2] 2 | def change 3 | change_column_null :post_histories, :community_id, true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200612154828_add_unique_index_to_posts_tags.rb: -------------------------------------------------------------------------------- 1 | class AddUniqueIndexToPostsTags < ActiveRecord::Migration[5.2] 2 | def change 3 | add_index :posts_tags, [:post_id, :tag_id], unique: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200616224440_change_to_wilson_scores.rb: -------------------------------------------------------------------------------- 1 | class ChangeToWilsonScores < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :posts, :upvote_count, :integer, null: false, default: 0 4 | add_column :posts, :downvote_count, :integer, null: false, default: 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200617140007_change_post_score_column_type.rb: -------------------------------------------------------------------------------- 1 | class ChangePostScoreColumnType < ActiveRecord::Migration[5.2] 2 | def change 3 | change_column :posts, :score, :decimal, precision: 10, scale: 8 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200618124645_add_warning_templates.rb: -------------------------------------------------------------------------------- 1 | class AddWarningTemplates < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :warning_templates do |t| 4 | t.references :community, foreign_key: true 5 | 6 | t.string :name 7 | t.text :body 8 | t.boolean :active 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20200625115618_add_mod_tags_join_table.rb: -------------------------------------------------------------------------------- 1 | class AddModTagsJoinTable < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :categories_moderator_tags, id: false, primary_key: [:category_id, :tag_id] do |t| 4 | t.bigint :category_id 5 | t.bigint :tag_id 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20200629131408_update_tag_model.rb: -------------------------------------------------------------------------------- 1 | class UpdateTagModel < ActiveRecord::Migration[5.2] 2 | def change 3 | remove_column :tags, :description 4 | add_column :tags, :wiki_markdown, :text 5 | add_column :tags, :excerpt_markdown, :text 6 | add_column :tags, :wiki, :text 7 | add_column :tags, :excerpt, :text 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20200630001048_remove_excerpt_markdown.rb: -------------------------------------------------------------------------------- 1 | class RemoveExcerptMarkdown < ActiveRecord::Migration[5.2] 2 | def change 3 | remove_column :tags, :excerpt_markdown 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200630105117_allow_tag_parents.rb: -------------------------------------------------------------------------------- 1 | class AllowTagParents < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :tags, :parent, foreign_key: { to_table: :tags } 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200701132522_add_index_to_post_score.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToPostScore < ActiveRecord::Migration[5.2] 2 | def change 3 | add_index :posts, :score 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200701132654_add_indexes_to_vote_counts.rb: -------------------------------------------------------------------------------- 1 | class AddIndexesToVoteCounts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_index :posts, :upvote_count 4 | add_index :posts, :downvote_count 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200709204628_create_audit_logs.rb: -------------------------------------------------------------------------------- 1 | class CreateAuditLogs < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :audit_logs do |t| 4 | t.string :log_type 5 | t.string :event_type 6 | t.references :related, polymorphic: true 7 | t.references :user, foreign_key: true 8 | t.text :comment 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20200709204728_add_audit_indexes.rb: -------------------------------------------------------------------------------- 1 | class AddAuditIndexes < ActiveRecord::Migration[5.2] 2 | def change 3 | add_index :audit_logs, :log_type 4 | add_index :audit_logs, :event_type 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200711121645_add_community_to_audit_logs.rb: -------------------------------------------------------------------------------- 1 | class AddCommunityToAuditLogs < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :audit_logs, :community, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200716081538_create_blocked_items.rb: -------------------------------------------------------------------------------- 1 | class CreateBlockedItems < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :blocked_items do |t| 4 | t.string :type 5 | t.text :value 6 | t.datetime :expires 7 | t.boolean :automatic 8 | t.string :reason, null: true 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20200716191141_add_comments_disabled_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddCommentsDisabledToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :posts, :comments_disabled, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200718163608_rename_type_column_of_blocked_items.rb: -------------------------------------------------------------------------------- 1 | class RenameTypeColumnOfBlockedItems < ActiveRecord::Migration[5.2] 2 | def change 3 | rename_column :blocked_items, :type, :item_type 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200721185048_add_title_and_tags_to_post_history.rb: -------------------------------------------------------------------------------- 1 | class AddTitleAndTagsToPostHistory < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :post_histories, :before_title, :string 4 | add_column :post_histories, :after_title, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200721185230_create_post_history_tags.rb: -------------------------------------------------------------------------------- 1 | class CreatePostHistoryTags < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :post_history_tags do |t| 4 | t.references :post_history, foreign_key: true 5 | t.references :tag, foreign_key: true 6 | t.string :relationship 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200727183756_create_pinned_links.rb: -------------------------------------------------------------------------------- 1 | class CreatePinnedLinks < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :pinned_links do |t| 4 | t.references :community, null: true, foreign_key: true 5 | t.string :label, null: true 6 | t.string :link, null: true 7 | t.references :post, null: true, foreign_key: true 8 | t.boolean :active 9 | t.datetime :shown_after, null: true 10 | t.datetime :shown_before, null: true 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20200728093322_add_eligible_for_hot_post_to_category.rb: -------------------------------------------------------------------------------- 1 | class AddEligibleForHotPostToCategory < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :categories, :use_for_hot_posts, :boolean, default: true 4 | add_column :categories, :use_for_advertisement, :boolean, default: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200806103121_add_staff_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddStaffToUsers < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :users, :staff, :boolean, null: false, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200810153831_create_user_privileges.rb: -------------------------------------------------------------------------------- 1 | class CreateUserPrivileges < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :user_privileges do |t| 4 | t.references :community_user, foreign_key: true 5 | t.references :trust_level, foreign_key: true 6 | t.boolean :is_suspended, default: false 7 | t.datetime :suspension_end, null: true 8 | t.text :suspension_message, null: true 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20200813125349_rename_ability_tables.rb: -------------------------------------------------------------------------------- 1 | class RenameAbilityTables < ActiveRecord::Migration[5.2] 2 | def change 3 | rename_table :trust_levels, :abilities 4 | rename_table :user_privileges, :user_abilities 5 | rename_column :user_abilities, :trust_level_id, :ability_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20200813141412_have_two_descriptions_on_abilities.rb: -------------------------------------------------------------------------------- 1 | class HaveTwoDescriptionsOnAbilities < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :abilities, :summary, :text 4 | 5 | Ability.unscoped.all.each do |a| 6 | a.update summary: a.description 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20200814203051_create_post_flag_types.rb: -------------------------------------------------------------------------------- 1 | class CreatePostFlagTypes < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :post_flag_types do |t| 4 | t.references :community 5 | t.string :name 6 | t.text :description 7 | t.boolean :confidential 8 | t.boolean :active 9 | t.references :post_type, null: true 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20200815103111_add_post_flag_type_id_to_flags.rb: -------------------------------------------------------------------------------- 1 | class AddPostFlagTypeIdToFlags < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :flags, :post_flag_type, null: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200815191909_add_locked_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddLockedToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :posts, :locked, :boolean, null: false, default: false 4 | add_reference :posts, :locked_by, foreign_key: { to_table: :users }, null: true 5 | add_column :posts, :locked_at, :datetime, null: true 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20200815193704_add_locked_until_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddLockedUntilToPosts < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :posts, :locked_until, :datetime, null: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200829235149_add_edit_fields_to_post.rb: -------------------------------------------------------------------------------- 1 | class AddEditFieldsToPost < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :posts, :last_edited_at, :datetime 4 | add_column :posts, :last_edited_by_id, :bigint 5 | add_index :posts, :last_edited_by_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20201001085031_add_read_to_mod_warning.rb: -------------------------------------------------------------------------------- 1 | class AddReadToModWarning < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :warnings, :read, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201112021641_add_cid_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddCidToUsers < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :users, :cid, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201118222120_create_ability_queues.rb: -------------------------------------------------------------------------------- 1 | class CreateAbilityQueues < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :ability_queues do |t| 4 | t.references :community_user 5 | t.text :comment, null: true 6 | t.boolean :completed 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20201123132854_add_lockable_omniauthable.rb: -------------------------------------------------------------------------------- 1 | class AddLockableOmniauthable < ActiveRecord::Migration[5.2] 2 | def change 3 | change_table :users do |t| 4 | t.integer :failed_attempts, default: 0, null: false 5 | t.string :unlock_token 6 | t.datetime :locked_at 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20201212235514_move_trust_level_to_community_user.rb: -------------------------------------------------------------------------------- 1 | class MoveTrustLevelToCommunityUser < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :community_users, :trust_level, :integer 4 | remove_column :users, :trust_level 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20201216202459_add_fake_community_option.rb: -------------------------------------------------------------------------------- 1 | class AddFakeCommunityOption < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :communities, :is_fake, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201216225353_add_is_freely_editable_to_post_types.rb: -------------------------------------------------------------------------------- 1 | class AddIsFreelyEditableToPostTypes < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :post_types, :is_freely_editable, :boolean, null: false, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201217025220_add_icon_name_to_post_types.rb: -------------------------------------------------------------------------------- 1 | class AddIconNameToPostTypes < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :post_types, :icon_name, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201231130344_add_community_id_to_comment_threads.rb: -------------------------------------------------------------------------------- 1 | class AddCommunityIdToCommentThreads < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :comment_threads, :community, null: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201231192529_remove_archived_until.rb: -------------------------------------------------------------------------------- 1 | class RemoveArchivedUntil < ActiveRecord::Migration[5.2] 2 | def change 3 | remove_column :comment_threads, :archived_until 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210102143426_add_description_to_licenses.rb: -------------------------------------------------------------------------------- 1 | class AddDescriptionToLicenses < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :licenses, :description, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210102162706_create_thread_followers.rb: -------------------------------------------------------------------------------- 1 | class CreateThreadFollowers < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :thread_followers do |t| 4 | t.references :comment_thread 5 | t.references :user 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20210107163304_add_developer_flag_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddDeveloperFlagToUsers < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :users, :developer, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210112225651_add_hidden_flag_to_communities.rb: -------------------------------------------------------------------------------- 1 | class AddHiddenFlagToCommunities < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :communities, :hidden, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210422090732_change_flags_reason_field_type.rb: -------------------------------------------------------------------------------- 1 | class ChangeFlagsReasonFieldType < ActiveRecord::Migration[5.2] 2 | def change 3 | change_column :flags, :reason, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210609235441_add_requires_details_to_post_flag_types.rb: -------------------------------------------------------------------------------- 1 | class AddRequiresDetailsToPostFlagTypes < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :post_flag_types, :requires_details, :boolean, null: false, default: false 4 | PostFlagType.unscoped.where(name: ["needs author's attention", 'is a duplicate']).update_all(requires_details: true) 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20210627152246_make_flags_polymorphic.rb: -------------------------------------------------------------------------------- 1 | class MakeFlagsPolymorphic < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :flags, :post_type, :string 4 | Flag.all.update_all(post_type: 'Post') 5 | remove_index :flags, name: :index_flags_on_post_type_and_post_id 6 | add_index :flags, [:post_type, :post_id] 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210710203352_create_reaction_types.rb: -------------------------------------------------------------------------------- 1 | class CreateReactionTypes < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :reaction_types do |t| 4 | t.string :name 5 | t.text :description 6 | t.string :on_post_label 7 | 8 | t.string :icon 9 | t.string :color 10 | 11 | t.boolean :requires_comment 12 | 13 | t.references :community 14 | t.integer :position 15 | 16 | t.timestamps 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /db/migrate/20210710203801_create_reactions.rb: -------------------------------------------------------------------------------- 1 | class CreateReactions < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :reactions do |t| 4 | t.references :users 5 | t.references :reaction_types 6 | t.references :posts 7 | t.references :comments 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20210710204812_add_has_reactions_to_post_types.rb: -------------------------------------------------------------------------------- 1 | class AddHasReactionsToPostTypes < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :post_types, :has_reactions, :boolean 4 | PostType.update_all(has_reactions: false) 5 | PostType.where(name: ['Answer', 'Article']).update_all(has_reactions: true) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20210711210342_add_is_active_to_reaction_types.rb: -------------------------------------------------------------------------------- 1 | class AddIsActiveToReactionTypes < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :reaction_types, :active, :boolean 4 | ReactionType.unscoped.all.update_all(active: true) 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20210711230618_move_reputation_to_category_post_type.rb: -------------------------------------------------------------------------------- 1 | class MoveReputationToCategoryPostType < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :categories_post_types, :upvote_rep, :integer, null: false, default: 0 4 | add_column :categories_post_types, :downvote_rep, :integer, null: false, default: 0 5 | remove_column :post_types, :upvote_rep 6 | remove_column :post_types, :downvote_rep 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210712144301_move_category_post_types_to_id_primary_key.rb: -------------------------------------------------------------------------------- 1 | class MoveCategoryPostTypesToIdPrimaryKey < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :categories_post_types, :id, :primary_key 4 | add_index :categories_post_types, [:category_id, :post_type_id], unique: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20210723221136_add_answer_type_to_post_types.rb: -------------------------------------------------------------------------------- 1 | class AddAnswerTypeToPostTypes < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :post_types, :answer_type, index: true, foreign_key: { to_table: :post_types } 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210724224957_add_discord_link_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddDiscordLinkToUsers < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :users, :discord, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210729174224_remove_suspicious_votes.rb: -------------------------------------------------------------------------------- 1 | class RemoveSuspiciousVotes < ActiveRecord::Migration[5.2] 2 | def change 3 | drop_table :suspicious_votes 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210821080736_change_notifications_content_field_type.rb: -------------------------------------------------------------------------------- 1 | class ChangeNotificationsContentFieldType < ActiveRecord::Migration[5.2] 2 | def change 3 | change_column :notifications, :content, :text 4 | end 5 | end -------------------------------------------------------------------------------- /db/migrate/20210827143124_post_type_specific_reactions.rb: -------------------------------------------------------------------------------- 1 | class PostTypeSpecificReactions < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :reaction_types, :post_type, null: true 4 | add_column :post_types, :has_only_specific_reactions, :boolean 5 | 6 | PostType.update_all(has_only_specific_reactions: false) 7 | PostType.where(name: ['Question']).update_all(has_only_specific_reactions: true) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20210827203013_normalize_keys_in_reactions.rb: -------------------------------------------------------------------------------- 1 | class NormalizeKeysInReactions < ActiveRecord::Migration[5.2] 2 | def change 3 | rename_column :reactions, :posts_id, :post_id 4 | rename_column :reactions, :reaction_types_id, :reaction_type_id 5 | rename_column :reactions, :users_id, :user_id 6 | rename_column :reactions, :comments_id, :comment_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20211113223347_add_escalated_to_flags.rb: -------------------------------------------------------------------------------- 1 | class AddEscalatedToFlags < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :flags, :escalated, :boolean, null: false, default: false 4 | add_column :flags, :escalated_at, :datetime 5 | add_column :flags, :escalation_comment, :text 6 | add_reference :flags, :escalated_by, foreign_key: { to_table: :users } 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20211121195100_create_micro_auth_tokens.rb: -------------------------------------------------------------------------------- 1 | class CreateMicroAuthTokens < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :micro_auth_tokens do |t| 4 | t.references :app, foreign_key: { to_table: :micro_auth_apps } 5 | t.references :user, foreign_key: true 6 | t.string :token 7 | t.datetime :expires_at 8 | t.text :scope 9 | t.string :code 10 | t.datetime :code_expires_at 11 | t.text :redirect_uri 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20220811131155_create_sso_profile.rb: -------------------------------------------------------------------------------- 1 | class CreateSsoProfile < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :sso_profiles do |t| 4 | t.string :saml_identifier, null: false 5 | t.references :user, null: false, foreign_key: true 6 | end 7 | end 8 | end -------------------------------------------------------------------------------- /db/migrate/20220815130313_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from active_storage (originally 20180723000244) 2 | class AddForeignKeyConstraintToActiveStorageAttachmentsForBlobId < ActiveRecord::Migration[6.0] 3 | def up 4 | return if foreign_key_exists?(:active_storage_attachments, column: :blob_id) 5 | 6 | if table_exists?(:active_storage_blobs) 7 | add_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20220903174045_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from active_storage (originally 20211119233751) 2 | class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0] 3 | def change 4 | return unless table_exists?(:active_storage_blobs) 5 | 6 | change_column_null(:active_storage_blobs, :checksum, true) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20220913183826_add_post_to_thread_followers.rb: -------------------------------------------------------------------------------- 1 | class AddPostToThreadFollowers < ActiveRecord::Migration[7.0] 2 | def change 3 | add_reference :thread_followers, :post, null: true, foreign_key: true 4 | change_column_null :thread_followers, :comment_thread_id, true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20220915181608_create_tag_synonyms.rb: -------------------------------------------------------------------------------- 1 | class CreateTagSynonyms < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :tag_synonyms do |t| 4 | t.belongs_to :tag, foreign_key: true 5 | t.string :name, null: false 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20220916075849_create_filters.rb: -------------------------------------------------------------------------------- 1 | class CreateFilters < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :filters do |t| 4 | t.references :user, null: false, foreign_key: true 5 | t.string :name, null: false 6 | t.float :min_score 7 | t.float :max_score 8 | t.integer :min_answers 9 | t.integer :max_answers 10 | t.string :status 11 | t.string :include_tags 12 | t.string :exclude_tags 13 | 14 | t.timestamps 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20221002043021_create_category_filter_defaults.rb: -------------------------------------------------------------------------------- 1 | class CreateCategoryFilterDefaults < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :category_filter_defaults do |t| 4 | t.references :user, null: false, foreign_key: true 5 | t.references :filter, null: false, foreign_key: true 6 | t.references :category, null: false, foreign_key: true 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20230613205236_add_min_title_length_to_categories.rb: -------------------------------------------------------------------------------- 1 | class AddMinTitleLengthToCategories < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :categories, :min_title_length, :integer, null: false, default: 15 4 | add_column :categories, :min_body_length, :integer, null: false, default: 30 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20230627035349_add_default_filter_to_category.rb: -------------------------------------------------------------------------------- 1 | class AddDefaultFilterToCategory < ActiveRecord::Migration[7.0] 2 | def change 3 | add_reference :categories, :default_filter, foreign_key: { to_table: :filters }, null: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20230726143348_add_hidden_to_post_history.rb: -------------------------------------------------------------------------------- 1 | class AddHiddenToPostHistory < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :post_histories, :hidden, :boolean, null: false, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20230803191600_add_backup_2fa_code_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddBackup2faCodeToUsers < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :users, :backup_2fa_code, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20230817213150_rename_site_setting_category_email_subscriptions.rb: -------------------------------------------------------------------------------- 1 | class RenameSiteSettingCategoryEmailSubscriptions < ActiveRecord::Migration[7.0] 2 | def change 3 | SiteSetting.where(category: 'EmailSubscriptions').update_all(category: 'Email') 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/202309141441_disable_needs_author_attention_flag.rb: -------------------------------------------------------------------------------- 1 | class DisableNeedsAuthorAttentionFlag < ActiveRecord::Migration[7.0] 2 | def up 3 | PostFlagType.unscoped.where(name: "needs author's attention").update_all(active: false) 4 | end 5 | 6 | def down 7 | PostFlagType.unscoped.where(name: "needs author's attention").update_all(active: true) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20240405113618_create_email_logs.rb: -------------------------------------------------------------------------------- 1 | class CreateEmailLogs < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :email_logs do |t| 4 | t.string :log_type 5 | t.string :destination 6 | t.text :data 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20241020193053_add_post_count_to_community_users.rb: -------------------------------------------------------------------------------- 1 | class AddPostCountToCommunityUsers < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :community_users, :post_count, :integer, default: 0, null: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20250123141400_create_user_websites.rb: -------------------------------------------------------------------------------- 1 | class CreateUserWebsites < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :user_websites do |t| 4 | t.column :label, :string, limit:80 5 | t.string :url 6 | t.integer :position 7 | end 8 | add_reference :user_websites, :user, null: false, foreign_key: true 9 | add_index(:user_websites, [:user_id, :url], unique: true) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20250128030356_remove_index_on_task_name.maintenance_tasks.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # This migration comes from maintenance_tasks (originally 20210225152418) 4 | class RemoveIndexOnTaskName < ActiveRecord::Migration[6.0] 5 | def up 6 | change_table(:maintenance_tasks_runs) do |t| 7 | t.remove_index(:task_name) 8 | end 9 | end 10 | 11 | def down 12 | change_table(:maintenance_tasks_runs) do |t| 13 | t.index(:task_name) 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20250128030357_add_arguments_to_maintenance_tasks_runs.maintenance_tasks.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # This migration comes from maintenance_tasks (originally 20210517131953) 4 | class AddArgumentsToMaintenanceTasksRuns < ActiveRecord::Migration[6.0] 5 | def change 6 | add_column(:maintenance_tasks_runs, :arguments, :text) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20250128030358_add_lock_version_to_maintenance_tasks_runs.maintenance_tasks.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # This migration comes from maintenance_tasks (originally 20211210152329) 4 | class AddLockVersionToMaintenanceTasksRuns < ActiveRecord::Migration[6.0] 5 | def change 6 | add_column( 7 | :maintenance_tasks_runs, 8 | :lock_version, 9 | :integer, 10 | default: 0, 11 | null: false, 12 | ) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20250128030361_add_metadata_to_runs.maintenance_tasks.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # This migration comes from maintenance_tasks (originally 20230622035229) 4 | class AddMetadataToRuns < ActiveRecord::Migration[6.0] 5 | def change 6 | add_column(:maintenance_tasks_runs, :metadata, :text) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/scripts/create_tags_path_view.rb: -------------------------------------------------------------------------------- 1 | ActiveRecord::Base.connection.execute File.read(Rails.root.join('db/scripts/create_tags_path_view.sql')) -------------------------------------------------------------------------------- /db/scripts/recalc_post_scores.sql: -------------------------------------------------------------------------------- 1 | update posts pu 2 | inner join ( 3 | select pq.id, 4 | count(distinct if(v.vote_type = 1, v.id, null)) as uvc, 5 | count(distinct if(v.vote_type = -1, v.id, null)) as dvc 6 | from posts pq 7 | left join votes v on pq.id = v.post_id 8 | group by pq.id 9 | ) ps on pu.id = ps.id 10 | set pu.upvote_count = ps.uvc, 11 | pu.downvote_count = ps.dvc, 12 | pu.score = (ps.uvc + 2) / (ps.uvc + ps.dvc + 4); -------------------------------------------------------------------------------- /db/scripts/reset_answer_counts.sql: -------------------------------------------------------------------------------- 1 | update posts tl 2 | inner join ( 3 | select px.id, count(pr.id) as answer_count 4 | from posts px 5 | left join posts pr on px.id = pr.parent_id and pr.deleted = false 6 | where px.post_type_id = 1 7 | group by px.id 8 | ) q on q.id = tl.id 9 | set tl.answer_count = q.answer_count; -------------------------------------------------------------------------------- /db/scripts/reset_thread_reply_counts.sql: -------------------------------------------------------------------------------- 1 | update comment_threads ct 2 | inner join ( 3 | select ctq.id, 4 | count(cq.id) as cc 5 | from comment_threads ctq 6 | inner join comments cq on ctq.id = cq.comment_thread_id 7 | where cq.deleted = false 8 | group by ctq.id 9 | ) x on ct.id = x.id 10 | set ct.reply_count = x.cc; -------------------------------------------------------------------------------- /db/scripts/tag_children.sql: -------------------------------------------------------------------------------- 1 | WITH RECURSIVE CTE (id, group_id) AS ( 2 | SELECT id, parent_id 3 | FROM tags 4 | WHERE parent_id = $ParentId 5 | UNION ALL 6 | SELECT t.id, t.parent_id 7 | FROM tags t 8 | INNER JOIN CTE ON t.parent_id = CTE.id 9 | ) 10 | SELECT * FROM CTE; -------------------------------------------------------------------------------- /db/seeds/abilities/everyone.html: -------------------------------------------------------------------------------- 1 |

What does this ability allow me to do?

2 | 3 |

This ability allows you to post 3 top-level posts (questions and articles) per day, and to post 20 answers per day.

4 | 5 |

This ability also allows you to raise 15 flags on posts per day.

6 | 7 |

How do I earn this ability?

8 | 9 |

This ability is automatically granted to you when you create an account.

10 | -------------------------------------------------------------------------------- /db/seeds/community_users.yml: -------------------------------------------------------------------------------- 1 | - deleted: false 2 | is_admin: true 3 | is_moderator: true 4 | is_suspended: false 5 | post_count: 0 6 | reputation: 1 7 | user_id: -1 -------------------------------------------------------------------------------- /db/seeds/filters.yml: -------------------------------------------------------------------------------- 1 | - name: None 2 | user_id: -1 3 | 4 | - name: Positive 5 | user_id: -1 6 | min_score: 0.5 7 | max_score: 1 8 | status: 'open' 9 | 10 | - name: Unanswered 11 | user_id: -1 12 | min_answers: 0 13 | max_answers: 0 14 | status: 'open' -------------------------------------------------------------------------------- /db/seeds/post_history_types.yml: -------------------------------------------------------------------------------- 1 | - name: post_edited 2 | - name: post_deleted 3 | - name: post_undeleted 4 | - name: question_closed 5 | - name: question_reopened 6 | - name: initial_revision 7 | - name: attribution_notice_added 8 | - name: attribution_notice_removed 9 | - name: attribution_notice_changed 10 | - name: imported_from_external_source 11 | - name: nominated_for_promotion 12 | - name: promotion_removed 13 | - name: history_hidden 14 | - name: category_changed 15 | - name: post_locked 16 | - name: post_unlocked -------------------------------------------------------------------------------- /db/seeds/site_settings/widgets_network_pitch.html: -------------------------------------------------------------------------------- 1 |

This community is part of a network of communities — take a look!

2 | -------------------------------------------------------------------------------- /db/seeds/tag_sets.yml: -------------------------------------------------------------------------------- 1 | - name: Main 2 | - name: Meta 3 | -------------------------------------------------------------------------------- /db/seeds/warning_templates.yml: -------------------------------------------------------------------------------- 1 | - name: Spam 2 | body: $FILE warning_templates/spam.md 3 | active: true 4 | 5 | - name: Rudeness 6 | body: $FILE warning_templates/rudeness.md 7 | active: true 8 | 9 | - name: Many off-topic posts 10 | body: $FILE warning_templates/off-topic.md 11 | active: true -------------------------------------------------------------------------------- /db/seeds/warning_templates/spam.md: -------------------------------------------------------------------------------- 1 | We've noticed that in addition to your contributions to $SiteName, you've also been using this account to promote a product, service, or similar. 2 | 3 | This is a gentle reminder that using an account for promotional purposes is against the rules of this site. 4 | 5 | Please take a moment to review the guidelines for promotional content here on $SiteName, which can be found in the [help center](/policy/spam). 6 | 7 | While we appreciate your continued contributions to $SiteName, we do ask that you stay within the boundaries of the rules about promotional content. -------------------------------------------------------------------------------- /docker/Dockerfile.db: -------------------------------------------------------------------------------- 1 | FROM mysql:8.4.2 2 | 3 | # docker build -t qpixel_db -f docker/Dockerfile.db . 4 | 5 | # These commands will be run on init of the container 6 | COPY docker/mysql-init.sql /docker-entrypoint-initdb.d/mysql-init.sql 7 | -------------------------------------------------------------------------------- /docker/compose-env: -------------------------------------------------------------------------------- 1 | COMPOSE_FILE=./docker-compose.yml 2 | LOCAL_DEV_PORT=3000 3 | COMMUNITY_NAME=Dev Community 4 | MAILER_PROTOCOL=https 5 | RAILS_ENV=development 6 | CONFIRMABLE_ALLOWED_ACCESS_DAYS=2 7 | ENV_FILE_LOCATION=./docker/env 8 | CLIENT_DOCKERFILE=docker/Dockerfile 9 | -------------------------------------------------------------------------------- /docker/dummy.env: -------------------------------------------------------------------------------- 1 | MYSQL_ROOT_PASSWORD=qpixel 2 | MYSQL_DATABASE=qpixel 3 | MYSQL_USER=qpixel 4 | MYSQL_PASSWORD=qpixel 5 | COMMUNITY_ADMIN_USERNAME=admin 6 | COMMUNITY_ADMIN_PASSWORD=password 7 | COMMUNITY_ADMIN_EMAIL=admin@noreply.com 8 | -------------------------------------------------------------------------------- /docker/local-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cp ./docker/dummy.env ./docker/env 4 | cp ./docker/compose-env .env 5 | cp config/database.docker.yml config/database.yml 6 | cp config/storage.docker.yml config/storage.yml 7 | cp ./.sample.irbrc ./.irbrc 8 | -------------------------------------------------------------------------------- /docker/mysql-init.sql: -------------------------------------------------------------------------------- 1 | 2 | /* database qpixel and user are already created * 3 | if you change your environment file, you need to update database names here */ 4 | GRANT ALL ON qpixel_dev.* TO qpixel; 5 | GRANT ALL ON qpixel_test.* TO qpixel; 6 | GRANT ALL ON qpixel.* TO qpixel; 7 | -------------------------------------------------------------------------------- /img/categories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/img/categories.png -------------------------------------------------------------------------------- /img/create-post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/img/create-post.png -------------------------------------------------------------------------------- /img/edit-category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/img/edit-category.png -------------------------------------------------------------------------------- /img/example_screenshot_codidact.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/img/example_screenshot_codidact.jpg -------------------------------------------------------------------------------- /img/interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/img/interface.png -------------------------------------------------------------------------------- /img/logged-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/img/logged-in.png -------------------------------------------------------------------------------- /img/meta-tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/img/meta-tags.png -------------------------------------------------------------------------------- /img/post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/img/post.png -------------------------------------------------------------------------------- /img/qpixel-dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/img/qpixel-dev.png -------------------------------------------------------------------------------- /img/required-tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/img/required-tags.png -------------------------------------------------------------------------------- /img/tagset-selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/img/tagset-selected.png -------------------------------------------------------------------------------- /img/tagset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/img/tagset.png -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/lib/tasks/.keep -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qpixel", 3 | "description": "Rails-based Q&A engine", 4 | "private": true, 5 | "scripts": { 6 | "typecheck": "tsc" 7 | }, 8 | "devDependencies": { 9 | "@types/jquery": "^3.5.32", 10 | "@types/select2": "^4.0.63", 11 | "typescript": "5.6.3" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /public/assets/ability-help/close-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/ability-help/close-dialog.png -------------------------------------------------------------------------------- /public/assets/ability-help/edit-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/ability-help/edit-link.png -------------------------------------------------------------------------------- /public/assets/ability-help/flag-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/ability-help/flag-dialog.png -------------------------------------------------------------------------------- /public/assets/ability-help/flag-inline-handling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/ability-help/flag-inline-handling.png -------------------------------------------------------------------------------- /public/assets/ability-help/voting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/ability-help/voting.png -------------------------------------------------------------------------------- /public/assets/codidact-org.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/codidact-org.png -------------------------------------------------------------------------------- /public/assets/codidactyl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/codidactyl.png -------------------------------------------------------------------------------- /public/assets/community/codegolf.css: -------------------------------------------------------------------------------- 1 | .cg-leaderboard .cgl-container { 2 | display: flex; 3 | align-items: center; 4 | } 5 | 6 | .cgl-container .cgl-option { 7 | margin-left: auto; 8 | } 9 | 10 | .cg-leaderboard .toc--full { 11 | display: flex; 12 | align-items: center; 13 | } 14 | 15 | .cg-leaderboard .row-summary { 16 | align-items: center; 17 | display: flex; 18 | overflow: hidden; 19 | text-overflow: ellipsis; 20 | white-space: nowrap; 21 | } 22 | -------------------------------------------------------------------------------- /public/assets/community/judaism.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre&display=swap'); 2 | 3 | .post--body > *:not(div), .post-list--title, .post--title { 4 | font-family: 'Frank Ruhl Libre', serif; 5 | } 6 | -------------------------------------------------------------------------------- /public/assets/down-clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/down-clear.png -------------------------------------------------------------------------------- /public/assets/down-fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/down-fill.png -------------------------------------------------------------------------------- /public/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/favicon.png -------------------------------------------------------------------------------- /public/assets/logo-writing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/logo-writing.png -------------------------------------------------------------------------------- /public/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/logo.png -------------------------------------------------------------------------------- /public/assets/scoring_3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/scoring_3d.png -------------------------------------------------------------------------------- /public/assets/scoring_distribution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/scoring_distribution.png -------------------------------------------------------------------------------- /public/assets/scoring_formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/scoring_formula.png -------------------------------------------------------------------------------- /public/assets/scoring_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/scoring_table.png -------------------------------------------------------------------------------- /public/assets/tour-clippy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/tour-clippy.png -------------------------------------------------------------------------------- /public/assets/tour-evil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/tour-evil.png -------------------------------------------------------------------------------- /public/assets/up-clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/up-clear.png -------------------------------------------------------------------------------- /public/assets/up-fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/assets/up-fill.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/public/favicon.ico -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: SemrushBot 2 | Disallow: / 3 | 4 | User-agent: SemrushBot-SA 5 | Disallow: / 6 | 7 | User-agent: SemrushBot-BA 8 | Disallow: / 9 | 10 | User-agent: SemrushBot-SI 11 | Disallow: / 12 | 13 | User-agent: SemrushBot-SWA 14 | Disallow: / 15 | 16 | User-agent: SemrushBot-CT 17 | Disallow: / 18 | 19 | User-agent: SemrushBot-BM 20 | Disallow: / 21 | 22 | User-agent: SemrushBot-SEOAB 23 | Disallow: / 24 | 25 | User-agent: MJ12bot 26 | Disallow: / 27 | 28 | User-agent: DotBot 29 | Disallow: / 30 | -------------------------------------------------------------------------------- /scripts/cleanup_drafts.rb: -------------------------------------------------------------------------------- 1 | redis = RequestContext.redis 2 | 3 | redis.scan_each(:match => "saved_post.*.*.tags") do |key| 4 | redis.srem?(key, '') 5 | end -------------------------------------------------------------------------------- /scripts/cleanup_votes.rb: -------------------------------------------------------------------------------- 1 | CleanupVotesJob.perform_later -------------------------------------------------------------------------------- /scripts/clear_cache.rb: -------------------------------------------------------------------------------- 1 | Rails.cache.delete_matched 'network/*' -------------------------------------------------------------------------------- /scripts/create_backup_2fa_codes.rb: -------------------------------------------------------------------------------- 1 | User.where(enabled_2fa: true).each do |user| 2 | user.update(backup_2fa_code: SecureRandom.alphanumeric(24)) 3 | TwoFactorMailer.with(user: user, host: 'meta.codidact.com').backup_code.deliver_now 4 | end 5 | -------------------------------------------------------------------------------- /scripts/create_initial_tags.rb: -------------------------------------------------------------------------------- 1 | @options = {} 2 | OptionParser.new do |opts| 3 | opts.on('-c COMMUNITY_ID', '--community=COMMUNITY_ID', Integer) 4 | opts.on('-t TAG_SET_ID', '--tag-set=TAG_SET_ID', Integer) do |t| 5 | @options[:tag_set] = t 6 | end 7 | end.parse!(into: @options) 8 | 9 | tags = ARGV 10 | 11 | created = Tag.create(tags.map { |t| { name: t, community_id: @options[:community], tag_set_id: @options[:tag_set] } }) 12 | puts "Created #{created.size} tags." -------------------------------------------------------------------------------- /scripts/prune_email_logs.rb: -------------------------------------------------------------------------------- 1 | EmailLog.where('created_at < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 MONTH)').destroy_all 2 | -------------------------------------------------------------------------------- /scripts/run_spam_cleanup.rb: -------------------------------------------------------------------------------- 1 | CleanUpSpammyUsersJob.perform_later 2 | -------------------------------------------------------------------------------- /scripts/send_subscription_emails.rb: -------------------------------------------------------------------------------- 1 | # SQL for selecting subscriptions due for sending. 2 | # DO NOT USE USER INPUT IN THIS CLAUSE, IT GETS PASSED DIRECTLY TO Arel.sql 3 | select_clause = 'last_sent_at IS NULL OR DATE_ADD(last_sent_at, INTERVAL frequency DAY) <= DATE_ADD(CURRENT_TIMESTAMP, INTERVAL 5 MINUTE)' 4 | 5 | Subscription.unscoped.where(Arel.sql(select_clause)).includes(:community).each do |sub| 6 | SubscriptionMailer.with(subscription: sub).subscription.deliver_now 7 | end -------------------------------------------------------------------------------- /test/.rubocop.yml: -------------------------------------------------------------------------------- 1 | inherit_from: 2 | - '../.rubocop.yml' 3 | 4 | Layout/LineLength: 5 | Max: 150 6 | 7 | Metrics/BlockLength: 8 | CountAsOne: ['array'] 9 | 10 | Metrics/ClassLength: 11 | Enabled: false -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/test/controllers/.keep -------------------------------------------------------------------------------- /test/controllers/articles_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ArticlesControllerTest < ActionController::TestCase 4 | include Devise::Test::ControllerHelpers 5 | end 6 | -------------------------------------------------------------------------------- /test/controllers/donations_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class DonationsControllerTest < ActionController::TestCase 4 | include Devise::Test::ControllerHelpers 5 | 6 | test 'should get index' do 7 | get :index 8 | assert_response 200 9 | end 10 | 11 | test 'should create PaymentIntent' do 12 | skip unless Stripe.api_key 13 | post :intent, params: { currency: 'EUR', amount: '24.99', desc: 'Created from Rails test' } 14 | assert_response 200 15 | assert_not_nil assigns(:intent)&.id 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /test/controllers/email_logs_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class EmailLogsControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/micro_auth/apps_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class MicroAuth::AppsControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/micro_auth/authentication_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class MicroAuth::AuthenticationControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/pinned_links_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class PinnedLinksControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/questions_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class QuestionsControllerTest < ActionController::TestCase 4 | include Devise::Test::ControllerHelpers 5 | include ApplicationTestHelper 6 | end 7 | -------------------------------------------------------------------------------- /test/controllers/tour_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TourControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/two_factor_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TwoFactorControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/test/fixtures/.keep -------------------------------------------------------------------------------- /test/fixtures/ability_queues.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/fixtures/audit_logs.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | admin_log: 4 | community: sample 5 | log_type: admin_audit 6 | event_type: setting_update 7 | related_type: SiteSetting 8 | related: one 9 | user: admin 10 | comment: some words 11 | -------------------------------------------------------------------------------- /test/fixtures/blocked_items.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/fixtures/category_filter_defaults.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | main_default_filter: 4 | user: standard_user 5 | filter: one 6 | category: main 7 | 8 | meta_default_filter: 9 | user: standard_user 10 | filter: one 11 | category: meta 12 | -------------------------------------------------------------------------------- /test/fixtures/close_reasons.yml: -------------------------------------------------------------------------------- 1 | duplicate: 2 | name: duplicate 3 | description: duplicate 4 | active: true 5 | requires_other_post: true 6 | community: sample 7 | 8 | not_good: 9 | name: not good 10 | description: not good 11 | active: true 12 | requires_other_post: false 13 | community: sample -------------------------------------------------------------------------------- /test/fixtures/communities.yml: -------------------------------------------------------------------------------- 1 | sample: 2 | host: sample.qpixel.com 3 | name: Sample 4 | 5 | fake: 6 | host: fake.qpixel.com 7 | name: Comms Sabotage 8 | is_fake: true 9 | -------------------------------------------------------------------------------- /test/fixtures/email_logs.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | log_type: MyString 5 | destination: MyString 6 | data: MyText 7 | 8 | two: 9 | log_type: MyString 10 | destination: MyString 11 | data: MyText 12 | -------------------------------------------------------------------------------- /test/fixtures/filters.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | name: MyFilterOne 5 | user: standard_user 6 | min_score: 1.5 7 | max_score: 1.5 8 | min_answers: 1 9 | max_answers: 1 10 | status: MyString 11 | 12 | two: 13 | name: MyFilterTwo 14 | user: standard_user 15 | min_score: 1.5 16 | max_score: 1.5 17 | min_answers: 1 18 | max_answers: 1 19 | status: MyString 20 | -------------------------------------------------------------------------------- /test/fixtures/flags.yml: -------------------------------------------------------------------------------- 1 | one: 2 | reason: ABCDEF GHIJKL MNOPQR STUVWX YZ 3 | post: answer_two (Post) 4 | user: standard_user 5 | community: sample 6 | 7 | on_deleter: 8 | reason: For science! 9 | post: deleted (Post) 10 | user: deleter 11 | community: sample 12 | 13 | confidential_on_deleter: 14 | reason: TOP SECRET DO NOT SHARE 15 | post: deleted (Post) 16 | post_flag_type: confidential 17 | user: deleter 18 | community: sample 19 | -------------------------------------------------------------------------------- /test/fixtures/micro_auth/apps.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | name: MyString 5 | app_id: MyString 6 | public_key: MyString 7 | secret_key: MyString 8 | description: MyText 9 | auth_domain: MyString 10 | 11 | two: 12 | name: MyString 13 | app_id: MyString 14 | public_key: MyString 15 | secret_key: MyString 16 | description: MyText 17 | auth_domain: MyString 18 | -------------------------------------------------------------------------------- /test/fixtures/micro_auth/tokens.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | app: one 5 | user: one 6 | token: MyString 7 | expires_at: 2021-11-21 19:51:00 8 | 9 | two: 10 | app: two 11 | user: two 12 | token: MyString 13 | expires_at: 2021-11-21 19:51:00 14 | -------------------------------------------------------------------------------- /test/fixtures/notifications.yml: -------------------------------------------------------------------------------- 1 | one: 2 | content: ABCDEF GHIJKL MNOPQR STUVWX YZ 3 | link: / 4 | user: standard_user 5 | community: sample 6 | 7 | two: 8 | content: ABCDEF GHIJKL MNOPQR STUVWX 9 | link: / 10 | user: standard_user 11 | community: sample 12 | -------------------------------------------------------------------------------- /test/fixtures/pinned_links.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/fixtures/post_flag_types.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | # 13 | confidential: 14 | community: sample 15 | confidential: true 16 | name: For your eyes only 17 | -------------------------------------------------------------------------------- /test/fixtures/post_histories.yml: -------------------------------------------------------------------------------- 1 | question_one_revision: 2 | post_history_type: revision 3 | user: editor 4 | post: question_one 5 | before_title: Q1 - This is test question number one 6 | after_title: Revised title for question one 7 | comment: A simple revision made by an editor user 8 | community: sample 9 | 10 | question_one_hidden_revision: 11 | post_history_type: revision 12 | user: admin 13 | post: question_one 14 | comment: 'A hidden revision made by an admin user' 15 | community: sample 16 | hidden: true 17 | -------------------------------------------------------------------------------- /test/fixtures/post_history_tags.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | post_history: one 5 | tag: one 6 | relationship: MyString 7 | 8 | two: 9 | post_history: two 10 | tag: two 11 | relationship: MyString 12 | -------------------------------------------------------------------------------- /test/fixtures/post_history_types.yml: -------------------------------------------------------------------------------- 1 | initial_revision: 2 | name: initial_revision 3 | description: initial revision 4 | 5 | revision: 6 | name: revision 7 | description: normal revision 8 | -------------------------------------------------------------------------------- /test/fixtures/reactions.yml: -------------------------------------------------------------------------------- 1 | one: 2 | user: standard_user 3 | reaction_type: wfm 4 | post: answer_one 5 | comment: ~ -------------------------------------------------------------------------------- /test/fixtures/site_settings.yml: -------------------------------------------------------------------------------- 1 | one: 2 | name: ABCDEF 3 | value: ABCDEF GHIJKL 4 | value_type: string 5 | 6 | sanitize: 7 | name: AskingGuidance 8 | value: "" 9 | value_type: string 10 | 11 | int: 12 | name: SettingWithIntegerValue 13 | value: 42 14 | value_type: integer 15 | 16 | text: 17 | name: SettingWithTextValue 18 | value: "

a paragraph of text

" 19 | value_type: text 20 | -------------------------------------------------------------------------------- /test/fixtures/tag_sets.yml: -------------------------------------------------------------------------------- 1 | main: 2 | name: Main 3 | community: sample 4 | 5 | meta: 6 | name: Meta 7 | community: sample 8 | 9 | empty: 10 | name: 'Empty' 11 | community: sample 12 | -------------------------------------------------------------------------------- /test/fixtures/tag_synonyms.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | base_synonym: 4 | name: synonym 5 | tag: base 6 | -------------------------------------------------------------------------------- /test/fixtures/thread_followers.yml: -------------------------------------------------------------------------------- 1 | deleter_normal: 2 | user: deleter 3 | comment_thread: normal 4 | 5 | standard_author_normal: 6 | user: standard_user 7 | comment_thread: normal 8 | -------------------------------------------------------------------------------- /test/fixtures/warning_templates.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/test/helpers/.keep -------------------------------------------------------------------------------- /test/helpers/abilities_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AbilitiesHelperTest < ActionView::TestCase 4 | include Devise::Test::ControllerHelpers 5 | 6 | test 'linearize_progress works as expected' do 7 | expected = [[0.2, 0], [0.5, 0.0], [0.98, 95.99999999999991], [0.99, 195.99999999999983]] 8 | expected.each do |score, exp| 9 | assert_equal exp, linearize_progress(score) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /test/helpers/seeds_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SeedsHelperTest < ActionView::TestCase 4 | test 'calling SeedsHelper#files with seed_name should constrain paths' do 5 | files = SeedsHelper.files('posts') 6 | 7 | assert_instance_of Array, files 8 | assert_equal files.length, 1 9 | assert_includes files, "#{Dir.pwd}/db/seeds/posts.yml" 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/test/integration/.keep -------------------------------------------------------------------------------- /test/jobs/clean_up_spammy_users_job_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class CleanUpSpammyUsersJobTest < ActiveJob::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/test/mailers/.keep -------------------------------------------------------------------------------- /test/mailers/admin_mailer_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AdminMailerTest < ActionMailer::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/mailers/donation_mailer_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class DonationMailerTest < ActionMailer::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/mailers/flag_mailer_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class FlagMailerTest < ActionMailer::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/mailers/previews/admin_mailer_preview.rb: -------------------------------------------------------------------------------- 1 | # Preview all emails at http://localhost:3000/rails/mailers/admin_mailer 2 | class AdminMailerPreview < ActionMailer::Preview 3 | end 4 | -------------------------------------------------------------------------------- /test/mailers/previews/devise_mailer_preview.rb: -------------------------------------------------------------------------------- 1 | class DeviseMailerPreview < ActionMailer::Preview 2 | def confirmation_instructions 3 | Devise::Mailer.confirmation_instructions(User.first, 'faketoken') 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /test/mailers/previews/donation_mailer_preview.rb: -------------------------------------------------------------------------------- 1 | # Preview all emails at http://localhost:3000/rails/mailers/donation_mailer 2 | class DonationMailerPreview < ActionMailer::Preview 3 | def donation_successful 4 | DonationMailer.with(symbol: '$', amount: 25.0, user: User.first).donation_successful 5 | end 6 | 7 | def donation_uncaptured 8 | DonationMailer.with(symbol: '£', amount: 19.5, user: User.first).donation_uncaptured 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /test/mailers/previews/flag_mailer_preview.rb: -------------------------------------------------------------------------------- 1 | # Preview all emails at http://localhost:3000/rails/mailers/flag_mailer 2 | class FlagMailerPreview < ActionMailer::Preview 3 | end 4 | -------------------------------------------------------------------------------- /test/mailers/previews/subscription_mailer_preview.rb: -------------------------------------------------------------------------------- 1 | # Preview all emails at http://localhost:3000/rails/mailers/subscription_mailer 2 | class SubscriptionMailerPreview < ActionMailer::Preview 3 | def subscription 4 | SubscriptionMailer.with(subscription: Subscription.first).subscription 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /test/mailers/previews/two_factor_mailer_preview.rb: -------------------------------------------------------------------------------- 1 | # Preview all emails at http://localhost:3000/rails/mailers/two_factor_mailer 2 | class TwoFactorMailerPreview < ActionMailer::Preview 3 | def disable_email_preview 4 | TwoFactorMailer.with(user: User.last, host: 'testhost.codidact.com').disable_email 5 | end 6 | 7 | def login_email_preview 8 | TwoFactorMailer.with(user: User.last, host: 'testhost.codidact.com').login_email 9 | end 10 | 11 | def backup_code_preview 12 | TwoFactorMailer.with(user: User.last, host: 'testhost.codidact.com').backup_code 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /test/mailers/subscription_mailer_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SubscriptionMailerTest < ActionMailer::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/mailers/two_factor_mailer_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TwoFactorMailerTest < ActionMailer::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/test/models/.keep -------------------------------------------------------------------------------- /test/models/ability_queue_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AbilityQueueTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/ability_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AbilityTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/audit_log_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AuditLogTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/blocked_item_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BlockedItemTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/category_filter_default_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class CategoryFilterDefaultTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/category_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class CategoryTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/comment_thread_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class CommentThreadTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/email_log_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class EmailLogTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/error_log_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ErrorLogTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/filter_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class FilterTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/flag_status_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class FlagStatusTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/flag_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class FlagTest < ActiveSupport::TestCase 4 | include CommunityRelatedHelper 5 | 6 | test 'is post related' do 7 | assert_post_related(Flag) 8 | end 9 | 10 | test 'confidential?' do 11 | normal = flags(:one) 12 | secret = flags(:confidential_on_deleter) 13 | 14 | assert_equal normal.confidential?, false 15 | assert_equal secret.confidential?, true 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /test/models/license_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class LicenseTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/micro_auth/app_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class MicroAuth::AppTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/micro_auth/token_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class MicroAuth::TokenTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/mod_warning_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ModWarningTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/notification_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class NotificationTest < ActiveSupport::TestCase 4 | include CommunityRelatedHelper 5 | 6 | test 'is community related' do 7 | assert_community_related(Notification) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /test/models/pinned_link_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class PinnedLinkTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/post_flag_type_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class PostFlagTypeTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/post_history_tag_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class PostHistoryTagTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/post_history_type_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class PostHistoryTypeTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/reaction_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ReactionTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/reaction_type_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ReactionTypeTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/tag_set_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TagSetTest < ActiveSupport::TestCase 4 | include CommunityRelatedHelper 5 | 6 | test 'is community related' do 7 | assert_community_related(TagSet) 8 | end 9 | 10 | test 'with_paths method should respect no_excerpt' do 11 | main = TagSet.main 12 | 13 | all = main.with_paths.size 14 | excerptless = main.with_paths(true).size 15 | 16 | assert_not_equal(all, excerptless) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /test/models/tag_synonym_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TagSynonymTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/tag_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TagTest < ActiveSupport::TestCase 4 | include CommunityRelatedHelper 5 | 6 | test 'is community related' do 7 | assert_community_related(Tag) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /test/models/thread_follower_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ThreadFollowerTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/user_ability_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserAbilityTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/warning_template_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class WarningTemplateTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/vendor/assets/javascripts/.keep -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codidact/qpixel/e29966742561401c32d7c914113cc09a7737c6ed/vendor/assets/stylesheets/.keep --------------------------------------------------------------------------------