Skip to content
Snippets Groups Projects
  1. Mar 22, 2020
  2. Sep 13, 2019
  3. Mar 19, 2019
    • Lin Jen-Shin's avatar
      Introduce ApplicationSettingImplementation yay · 6b0d4933
      Lin Jen-Shin authored
      So the fake can enjoy it, too. We don't use `prepend`
      because that'll require we change `allow_any_instance_of` to
      `expect_next_instance_of`, but that's not very easy to do.
      We can do that later.
      6b0d4933
  4. Dec 19, 2018
  5. Oct 22, 2018
  6. Sep 11, 2018
  7. Sep 10, 2018
    • Stan Hu's avatar
      Work around migration specs failing due to repository storages not being selected · 183c94dd
      Stan Hu authored
      Migration specs may be missing a column necessary to create an ApplicationSetting
      object, which causes the FakeApplicationSetting to be initialized. However, the
      project selects a random repository storage via ApplicationSetting#pick_repository_storage,
      which isn't present in the OpenStruct.
      
      To workaround this issues, we add a pick_repository_storage method in
      FakeApplicationSetting.
      183c94dd
  8. Jun 19, 2017
    • Stan Hu's avatar
      If migrations are pending, make CurrentSettings use existing values and... · 575dced5
      Stan Hu authored
      If migrations are pending, make CurrentSettings use existing values and populate missing columns with defaults
      
      master was failing because `ApplicationSetting.create_from_defaults` attempted
      to write to a column that did not exist in the database. This occurred in a
      `rake db:migrate` task, which was unable to perform the migration that would
      have added the missing column in the first place.
      
      In 9.3 RC2, we also had a bug where password sign-ins were disabled because
      there were many pending migrations. The problem occurred because
      `fake_application_settings` was being returned with an OpenStruct that did not
      include the predicate method `signup_enabled?`. As a result, the value would
      erroneously return `nil` instead of `true`. This commit uses the values of the
      defaults to mimic this behavior.
      
      This commit also refactors some of the logic to be clearer.
      575dced5
Loading