This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Answer < ActiveRecord::Base | |
belongs_to :question | |
belongs_to :user | |
validates :body, :question_id, :user_id, presence: true | |
default_scope { order("right_answer DESC").order("created_at DESC") } | |
def is_right_answer | |
self.question.answers.where("right_answer = ?", true).update_all("right_answer = false") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asdasd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APPLICATION_NAME = scubadiveslog # main app name or workdir defined in Dockerfile | |
WEB_CONTAINER_NAME = scuba-web # web container as defined in docker-compose | |
.DEFAULT_GOAL := help | |
# Docker stuff | |
attach: ## Attach running web container to see logs | |
docker attach $(APPLICATION_NAME)_$(WEB_CONTAINER_NAME)_1 | |
up: ## Run containers | |
docker-compose up -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MergePaypalVerificationAndContacts < ActiveRecord::Migration[7.0] | |
class User < ApplicationRecord | |
self.table_name = :users | |
has_many :user_verifications, class_name: 'UserVerification' | |
has_one :paypal_verification, class_name: 'OldPaypalVerification' | |
end | |
class UserVerification < ApplicationRecord | |
self.table_name = :user_verifications | |
self.inheritance_column = :_type_disabled |