Fix encoding when cloning tables

Closes SCI-1175.
This commit is contained in:
Luka Murn 2017-04-13 17:00:27 +02:00
parent cb1ad9e0be
commit 9c28608fbf
3 changed files with 7 additions and 2 deletions

View file

@ -319,7 +319,7 @@ class Protocol < ActiveRecord::Base
# Copy tables
step.tables.each do |table|
table2 = Table.new(name: table.name, contents: table.contents)
table2 = Table.new(name: table.name, contents: table.contents.force_encoding('UTF-8'))
table2.created_by = current_user
table2.last_modified_by = current_user
table2.team = dest.team

View file

@ -20,6 +20,8 @@ module Scinote
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
config.encoding = 'utf-8'
config.active_job.queue_adapter = :delayed_job
# Do not swallow errors in after_commit/after_rollback callbacks.

View file

@ -1,6 +1,9 @@
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Set the encoding
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
# Initialize the Rails application.
Rails.application.initialize!