Project

General

Profile

« Previous | Next » 

Revision d9a2ebac

Added by Ohad Levy almost 12 years ago

  • ID d9a2ebac6e9ec0082e60265b794f54a29a1f7e65

[SQL optimizations] - many small optimizations

This is one of a few patches aim to improve Foreman performance
  • Bookmarks have only users, not usergroups
  • added caching to the settings table
  • removed notice message lookups (we are not really using those)
  • added caching to top bar (tabs + bookmarks) and expiry.
  • removed non needed JS to load

View differences:

test/unit/setting_test.rb
require 'test_helper'
class SettingTest < ActiveSupport::TestCase
def setup
Setting.cache.clear
end
# commenting out due a failure in our CI
# def test_settings_should_save_complex_types
# assert (Setting.create(:name => "foo", :value => [1,2,3,'b'], :default => ['b',"b"], :description => "test foo" ))
......
end
def test_boolean_values_should_have_setting_type_for_false
assert Setting.create(:name => "oo", :default => false, :description => "test foo")
assert Setting.create!(:name => "oo", :default => false, :description => "test foo")
assert_equal "boolean", Setting.find_by_name("oo").settings_type
assert_equal false, Setting["oo"]
end

Also available in: Unified diff