mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-13 08:34:49 +08:00
Fix encoding when cloning tables
Closes SCI-1175.
This commit is contained in:
parent
cb1ad9e0be
commit
9c28608fbf
3 changed files with 7 additions and 2 deletions
|
@ -319,7 +319,7 @@ class Protocol < ActiveRecord::Base
|
||||||
|
|
||||||
# Copy tables
|
# Copy tables
|
||||||
step.tables.each do |table|
|
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.created_by = current_user
|
||||||
table2.last_modified_by = current_user
|
table2.last_modified_by = current_user
|
||||||
table2.team = dest.team
|
table2.team = dest.team
|
||||||
|
|
|
@ -20,6 +20,8 @@ module Scinote
|
||||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||||
# config.i18n.default_locale = :de
|
# config.i18n.default_locale = :de
|
||||||
|
|
||||||
|
config.encoding = 'utf-8'
|
||||||
|
|
||||||
config.active_job.queue_adapter = :delayed_job
|
config.active_job.queue_adapter = :delayed_job
|
||||||
|
|
||||||
# Do not swallow errors in after_commit/after_rollback callbacks.
|
# Do not swallow errors in after_commit/after_rollback callbacks.
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
# Load the Rails application.
|
# Load the Rails application.
|
||||||
require File.expand_path('../application', __FILE__)
|
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.
|
# Initialize the Rails application.
|
||||||
Rails.application.initialize!
|
Rails.application.initialize!
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue