small refactoring

This commit is contained in:
Karol
2019-09-05 17:41:02 +02:00
parent 973cc43f4c
commit a7f2d7da34
5 changed files with 7 additions and 11 deletions

View File

@ -1,3 +1,3 @@
h1 = 'Codeharbor link'
h1 = CodeharborLink.model_name.human
= render('form')

View File

@ -9,8 +9,3 @@ h1
= row(label: 'internal_user.activated', value: @user.activated?)
= row(label: 'codeharbor_link.profile_label', value: @user.codeharbor_link.nil? ? link_to(t('codeharbor_link.new'), new_codeharbor_link_path, class: 'btn btn-secondary') : link_to(t('codeharbor_link.edit'), edit_codeharbor_link_path(@user.codeharbor_link), class: 'btn btn-secondary'))
/ - if @user.codeharbor_link.nil?
/ = row(label: 'codeharbor_link.profile_label', value: link_to(t('codeharbor_link.new'), codeharbor_link_new_path, class: 'btn btn-secondary'))
/ - else
/ = row(label: 'codeharbor_link.profile_label', value: link_to(t('codeharbor_link.edit'), edit_codeharbor_link_path(@user.codeharbor_link), class: 'btn btn-secondary'))

View File

@ -11,7 +11,7 @@ Rails.application.configure do
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = true
config.eager_load = false
# Show full error reports.
config.consider_all_requests_local = true

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_08_30_142809) do
ActiveRecord::Schema.define(version: 2019_09_05_152630) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -154,6 +154,7 @@ ActiveRecord::Schema.define(version: 2019_08_30_142809) do
t.boolean "allow_auto_completion", default: false
t.integer "expected_difficulty", default: 1
t.uuid "uuid"
t.string "import_checksum"
t.index ["id"], name: "index_exercises_on_id"
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
# stole from: https://makandracards.com/makandra/50526-fileio-writing-strings-as-carrierwave-uploads
# stolen from: https://makandracards.com/makandra/50526-fileio-writing-strings-as-carrierwave-uploads
class FileIO < StringIO
def initialize(stream, filename)
super(stream)