Prepared for postgresql.
This commit is contained in:
parent
46cbfb8b28
commit
afe46d3570
7 changed files with 8 additions and 8 deletions
|
@ -10,7 +10,7 @@ class CalendarsController < ApplicationController
|
||||||
|
|
||||||
# calendars
|
# calendars
|
||||||
calendar_ids = []
|
calendar_ids = []
|
||||||
Calendar.all.order(:name).each {|calendar|
|
Calendar.all.order(:name, :created_at).each {|calendar|
|
||||||
calendar_ids.push calendar.id
|
calendar_ids.push calendar.id
|
||||||
assets = calendar.assets(assets)
|
assets = calendar.assets(assets)
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ curl http://localhost/api/v1/slas.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
# calendars
|
# calendars
|
||||||
calendar_ids = []
|
calendar_ids = []
|
||||||
Calendar.all.order(:name).each {|calendar|
|
Calendar.all.order(:name, :created_at).each {|calendar|
|
||||||
calendar_ids.push calendar.id
|
calendar_ids.push calendar.id
|
||||||
assets = calendar.assets(assets)
|
assets = calendar.assets(assets)
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ curl http://localhost/api/v1/slas.json -v -u #{login}:#{password}
|
||||||
# slas
|
# slas
|
||||||
sla_ids = []
|
sla_ids = []
|
||||||
models = Models.all
|
models = Models.all
|
||||||
Sla.all.order(:name).each {|sla|
|
Sla.all.order(:name, :created_at).each {|sla|
|
||||||
sla_ids.push sla.id
|
sla_ids.push sla.id
|
||||||
assets = sla.assets(assets)
|
assets = sla.assets(assets)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ module Channel::Filter::Database
|
||||||
def self.run( _channel, mail )
|
def self.run( _channel, mail )
|
||||||
|
|
||||||
# process postmaster filter
|
# process postmaster filter
|
||||||
filters = PostmasterFilter.where( active: true, channel: 'email' ).order(:name)
|
filters = PostmasterFilter.where( active: true, channel: 'email' ).order(:name, :created_at)
|
||||||
filters.each {|filter|
|
filters.each {|filter|
|
||||||
Rails.logger.info " proccess filter #{filter.name} ..."
|
Rails.logger.info " proccess filter #{filter.name} ..."
|
||||||
all_matches_ok = true
|
all_matches_ok = true
|
||||||
|
|
|
@ -5,7 +5,7 @@ class Locale < ApplicationModel
|
||||||
def self.to_sync
|
def self.to_sync
|
||||||
locales = Locale.where(active: true)
|
locales = Locale.where(active: true)
|
||||||
if Rails.env.test?
|
if Rails.env.test?
|
||||||
locales = Locale.where(active: true, locale: ['en-us', 'de-de'])
|
locales = Locale.where(active: true, locale: ['en-us'])
|
||||||
end
|
end
|
||||||
|
|
||||||
# read used locales based on env, e. g. export Z_LOCALES='en-us:de-de'
|
# read used locales based on env, e. g. export Z_LOCALES='en-us:de-de'
|
||||||
|
|
|
@ -207,7 +207,7 @@ returns
|
||||||
sla_selected = nil
|
sla_selected = nil
|
||||||
sla_list = Cache.get('SLA::List::Active')
|
sla_list = Cache.get('SLA::List::Active')
|
||||||
if sla_list.nil?
|
if sla_list.nil?
|
||||||
sla_list = Sla.all.order(:name)
|
sla_list = Sla.all.order(:name, :created_at)
|
||||||
Cache.write('SLA::List::Active', sla_list, { expires_in: 1.hour })
|
Cache.write('SLA::List::Active', sla_list, { expires_in: 1.hour })
|
||||||
end
|
end
|
||||||
sla_list.each {|sla|
|
sla_list.each {|sla|
|
||||||
|
|
|
@ -16,7 +16,7 @@ all:
|
||||||
|
|
||||||
dedicated:
|
dedicated:
|
||||||
|
|
||||||
Translation.load(locale) # e. g. en-us or de-de
|
Translation.load(locale) # e. g. 'en-us' or 'de-de'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ class String
|
||||||
# unfortunaly UTF8mb4 will raise other limitaions of max varchar and lower index sizes
|
# unfortunaly UTF8mb4 will raise other limitaions of max varchar and lower index sizes
|
||||||
# More details: http://pjambet.github.io/blog/emojis-and-mysql/
|
# More details: http://pjambet.github.io/blog/emojis-and-mysql/
|
||||||
def utf8_to_3bytesutf8
|
def utf8_to_3bytesutf8
|
||||||
return if ActiveRecord::Base.connection_config[:adapter] != 'mysql2'
|
return self if ActiveRecord::Base.connection_config[:adapter] != 'mysql2'
|
||||||
each_char.select {|c|
|
each_char.select {|c|
|
||||||
if c.bytes.count > 3
|
if c.bytes.count > 3
|
||||||
Rails.logger.warn "strip out 4 bytes utf8 chars '#{c}' of '#{self}'"
|
Rails.logger.warn "strip out 4 bytes utf8 chars '#{c}' of '#{self}'"
|
||||||
|
|
Loading…
Reference in a new issue