1. 12 9月, 2018 1 次提交
    • E
      Fix query cache to load before first request · 349db176
      Eileen Uchitelle 提交于
      In a test app we observed that the query cache was not enabled on the
      first request. This was because the query cache hooks are installed on
      load and active record is loaded in the middle of the first request.
      
      If we remove the `on_load` from the railtie the query cache hooks will
      be installed before the first request, allowing the cache to be enabled
      on that first request.
      
      This is ok because query cache doesn't load anything else, only itself
      so we're not eager loading all of active record before the first
      request, just the query cache hooks.
      
      [Eileen M. Uchitelle & Matthew Draper]
      349db176
  2. 25 2月, 2018 1 次提交
    • E
      Use lazy load hook to configure ActiveStorage::Blob · eb834811
      Eugene Kenny 提交于
      `to_prepare` callbacks are run during initialization; using one here
      meant that `ActiveStorage::Blob` would be loaded when the app boots,
      which would in turn load `ActiveRecord::Base`.
      
      By using a lazy load hook to configure `ActiveStorage::Blob` instead,
      we can avoid loading `ActiveRecord::Base` unnecessarily.
      eb834811
  3. 26 1月, 2018 1 次提交
  4. 09 10月, 2017 1 次提交
  5. 15 8月, 2017 1 次提交
  6. 04 8月, 2017 3 次提交
  7. 02 7月, 2017 1 次提交
  8. 01 7月, 2017 1 次提交
  9. 23 12月, 2016 1 次提交
  10. 16 8月, 2016 1 次提交
  11. 07 8月, 2016 2 次提交
  12. 04 7月, 2016 1 次提交
  13. 23 2月, 2016 1 次提交
  14. 08 1月, 2016 1 次提交
    • S
      Prevent destructive action on production database · 900bfd94
      schneems 提交于
      This PR introduces a key/value type store to Active Record that can be used for storing internal values. It is an alternative implementation to #21237 cc @sgrif @matthewd.
      
      It is possible to run your tests against your production database by accident right now. While infrequently, but as an anecdotal data point, Heroku receives a non-trivial number of requests for a database restore due to this happening. In these cases the loss can be large.
      
      To prevent against running tests against production we can store the "environment" version that was used when migrating the database in a new internal table. Before executing tests we can see if the database is a listed in `protected_environments` and abort. There is a manual escape valve to force this check from happening with environment variable `DISABLE_DATABASE_ENVIRONMENT_CHECK=1`.
      900bfd94
  15. 15 12月, 2015 1 次提交
  16. 03 12月, 2015 1 次提交
    • M
      Fix failing test using custom file watcher · c3668c39
      Matthew Erhard 提交于
      LoadingTest#test_does_not_reload_constants_on_development_if_custom_file_watcher_always_returns_false in railties/test/application/loading_test.rb is failing with: `NoMethodError: undefined method 'execute' for #<#<Class:0x00000002465a30>:0x00000001f79698>`
      
      The test creates an anonymous class to be used as a custom file watcher using `config.file_watcher=`. Per the Rails guides for Configuring, the class set to `config.file_watcher` “Must conform to ActiveSupport::FileUpdateChecker API”. Per the docs for ActiveSupport::FileUpdateChecker, the API depends on four methods: #initialize, #updated?, #execute, and #execute_if_updated. The custom file watcher in the failing test only implements the first two methods.
      
      This pull request adds #execute and #execute_if_updated to the custom file_watcher, conforming it to the ActiveSupport::FileUpdateChecker API, and passing the test.
      c3668c39
  17. 05 5月, 2015 1 次提交
  18. 27 12月, 2014 1 次提交
  19. 02 7月, 2013 1 次提交
  20. 11 6月, 2013 1 次提交
  21. 07 6月, 2013 1 次提交
  22. 04 6月, 2013 1 次提交
  23. 15 10月, 2012 1 次提交
  24. 17 9月, 2012 1 次提交
  25. 25 4月, 2012 1 次提交
    • J
      Remove default match without specified method · 56cdc81c
      Jose and Yehuda 提交于
      In the current router DSL, using the +match+ DSL
      method will match all verbs for the path to the
      specified endpoint.
      
      In the vast majority of cases, people are
      currently using +match+ when they actually mean
      +get+. This introduces security implications.
      
      This commit disallows calling +match+ without
      an HTTP verb constraint by default. To explicitly
      match all verbs, this commit also adds a
      :via => :all option to +match+.
      
      Closes #5964
      56cdc81c
  26. 28 3月, 2012 1 次提交
  27. 15 3月, 2012 1 次提交
  28. 05 3月, 2012 1 次提交
  29. 15 1月, 2012 1 次提交
    • P
      Fix railties tests · f9f0f038
      Piotr Sarnacki 提交于
      SchemaMigration model is loaded on rails initialization,
      which means that it will not be cleaned on each request.
      f9f0f038
  30. 06 1月, 2012 1 次提交
  31. 16 12月, 2011 1 次提交
  32. 13 12月, 2011 3 次提交
  33. 06 6月, 2011 2 次提交
  34. 05 9月, 2010 1 次提交