Prepared for postgresql.

This commit is contained in:
Martin Edenhofer 2016-01-19 07:58:58 +01:00
parent 46cbfb8b28
commit afe46d3570
7 changed files with 8 additions and 8 deletions

View file

@ -10,7 +10,7 @@ class CalendarsController < ApplicationController
# calendars
calendar_ids = []
Calendar.all.order(:name).each {|calendar|
Calendar.all.order(:name, :created_at).each {|calendar|
calendar_ids.push calendar.id
assets = calendar.assets(assets)
}

View file

@ -53,7 +53,7 @@ curl http://localhost/api/v1/slas.json -v -u #{login}:#{password}
# calendars
calendar_ids = []
Calendar.all.order(:name).each {|calendar|
Calendar.all.order(:name, :created_at).each {|calendar|
calendar_ids.push calendar.id
assets = calendar.assets(assets)
}
@ -61,7 +61,7 @@ curl http://localhost/api/v1/slas.json -v -u #{login}:#{password}
# slas
sla_ids = []
models = Models.all
Sla.all.order(:name).each {|sla|
Sla.all.order(:name, :created_at).each {|sla|
sla_ids.push sla.id
assets = sla.assets(assets)

View file

@ -6,7 +6,7 @@ module Channel::Filter::Database
def self.run( _channel, mail )
# 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|
Rails.logger.info " proccess filter #{filter.name} ..."
all_matches_ok = true

View file

@ -5,7 +5,7 @@ class Locale < ApplicationModel
def self.to_sync
locales = Locale.where(active: true)
if Rails.env.test?
locales = Locale.where(active: true, locale: ['en-us', 'de-de'])
locales = Locale.where(active: true, locale: ['en-us'])
end
# read used locales based on env, e. g. export Z_LOCALES='en-us:de-de'

View file

@ -207,7 +207,7 @@ returns
sla_selected = nil
sla_list = Cache.get('SLA::List::Active')
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 })
end
sla_list.each {|sla|

View file

@ -16,7 +16,7 @@ all:
dedicated:
Translation.load(locale) # e. g. en-us or de-de
Translation.load(locale) # e. g. 'en-us' or 'de-de'
=end

View file

@ -57,7 +57,7 @@ class String
# unfortunaly UTF8mb4 will raise other limitaions of max varchar and lower index sizes
# More details: http://pjambet.github.io/blog/emojis-and-mysql/
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|
if c.bytes.count > 3
Rails.logger.warn "strip out 4 bytes utf8 chars '#{c}' of '#{self}'"