Upgrade to rails 4.2.4.
This commit is contained in:
parent
dabc93a99e
commit
ad1b9b18bf
27 changed files with 268 additions and 194 deletions
2
Gemfile
2
Gemfile
|
@ -1,6 +1,6 @@
|
|||
source 'http://rubygems.org'
|
||||
|
||||
gem 'rails', '4.1.13'
|
||||
gem 'rails', '4.2.4'
|
||||
gem 'rails-observers'
|
||||
gem 'activerecord-session_store'
|
||||
|
||||
|
|
116
Gemfile.lock
116
Gemfile.lock
|
@ -2,42 +2,51 @@ GEM
|
|||
remote: http://rubygems.org/
|
||||
specs:
|
||||
abstract_type (0.0.7)
|
||||
actionmailer (4.1.13)
|
||||
actionpack (= 4.1.13)
|
||||
actionview (= 4.1.13)
|
||||
actionmailer (4.2.4)
|
||||
actionpack (= 4.2.4)
|
||||
actionview (= 4.2.4)
|
||||
activejob (= 4.2.4)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
actionpack (4.1.13)
|
||||
actionview (= 4.1.13)
|
||||
activesupport (= 4.1.13)
|
||||
rack (~> 1.5.2)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
actionpack (4.2.4)
|
||||
actionview (= 4.2.4)
|
||||
activesupport (= 4.2.4)
|
||||
rack (~> 1.6)
|
||||
rack-test (~> 0.6.2)
|
||||
actionview (4.1.13)
|
||||
activesupport (= 4.1.13)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
actionview (4.2.4)
|
||||
activesupport (= 4.2.4)
|
||||
builder (~> 3.1)
|
||||
erubis (~> 2.7.0)
|
||||
activemodel (4.1.13)
|
||||
activesupport (= 4.1.13)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
activejob (4.2.4)
|
||||
activesupport (= 4.2.4)
|
||||
globalid (>= 0.3.0)
|
||||
activemodel (4.2.4)
|
||||
activesupport (= 4.2.4)
|
||||
builder (~> 3.1)
|
||||
activerecord (4.1.13)
|
||||
activemodel (= 4.1.13)
|
||||
activesupport (= 4.1.13)
|
||||
arel (~> 5.0.0)
|
||||
activerecord (4.2.4)
|
||||
activemodel (= 4.2.4)
|
||||
activesupport (= 4.2.4)
|
||||
arel (~> 6.0)
|
||||
activerecord-session_store (0.1.1)
|
||||
actionpack (>= 4.0.0, < 5)
|
||||
activerecord (>= 4.0.0, < 5)
|
||||
railties (>= 4.0.0, < 5)
|
||||
activesupport (4.1.13)
|
||||
i18n (~> 0.6, >= 0.6.9)
|
||||
activesupport (4.2.4)
|
||||
i18n (~> 0.7)
|
||||
json (~> 1.7, >= 1.7.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.3.8)
|
||||
arel (5.0.1.20140414130214)
|
||||
arel (6.0.3)
|
||||
ast (2.1.0)
|
||||
astrolabe (1.3.1)
|
||||
parser (~> 2.2)
|
||||
autoprefixer-rails (6.0.2)
|
||||
autoprefixer-rails (6.0.3)
|
||||
execjs
|
||||
json
|
||||
biz (1.3.0)
|
||||
|
@ -62,11 +71,11 @@ GEM
|
|||
execjs
|
||||
coffee-script-source (1.9.1.1)
|
||||
daemons (1.2.3)
|
||||
delayed_job (4.0.6)
|
||||
delayed_job (4.1.1)
|
||||
activesupport (>= 3.0, < 5.0)
|
||||
delayed_job_active_record (4.0.3)
|
||||
activerecord (>= 3.0, < 5.0)
|
||||
delayed_job (>= 3.0, < 4.1)
|
||||
delayed_job_active_record (4.1.0)
|
||||
activerecord (>= 3.0, < 5)
|
||||
delayed_job (>= 3.0, < 5)
|
||||
docile (1.1.5)
|
||||
eco (1.0.0)
|
||||
coffee-script
|
||||
|
@ -84,6 +93,8 @@ GEM
|
|||
multipart-post (>= 1.2, < 3)
|
||||
ffi (1.9.10)
|
||||
formatador (0.2.5)
|
||||
globalid (0.3.6)
|
||||
activesupport (>= 4.1.0)
|
||||
guard (2.13.0)
|
||||
formatador (>= 0.2.4)
|
||||
listen (>= 2.7, <= 4.0)
|
||||
|
@ -113,6 +124,8 @@ GEM
|
|||
listen (3.0.3)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9)
|
||||
loofah (2.0.3)
|
||||
nokogiri (>= 1.5.9)
|
||||
lumberjack (1.0.9)
|
||||
mail (2.5.4)
|
||||
mime-types (~> 1.16)
|
||||
|
@ -121,7 +134,8 @@ GEM
|
|||
thread_safe (~> 0.3, >= 0.3.1)
|
||||
method_source (0.8.2)
|
||||
mime-types (1.25.1)
|
||||
minitest (5.8.0)
|
||||
mini_portile (0.6.2)
|
||||
minitest (5.8.1)
|
||||
multi_json (1.11.2)
|
||||
multi_xml (0.5.5)
|
||||
multipart-post (2.0.0)
|
||||
|
@ -129,7 +143,9 @@ GEM
|
|||
naught (1.1.0)
|
||||
nenv (0.2.0)
|
||||
net-ldap (0.11)
|
||||
notiffany (0.0.7)
|
||||
nokogiri (1.6.6.2)
|
||||
mini_portile (~> 0.6.0)
|
||||
notiffany (0.0.8)
|
||||
nenv (~> 0.1)
|
||||
shellany (~> 0.0)
|
||||
oauth (0.4.7)
|
||||
|
@ -163,31 +179,40 @@ GEM
|
|||
polyglot (0.3.5)
|
||||
power_assert (0.2.4)
|
||||
powerpack (0.1.1)
|
||||
pry (0.10.1)
|
||||
pry (0.10.2)
|
||||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.8.1)
|
||||
slop (~> 3.4)
|
||||
puma (2.13.4)
|
||||
rack (1.5.5)
|
||||
puma (2.14.0)
|
||||
rack (1.6.4)
|
||||
rack-livereload (0.3.16)
|
||||
rack
|
||||
rack-test (0.6.3)
|
||||
rack (>= 1.0)
|
||||
rails (4.1.13)
|
||||
actionmailer (= 4.1.13)
|
||||
actionpack (= 4.1.13)
|
||||
actionview (= 4.1.13)
|
||||
activemodel (= 4.1.13)
|
||||
activerecord (= 4.1.13)
|
||||
activesupport (= 4.1.13)
|
||||
rails (4.2.4)
|
||||
actionmailer (= 4.2.4)
|
||||
actionpack (= 4.2.4)
|
||||
actionview (= 4.2.4)
|
||||
activejob (= 4.2.4)
|
||||
activemodel (= 4.2.4)
|
||||
activerecord (= 4.2.4)
|
||||
activesupport (= 4.2.4)
|
||||
bundler (>= 1.3.0, < 2.0)
|
||||
railties (= 4.1.13)
|
||||
sprockets-rails (~> 2.0)
|
||||
railties (= 4.2.4)
|
||||
sprockets-rails
|
||||
rails-deprecated_sanitizer (1.0.3)
|
||||
activesupport (>= 4.2.0.alpha)
|
||||
rails-dom-testing (1.0.7)
|
||||
activesupport (>= 4.2.0.beta, < 5.0)
|
||||
nokogiri (~> 1.6.0)
|
||||
rails-deprecated_sanitizer (>= 1.0.1)
|
||||
rails-html-sanitizer (1.0.2)
|
||||
loofah (~> 2.0)
|
||||
rails-observers (0.1.2)
|
||||
activemodel (~> 4.0)
|
||||
railties (4.1.13)
|
||||
actionpack (= 4.1.13)
|
||||
activesupport (= 4.1.13)
|
||||
railties (4.2.4)
|
||||
actionpack (= 4.2.4)
|
||||
activesupport (= 4.2.4)
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
rainbow (2.0.0)
|
||||
|
@ -196,7 +221,7 @@ GEM
|
|||
rb-inotify (0.9.5)
|
||||
ffi (>= 0.5.0)
|
||||
ref (2.0.0)
|
||||
rubocop (0.34.1)
|
||||
rubocop (0.34.2)
|
||||
astrolabe (~> 1.3)
|
||||
parser (>= 2.2.2.5, < 3.0)
|
||||
powerpack (~> 0.1)
|
||||
|
@ -227,7 +252,7 @@ GEM
|
|||
simplecov-rcov (0.2.3)
|
||||
simplecov (>= 0.4.1)
|
||||
slop (3.6.0)
|
||||
spring (1.3.6)
|
||||
spring (1.4.0)
|
||||
sprockets (3.3.4)
|
||||
rack (~> 1.0)
|
||||
sprockets-rails (2.3.3)
|
||||
|
@ -298,7 +323,7 @@ DEPENDENCIES
|
|||
omniauth-twitter
|
||||
puma
|
||||
rack-livereload
|
||||
rails (= 4.1.13)
|
||||
rails (= 4.2.4)
|
||||
rails-observers
|
||||
rb-fsevent
|
||||
rubocop
|
||||
|
@ -315,3 +340,6 @@ DEPENDENCIES
|
|||
twitter (~> 5.13.0)
|
||||
uglifier
|
||||
writeexcel
|
||||
|
||||
BUNDLED WITH
|
||||
1.10.5
|
||||
|
|
|
@ -67,9 +67,9 @@ class App.SettingsAreaItem extends App.Controller
|
|||
directValue += 1
|
||||
if directValue > 1
|
||||
for item in @setting.options['form']
|
||||
item['default'] = @setting.state.value[item.name]
|
||||
item['default'] = @setting.state_current.value[item.name]
|
||||
else
|
||||
item['default'] = @setting.state.value
|
||||
item['default'] = @setting.state_current.value
|
||||
|
||||
# form
|
||||
@configure_attributes = @setting.options['form']
|
||||
|
@ -97,17 +97,17 @@ class App.SettingsAreaItem extends App.Controller
|
|||
directData = params[item.name]
|
||||
|
||||
if directValue > 1
|
||||
state = {
|
||||
state_current = {
|
||||
value: params
|
||||
}
|
||||
#App.Config.set((@setting.name, params)
|
||||
else
|
||||
state = {
|
||||
state_current = {
|
||||
value: directData
|
||||
}
|
||||
#App.Config.set(@setting.name, directData)
|
||||
|
||||
@setting['state'] = state
|
||||
@setting['state_current'] = state_current
|
||||
ui = @
|
||||
@setting.save(
|
||||
done: =>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class App.Setting extends App.Model
|
||||
@configure 'Setting', 'name', 'state'
|
||||
@configure 'Setting', 'name', 'state_current'
|
||||
@extend Spine.Model.Ajax
|
||||
@url: @apiPath + '/settings'
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
class Setting < ApplicationModel
|
||||
store :options
|
||||
store :state
|
||||
store :state_current
|
||||
store :state_initial
|
||||
store :preferences
|
||||
before_create :state_check, :set_initial
|
||||
|
@ -11,6 +11,8 @@ class Setting < ApplicationModel
|
|||
after_update :reset_cache
|
||||
after_destroy :reset_cache
|
||||
|
||||
attr_accessor :state
|
||||
|
||||
@@current = {} # rubocop:disable Style/ClassVars
|
||||
@@change_id = nil # rubocop:disable Style/ClassVars
|
||||
@@lookup_at = nil # rubocop:disable Style/ClassVars
|
||||
|
@ -29,7 +31,7 @@ set config setting
|
|||
if !setting
|
||||
fail "Can't find config setting '#{name}'"
|
||||
end
|
||||
setting.state = { value: value }
|
||||
setting.state_current = { value: value }
|
||||
setting.save
|
||||
logger.info "Setting.set(#{name}, #{value.inspect})"
|
||||
end
|
||||
|
@ -64,9 +66,9 @@ reset config setting to default
|
|||
if !setting
|
||||
fail "Can't find config setting '#{name}'"
|
||||
end
|
||||
setting.state = setting.state_initial
|
||||
setting.state_current = setting.state_initial
|
||||
setting.save
|
||||
logger.info "Setting.reset(#{name}, #{setting.state.inspect})"
|
||||
logger.info "Setting.reset(#{name}, #{setting.state_current.inspect})"
|
||||
load
|
||||
@@current[:settings_config][name]
|
||||
end
|
||||
|
@ -83,8 +85,8 @@ reset config setting to default
|
|||
|
||||
# read all config settings
|
||||
config = {}
|
||||
Setting.select('name, state').order(:id).each { |setting|
|
||||
config[setting.name] = setting.state[:value]
|
||||
Setting.select('name, state_current').order(:id).each { |setting|
|
||||
config[setting.name] = setting.state_current[:value]
|
||||
}
|
||||
|
||||
# config lookups
|
||||
|
@ -103,7 +105,7 @@ reset config setting to default
|
|||
|
||||
# set initial value in state_initial
|
||||
def set_initial
|
||||
self.state_initial = state
|
||||
self.state_initial = state_current
|
||||
end
|
||||
|
||||
# set new cache
|
||||
|
@ -141,7 +143,7 @@ reset config setting to default
|
|||
|
||||
# convert state ot hash to be able to store it as store
|
||||
def state_check
|
||||
return if state.respond_to?('has_key?') && state.key?(:value)
|
||||
self.state = { value: state }
|
||||
return if state && state.respond_to?('has_key?') && state.key?(:value)
|
||||
self.state_current = { value: state }
|
||||
end
|
||||
end
|
||||
|
|
3
bin/bundle
Executable file
3
bin/bundle
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env ruby
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||
load Gem.bin_path('bundler', 'bundle')
|
4
bin/rails
Executable file
4
bin/rails
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env ruby
|
||||
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
||||
require_relative '../config/boot'
|
||||
require 'rails/commands'
|
4
bin/rake
Executable file
4
bin/rake
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env ruby
|
||||
require_relative '../config/boot'
|
||||
require 'rake'
|
||||
Rake.application.run
|
29
bin/setup
Executable file
29
bin/setup
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env ruby
|
||||
require 'pathname'
|
||||
|
||||
# path to your application root.
|
||||
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
||||
|
||||
Dir.chdir APP_ROOT do
|
||||
# This script is a starting point to setup your application.
|
||||
# Add necessary setup steps to this file:
|
||||
|
||||
puts "== Installing dependencies =="
|
||||
system "gem install bundler --conservative"
|
||||
system "bundle check || bundle install"
|
||||
|
||||
# puts "\n== Copying sample files =="
|
||||
# unless File.exist?("config/database.yml")
|
||||
# system "cp config/database.yml.sample config/database.yml"
|
||||
# end
|
||||
|
||||
puts "\n== Preparing database =="
|
||||
system "bin/rake db:setup"
|
||||
|
||||
puts "\n== Removing old logs and tempfiles =="
|
||||
system "rm -f log/*"
|
||||
system "rm -rf tmp/cache"
|
||||
|
||||
puts "\n== Restarting application server =="
|
||||
system "touch tmp/restart.txt"
|
||||
end
|
|
@ -2,12 +2,9 @@ require File.expand_path('../boot', __FILE__)
|
|||
|
||||
require 'rails/all'
|
||||
|
||||
if defined?(Bundler)
|
||||
# If you precompile assets before deploying to production, use this line
|
||||
Bundler.require(*Rails.groups(assets: %w(development test)))
|
||||
# If you want your assets lazily compiled in production, use this line
|
||||
# Bundler.require(:default, :assets, Rails.env)
|
||||
end
|
||||
# Require the gems listed in Gemfile, including any gems
|
||||
# you've limited to :test, :development, or :production.
|
||||
Bundler.require(*Rails.groups)
|
||||
|
||||
module Zammad
|
||||
class Application < Rails::Application
|
||||
|
@ -15,13 +12,12 @@ module Zammad
|
|||
# Application configuration should go into files in config/initializers
|
||||
# -- all .rb files in that directory are automatically loaded.
|
||||
|
||||
# Do not swallow errors in after_commit/after_rollback callbacks.
|
||||
config.active_record.raise_in_transactional_callbacks = true
|
||||
|
||||
# Custom directories with classes and modules you want to be autoloadable.
|
||||
config.autoload_paths += %W(#{config.root}/lib)
|
||||
|
||||
# Only load the plugins named here, in the order given (default is alphabetical).
|
||||
# :all can be used as a placeholder for all plugins not explicitly named.
|
||||
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
||||
|
||||
# Activate observers that should always be running.
|
||||
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
||||
config.active_record.observers =
|
||||
|
@ -46,29 +42,11 @@ module Zammad
|
|||
'observer::_user::_geo',
|
||||
'observer::_organization::_ref_object_touch'
|
||||
|
||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||
# config.i18n.default_locale = :de
|
||||
|
||||
# Configure the default encoding used in templates for Ruby 1.9.
|
||||
config.encoding = 'utf-8'
|
||||
|
||||
# Configure sensitive parameters which will be filtered from the log file.
|
||||
config.filter_parameters += [:password]
|
||||
|
||||
# Use SQL instead of Active Record's schema dumper when creating the database.
|
||||
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
||||
# like if you have constraints or database-specific column types
|
||||
# config.active_record.schema_format = :sql
|
||||
|
||||
# Enable the asset pipeline
|
||||
config.assets.enabled = true
|
||||
|
||||
# Version of your assets, change this if you want to expire all your assets
|
||||
config.assets.version = '1.0'
|
||||
|
||||
# REST api path
|
||||
config.api_path = '/api/v1'
|
||||
|
||||
# define cache store
|
||||
config.cache_store = :file_store, "tmp/cache_file_store_#{Rails.env}"
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
require 'rubygems'
|
||||
|
||||
# Set up gems listed in the Gemfile.
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||
|
||||
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
||||
require 'bundler/setup' # Set up gems listed in the Gemfile.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Load the rails application
|
||||
# Load the Rails application.
|
||||
require File.expand_path('../application', __FILE__)
|
||||
|
||||
# Initialize the rails application
|
||||
Zammad::Application.initialize!
|
||||
# Initialize the Rails application.
|
||||
Rails.application.initialize!
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Zammad::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
# In the development environment your application's code is reloaded on
|
||||
# every request. This slows down response time but is perfect for development
|
||||
|
@ -9,26 +9,27 @@ Zammad::Application.configure do
|
|||
# Do not eager load code on boot.
|
||||
config.eager_load = false
|
||||
|
||||
# Show full error reports and disable caching
|
||||
# Show full error reports and disable caching.
|
||||
config.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
# Don't care if the mailer can't send
|
||||
# Don't care if the mailer can't send.
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
# Print deprecation notices to the Rails logger
|
||||
# Print deprecation notices to the Rails logger.
|
||||
config.active_support.deprecation = :log
|
||||
|
||||
# Raise an error on page load if there are pending migrations
|
||||
# Raise an error on page load if there are pending migrations.
|
||||
config.active_record.migration_error = :page_load
|
||||
|
||||
# Do not compress assets
|
||||
config.assets.compress = false
|
||||
|
||||
# Deliver all in one application.(js|css) file
|
||||
#config.assets.debug = false
|
||||
# Expands the lines which load the assets
|
||||
config.assets.debug = true
|
||||
# Debug mode disables concatenation and preprocessing of assets.
|
||||
# This option may cause significant delays in view rendering with a large
|
||||
# number of complex assets.
|
||||
#config.assets.debug = true
|
||||
config.assets.debug = false
|
||||
|
||||
# Automatically inject JavaScript needed for LiveReload
|
||||
config.middleware.use(
|
||||
|
@ -39,9 +40,18 @@ Zammad::Application.configure do
|
|||
source: :vendored
|
||||
)
|
||||
|
||||
# define cache store
|
||||
config.cache_store = :file_store, 'tmp/cache_file_store_development'
|
||||
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
||||
# yet still be able to expire them through the digest params.
|
||||
config.assets.digest = true
|
||||
|
||||
# format log
|
||||
config.log_formatter = Logger::Formatter.new
|
||||
|
||||
# Adds additional error checking when serving assets at runtime.
|
||||
# Checks for improperly declared sprockets dependencies.
|
||||
# Raises helpful error messages.
|
||||
config.assets.raise_runtime_errors = true
|
||||
|
||||
# Raises error for missing translations
|
||||
# config.action_view.raise_on_missing_translations = true
|
||||
end
|
||||
|
|
|
@ -1,82 +1,87 @@
|
|||
Zammad::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
# Code is not reloaded between requests
|
||||
# Code is not reloaded between requests.
|
||||
config.cache_classes = true
|
||||
|
||||
# Eager load code on boot. This eager loads most of Rails and
|
||||
# your application in memory, allowing both thread web servers
|
||||
# your application in memory, allowing both threaded web servers
|
||||
# and those relying on copy on write to perform better.
|
||||
# Rake tasks automatically ignore this option for performance.
|
||||
config.eager_load = true
|
||||
|
||||
# Full error reports are disabled and caching is turned on
|
||||
# Full error reports are disabled and caching is turned on.
|
||||
config.consider_all_requests_local = false
|
||||
config.action_controller.perform_caching = true
|
||||
|
||||
# Disable Rails's static asset server (Apache or nginx will already do this)
|
||||
config.serve_static_assets = false
|
||||
|
||||
# Compress JavaScripts and CSS
|
||||
config.assets.compress = true
|
||||
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
||||
# Add `rack-cache` to your Gemfile before enabling this.
|
||||
# For large-scale production use, consider using a caching reverse proxy like
|
||||
# NGINX, varnish or squid.
|
||||
# config.action_dispatch.rack_cache = true
|
||||
|
||||
# Set uglifier as JS and sass as CSS compressor
|
||||
config.assets.js_compressor = :uglifier
|
||||
# Disable serving static files from the `/public` folder by default since
|
||||
# Apache or NGINX already handles this.
|
||||
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
||||
|
||||
# Compress JavaScripts and CSS.
|
||||
config.assets.js_compressor = :uglifier
|
||||
# config.assets.css_compressor = :sass
|
||||
|
||||
# Don't fallback to assets pipeline if a precompiled asset is missed
|
||||
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
||||
config.assets.compile = false
|
||||
|
||||
# Generate digests for assets URLs
|
||||
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
||||
# yet still be able to expire them through the digest params.
|
||||
config.assets.digest = true
|
||||
|
||||
# Version of your assets, change this if you want to expire all your assets
|
||||
config.assets.version = '1.0'
|
||||
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
||||
|
||||
# Specifies the header that your server uses for sending files
|
||||
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
||||
# Specifies the header that your server uses for sending files.
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
||||
|
||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies
|
||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||
# config.force_ssl = true
|
||||
|
||||
# Define the log level (default is :info, to see all use :debug)
|
||||
# config.log_level = :debug
|
||||
# Use the lowest log level to ensure availability of diagnostic information
|
||||
# when problems arise.
|
||||
config.log_level = :info
|
||||
|
||||
# Prepend all log lines with the following tags
|
||||
# Prepend all log lines with the following tags.
|
||||
# config.log_tags = [ :subdomain, :uuid ]
|
||||
|
||||
# Use a different logger for distributed setups
|
||||
# Use a different logger for distributed setups.
|
||||
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
||||
|
||||
# Use a different cache store in production
|
||||
# Use a different cache store in production.
|
||||
# config.cache_store = :mem_cache_store
|
||||
|
||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
||||
# config.action_controller.asset_host = "http://assets.example.com"
|
||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||
# config.action_controller.asset_host = 'http://assets.example.com'
|
||||
|
||||
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
||||
# config.assets.precompile += %w( search.js )
|
||||
|
||||
# Disable delivery errors, bad email addresses will be ignored
|
||||
# Ignore bad email addresses and do not raise email delivery errors.
|
||||
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
||||
# config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||
# the I18n.default_locale when a translation can not be found)
|
||||
# the I18n.default_locale when a translation cannot be found).
|
||||
config.i18n.fallbacks = true
|
||||
|
||||
# Send deprecation notices to registered listeners
|
||||
config.active_support.deprecation = :notify
|
||||
|
||||
# Disable automatic flushing of the log to improve performance
|
||||
# config.autoflush_log = false
|
||||
|
||||
# Enable autoload
|
||||
config.dependency_loading = true
|
||||
|
||||
# Use default logging formatter so that PID and timestamp are not suppressed
|
||||
#config.log_formatter = ::Logger::Formatter.new
|
||||
# Send deprecation notices to registered listeners.
|
||||
config.active_support.deprecation = :notify
|
||||
|
||||
# Use default logging formatter so that PID and timestamp are not suppressed.
|
||||
config.log_formatter = ::Logger::Formatter.new
|
||||
|
||||
# Do not dump schema after migrations.
|
||||
config.active_record.dump_schema_after_migration = false
|
||||
|
||||
# format log
|
||||
config.log_formatter = Logger::Formatter.new
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Zammad::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
# The test environment is used exclusively to run your application's
|
||||
# test suite. You never need to work with it otherwise. Remember that
|
||||
|
@ -12,43 +12,38 @@ Zammad::Application.configure do
|
|||
# preloads Rails for running tests, you may have to set it to true.
|
||||
config.eager_load = false
|
||||
|
||||
# Configure static asset server for tests with Cache-Control for performance
|
||||
config.serve_static_assets = true
|
||||
# Configure static file server for tests with Cache-Control for performance.
|
||||
config.serve_static_files = true
|
||||
config.static_cache_control = 'public, max-age=3600'
|
||||
|
||||
# Disable assert compression for relyable error code lines
|
||||
config.assets.compress = false
|
||||
|
||||
# Don't fallback to assets pipeline if a precompiled asset is missed
|
||||
config.assets.compile = true
|
||||
|
||||
# Generate digests for assets URLs
|
||||
config.assets.digest = true
|
||||
|
||||
# Show full error reports and disable caching
|
||||
# Show full error reports and disable caching.
|
||||
config.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
# Raise exceptions instead of rendering exception templates
|
||||
# Raise exceptions instead of rendering exception templates.
|
||||
config.action_dispatch.show_exceptions = false
|
||||
|
||||
# Disable request forgery protection in test environment.
|
||||
config.action_controller.allow_forgery_protection = false
|
||||
|
||||
# Tell Action Mailer not to deliver emails to the real world.
|
||||
# The :test delivery method accumulates sent emails in the
|
||||
# ActionMailer::Base.deliveries array.
|
||||
config.action_mailer.delivery_method = :test
|
||||
|
||||
# Print deprecation notices to the stderr
|
||||
# Randomize the order test cases are executed.
|
||||
config.active_support.test_order = :random
|
||||
|
||||
# Print deprecation notices to the stderr.
|
||||
config.active_support.deprecation = :stderr
|
||||
|
||||
# Disable request forgery protection in test environment
|
||||
config.action_controller.allow_forgery_protection = false
|
||||
# Raises error for missing translations
|
||||
# config.action_view.raise_on_missing_translations = true
|
||||
|
||||
# Enable autoload
|
||||
config.dependency_loading = true
|
||||
|
||||
# define cache store
|
||||
config.cache_store = :file_store, 'tmp/cache_file_store_test'
|
||||
|
||||
# format log
|
||||
config.log_formatter = Logger::Formatter.new
|
||||
|
||||
end
|
||||
|
|
11
config/initializers/assets.rb
Normal file
11
config/initializers/assets.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Version of your assets, change this if you want to expire all your assets.
|
||||
Rails.application.config.assets.version = '1.0'
|
||||
|
||||
# Add additional assets to the asset load path
|
||||
# Rails.application.config.assets.paths << Emoji.images_path
|
||||
|
||||
# Precompile additional assets.
|
||||
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
||||
# Rails.application.config.assets.precompile += %w( search.js )
|
3
config/initializers/cookies_serializer.rb
Normal file
3
config/initializers/cookies_serializer.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
Rails.application.config.action_dispatch.cookies_serializer = :marshal
|
4
config/initializers/filter_parameter_logging.rb
Normal file
4
config/initializers/filter_parameter_logging.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Configure sensitive parameters which will be filtered from the log file.
|
||||
Rails.application.config.filter_parameters += [:password]
|
|
@ -1,15 +1,16 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Add new inflection rules using the following format
|
||||
# (all these examples are active by default):
|
||||
# ActiveSupport::Inflector.inflections do |inflect|
|
||||
# Add new inflection rules using the following format. Inflections
|
||||
# are locale specific, and you may define rules for as many different
|
||||
# locales as you wish. All of these examples are active by default:
|
||||
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||
# inflect.plural /^(ox)$/i, '\1en'
|
||||
# inflect.singular /^(ox)en/i, '\1'
|
||||
# inflect.irregular 'person', 'people'
|
||||
# inflect.uncountable %w( fish sheep )
|
||||
# end
|
||||
#
|
||||
|
||||
# These inflection rules are supported but not enabled by default:
|
||||
# ActiveSupport::Inflector.inflections do |inflect|
|
||||
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||
# inflect.acronym 'RESTful'
|
||||
# end
|
||||
|
|
|
@ -2,4 +2,3 @@
|
|||
|
||||
# Add new mime types for use in respond_to blocks:
|
||||
# Mime::Type.register "text/richtext", :rtf
|
||||
# Mime::Type.register_alias "text/html", :iphone
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# update settings for searchable models
|
||||
if ActiveRecord::Base.connection.tables.include?('settings')
|
||||
models_current = Models.searchable.map(&:to_s)
|
||||
models_config = Setting.get('models_searchable')
|
||||
if models_config && models_current != models_config
|
||||
Setting.set('models_searchable', models_current)
|
||||
if Setting.columns_hash.key?('state_current') # TODO: remove me later
|
||||
models_current = Models.searchable.map(&:to_s)
|
||||
models_config = Setting.get('models_searchable')
|
||||
if models_config && models_current != models_config
|
||||
Setting.set('models_searchable', models_current)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
#Zammad::Application.config.session_store :cookie_store, :key => '_zammad_session'
|
||||
#Rails.application.config.session_store :cookie_store, key: '_zammad_session'
|
||||
|
||||
# Use the database for sessions instead of the cookie-based default,
|
||||
# which shouldn't be used to store highly confidential information
|
||||
# (create the session table with "rails generate session_migration")
|
||||
Zammad::Application.config.session_store :active_record_store, {
|
||||
Rails.application.config.session_store :active_record_store, {
|
||||
key: '_zammad_session_' + Digest::MD5.hexdigest(Rails.root.to_s).to_s[5..15]
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
#
|
||||
|
||||
# This file contains settings for ActionController::ParamsWrapper which
|
||||
# is enabled by default.
|
||||
|
||||
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
||||
ActiveSupport.on_load(:action_controller) do
|
||||
wrap_parameters format: [:json]
|
||||
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
||||
end
|
||||
|
||||
# Disable root element in JSON by default.
|
||||
ActiveSupport.on_load(:active_record) do
|
||||
self.include_root_in_json = false
|
||||
end
|
||||
# To enable root element in JSON for ActiveRecord objects.
|
||||
# ActiveSupport.on_load(:active_record) do
|
||||
# self.include_root_in_json = true
|
||||
# end
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
Zammad::Application.routes.draw do
|
||||
Rails.application.routes.draw do
|
||||
|
||||
# app init
|
||||
match '/init', to: 'init#index', via: :get
|
||||
match '/app', to: 'init#index', via: :get
|
||||
|
||||
# You can have the root of your site routed with "root"
|
||||
# just remember to delete public/index.html.
|
||||
root to: 'init#index', via: :get
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ returns
|
|||
|
||||
# added configured backends
|
||||
Setting.where( area: 'Security::Authentication' ).each {|setting|
|
||||
if setting.state[:value]
|
||||
config.push setting.state[:value]
|
||||
if setting.state_current[:value]
|
||||
config.push setting.state_current[:value]
|
||||
end
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ class CalendarSubscriptions
|
|||
next if calendar_subscription.name !~ /\Adefaults_calendar_subscriptions_(.*)\z/
|
||||
|
||||
object_name = $1
|
||||
@preferences[ object_name ] = calendar_subscription.state[:value]
|
||||
@preferences[ object_name ] = calendar_subscription.state_current[:value]
|
||||
}
|
||||
|
||||
return if !@user.preferences[:calendar_subscriptions]
|
||||
|
|
|
@ -40,8 +40,8 @@ returns
|
|||
|
||||
# added configured backends
|
||||
Setting.where( area: 'Security::SSO' ).each {|setting|
|
||||
if setting.state[:value]
|
||||
config.push setting.state[:value]
|
||||
if setting.state_current[:value]
|
||||
config.push setting.state_current[:value]
|
||||
end
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue