1. 09 3月, 2019 1 次提交
  2. 08 3月, 2019 2 次提交
  3. 06 3月, 2019 1 次提交
    • E
      Load YAML for rake tasks without parsing ERB · 37d1429a
      eileencodes 提交于
      This change adds a new method that loads the YAML for the database
      config without parsing the ERB. This may seem odd but bear with me:
      
      When we added the ability to have rake tasks for multiple databases we
      started looping through the configurations to collect the namespaces so
      we could do `rake db:create:my_second_db`. See #32274.
      
      This caused a problem where if you had `Rails.config.max_threads` set in
      your database.yml it will blow up because the environment that defines
      `max_threads` isn't loaded during `rake -T`. See #35468.
      
      We tried to fix this by adding the ability to just load the YAML and
      ignore ERB all together but that caused a bug in GitHub's YAML loading
      where if you used multi-line ERB the YAML was invalid. That led us to
      reverting some changes in #33748.
      
      After trying to resolve this a bunch of ways `@tenderlove` came up with
      replacing the ERB values so that we don't need to load the environment
      but we also can load the YAML.
      
      This change adds a DummyCompiler for ERB that will replace all the
      values so we can load the database yaml and create the rake tasks.
      Nothing else uses this method so it's "safe".
      
      DO NOT use this method in your application.
      
      Fixes #35468
      37d1429a
  4. 05 3月, 2019 1 次提交
  5. 04 3月, 2019 2 次提交
  6. 26 2月, 2019 2 次提交
  7. 24 2月, 2019 2 次提交
  8. 22 2月, 2019 2 次提交
  9. 21 2月, 2019 2 次提交
  10. 20 2月, 2019 1 次提交
  11. 17 2月, 2019 1 次提交
    • Y
      Auto correct rubocop offenses · ed3f3159
      Yoshiyuki Hirano 提交于
      Offenses:
      
      railties/lib/rails/autoloaders.rb:1:1: C: [Corrected] Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
      module Rails
      ^
      actionmailer/test/base_test.rb:917:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning.
      actionmailer/test/base_test.rb:917:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      actionmailer/test/base_test.rb:917:5: C: [Corrected] Style/RedundantBegin: Redundant begin block detected.
          begin
          ^^^^^
      actionmailer/test/base_test.rb:918:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not 4) spaces for indentation.
            events = []
        ^^^^
      actionmailer/test/base_test.rb:930:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.
      actionmailer/test/base_test.rb:930:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      ed3f3159
  12. 16 2月, 2019 1 次提交
  13. 15 2月, 2019 1 次提交
    • X
      Replace autoloader accessors with Rails.autoloaders.{main,once} · 87037791
      Xavier Noria 提交于
      Rails.autoloader and Rails.once_autoloader was just tentative API good
      enough for a first patch. Rails.autoloader is singular and does not
      convey in its name that there is another autoloader. That might be
      confusing, for example if you set a logger and miss traces. On the other
      hand, the name `once_autoloader` is very close to being horrible.
      
      Rails.autoloaders.main and Rails.autoloaders.once read better for my
      taste, and have a nice symmetry. Also, both "main" and "once" are four
      letters long, short and same length.
      
      They are tagged as "rails.main" and "rails.once", respectively.
      
      References #35235.
      87037791
  14. 14 2月, 2019 2 次提交
    • E
      Fix the `config_for` to always return a NonSymbolAccessDeprecatedHash: · 4f7231da
      Edouard CHIN 提交于
      - If you have hashes inside array, the hashes were getting initialized
        as regular HWIA wereas we want them to be
        NonSymbolAccessDeprecatedHash in order to trigger a deprecation
        warning when keys are accessed with string.
      
        This patch fixes that by overwriting the `[]=` to to the same
        as what HWIA does (with the difference that we don't call
        `convert_key` to not trigger a deprecation when setting value).
      
        I also took the liberty to extract `hash.nested_under_indifferent_access`,
        into a separate method to allow subclasses to return whatever
        they want.
        Inheriting HWIA is not common, but I think it's useful for cases
        like this one where we want to preprocess reading and writing values
        in the hash (for deprecation purposes or other reasons).
      4f7231da
    • X
      Let Zeitwerk be a dependency of Active Support · c36b6c8d
      Xavier Noria 提交于
      Zeitwerk is a strong dependency, planned to replace AS::Dependencies. A
      line in the generated Gemfile does not convey this as much.
      c36b6c8d
  15. 12 2月, 2019 6 次提交
    • X
      style · 96de00e5
      Xavier Noria 提交于
      96de00e5
    • X
      Zeitwerk integration · 821d6c69
      Xavier Noria 提交于
      821d6c69
    • Y
      Add missing packages (#35227) · ad3cbc24
      Yuji Yaginuma 提交于
      If generate application without specified options,`actioncable` and
      `activestorage` loads by default.
      ad3cbc24
    • U
      Fix assertion excpected/actual order · de96628c
      Ufuk Kayserilioglu 提交于
      The assertion from the previous PR had the expected and the actual
      values in the wrong order, so when a test failed the error message was
      confusing.
      
      This commit fixes the problem by switching the order.
      de96628c
    • U
      Allow deprecated non-symbol access to nested `config_for` hashes · 325e917f
      Ufuk Kayserilioglu 提交于
      A change to `Rails::Application.config_for` in
      https://github.com/rails/rails/pull/33815 and
      https://github.com/rails/rails/pull/33882 has altered the behaviour of
      the returned object in a breaking manner. Before that change, nested
      hashes returned from `config_for` could be accessed using non-symbol keys.
      After the change, all keys are recursively symbolized so non-symbol access
      fails to read the expected values.
      
      This is a breaking change for any app that might be relying on the
      nested hashes returned from `config_for` calls, and thus should be
      deprecated before being removed from the codebase.
      
      This commit introduces a temporary `NonSymbolAccessDeprecatedHash` class
      that recursively wraps any nested hashes inside the `OrderedOptions`
      object returned from `config_for` and issues a deprecation notice when a
      non-symbol based access is performed.
      
      This way, apps that are still relying on the ability to access these
      nested hashes using non-symbol keys will be able to observe the
      deprecation notices and have time to implement changes before non-symbol
      access is removed for good.
      
      A CHANGELOG entry is also added to note that non-symbol access to nested
      `config_for` hashes is deprecated.
      325e917f
    • A
      Optimized namespaces_to_paths method. · 3bd03663
      alkesh26 提交于
      3bd03663
  16. 11 2月, 2019 2 次提交
    • Y
      Install JavaScript packages before run test · cd34f006
      yuuji.yaginuma 提交于
      Some tests are running yarn install during the test.
      The directory used for isolation test is not subject to yarn workspace,
      and it occurs because the required package is not installed.
      In order to avoid this, I fixed all necessary packages to be installed
      before run test and use symlink to `node_modules`.
      
      This is a bit complicated, as `yarn install` needs to be run in a specific
      directory before running the test.
      However, running `yarn install` every time run the test is expensive
      when testing locally and should be avoided.
      cd34f006
    • Y
      Revert "Merge pull request #35211 from y-yagi/fix_broken_association_test" (#35217) · 9099d66b
      Yuji Yaginuma 提交于
      This reverts commit 38f9e41f, reversing
      changes made to 5e493c3b.
      
      Reason: The ajv@6.9.1 was released that fixes issue.
      9099d66b
  17. 10 2月, 2019 1 次提交
  18. 09 2月, 2019 1 次提交
  19. 08 2月, 2019 1 次提交
  20. 07 2月, 2019 2 次提交
  21. 06 2月, 2019 3 次提交
  22. 05 2月, 2019 1 次提交
  23. 03 2月, 2019 1 次提交
    • G
      Cleanup the whitelisting references after #33145 · ca62dfee
      Genadi Samokovarov 提交于
      During the development of #33145, I have named a few concepts in the
      code as `whitelisted`. We decided to stay away from the term and I
      adjusted most of the code afterwards, but here are the cases I forgot to
      change.
      
      I also found a case in the API guide that we could have cleaned up as
      well.
      
      [ci skip]
      ca62dfee
  24. 01 2月, 2019 1 次提交