1. 13 2月, 2018 1 次提交
  2. 12 2月, 2018 1 次提交
    • C
      Respect --force option for config/master.key · 24284fd3
      claudiob 提交于
      This is similar to #30700 which ensures the `--quiet` option of `rails new`
      is respected by the `MasterKeyGenerator` (missing from #30067).
      
      Before this commit, running `rails new app --force` would still prompt the
      user what to do with the conflict in `config/master.key`:
      
      ```
                    …
         identical  config/locales/en.yml
          conflict  config/master.key
      Overwrite /Users/claudiob/Desktop/pizza/config/master.key? (enter "h" for help) [Ynaqdh]
      ```
      
      After this commit, `config/master.key` is overwritten:
      
      ```
                 …
      identical  config/locales/en.yml
          force  config/master.key
         append  .gitignore
      ```
      
      The newly added test generates an app and then generates it again with
      `--force`. Without this commit, the test would just wait forever for user
      input.
      24284fd3
  3. 08 2月, 2018 1 次提交
  4. 31 1月, 2018 1 次提交
  5. 26 1月, 2018 5 次提交
  6. 19 1月, 2018 2 次提交
    • H
      Add locale selector to email preview (#31596) · 5fe603ac
      Hitoshi Nakashima 提交于
      - Add set_locale to detect suitable locale
      - Make feature compatible with Rails 5.x
      5fe603ac
    • E
      Add test to properly test down with a block · e0ad907a
      eileencodes 提交于
      down is only called with a block from the rake tasks where it passes a
      `SCOPE`. Technically this was tested but since we don't run all the
      migrations we're not actually testing the down works with a `SCOPE`. To
      ensure we're testing both we can run `db:migrate` again to migrate users
      and then run `down` with a scope to test that only the bukkits migration
      is reverted.
      
      Updates test to prevent having to fix regressions like we did in
      4d4db4c8.
      e0ad907a
  7. 18 1月, 2018 1 次提交
    • E
      Refactor migration to move migrations paths to connection · a2827ec9
      eileencodes 提交于
      Rails has some support for multiple databases but it can be hard to
      handle migrations with those. The easiest way to implement multiple
      databases is to contain migrations into their own folder ("db/migrate"
      for the primary db and "db/seconddb_migrate" for the second db). Without
      this you would need to write code that allowed you to switch connections
      in migrations. I can tell you from experience that is not a fun way to
      implement multiple databases.
      
      This refactoring is a pre-requisite for implementing other features
      related to parallel testing and improved handling for multiple
      databases.
      
      The refactoring here moves the class methods from the `Migrator` class
      into it's own new class `MigrationContext`. The goal was to move the
      `migrations_paths` method off of the `Migrator` class and onto the
      connection. This allows users to do the following in their
      `database.yml`:
      
      ```
      development:
        adapter: mysql2
        username: root
        password:
      
      development_seconddb:
        adapter: mysql2
        username: root
        password:
        migrations_paths: "db/second_db_migrate"
      ```
      
      Migrations for the `seconddb` can now be store in the
      `db/second_db_migrate` directory. Migrations for the primary database
      are stored in `db/migrate`".
      
      The refactoring here drastically reduces the internal API for migrations
      since we don't need to pass `migrations_paths` around to every single
      method. Additionally this change does not require any Rails applications
      to make changes unless they want to use the new public API. All of the
      class methods from the `Migrator` class were `nodoc`'d except for the
      `migrations_paths` and `migrations_path` getter/setters respectively.
      a2827ec9
  8. 11 1月, 2018 1 次提交
  9. 10 1月, 2018 1 次提交
    • B
      Clean up railties tests · b6ed9a7f
      bogdanvlviv 提交于
        Remove `AppGeneratorTest#test_active_storage_install`.
        The test is added by 67db41aa,
        since #31534 this test doesn't test anything.
      
        Remove redundant assertions in `SharedGeneratorTests`.
        These assertions is added by 4a835aa3.
        Follows 67db41aa, #31534.
      b6ed9a7f
  10. 09 1月, 2018 1 次提交
  11. 08 1月, 2018 1 次提交
  12. 07 1月, 2018 1 次提交
  13. 03 1月, 2018 2 次提交
  14. 28 12月, 2017 1 次提交
  15. 26 12月, 2017 1 次提交
  16. 25 12月, 2017 1 次提交
  17. 24 12月, 2017 1 次提交
  18. 20 12月, 2017 2 次提交
  19. 19 12月, 2017 1 次提交
  20. 18 12月, 2017 1 次提交
  21. 17 12月, 2017 1 次提交
  22. 16 12月, 2017 1 次提交
    • Y
      Add `skip_bootsnap` option · 838b40da
      yuuji.yaginuma 提交于
      `bootsnap` is a useful gem normally. However, `bootsnap` is unnecessary
      when generating a Rails application to be used only for testing.
      So I want to control whether use this or not by option.
      838b40da
  23. 15 12月, 2017 1 次提交
  24. 14 12月, 2017 3 次提交
    • R
      Enable `Layout/LeadingCommentSpace` to not allow cosmetic changes in the future · 245c1daf
      Ryuta Kamizono 提交于
      Follow up of #31432.
      245c1daf
    • O
      Log call site for all queries · 3876defd
      Olivier Lacan 提交于
      This new ActiveRecord configuration option allows you to easily
      pinpoint what line of application code is triggering SQL queries in the
      development log by appending below each SQL statement log the line of
      Ruby code that triggered it.
      
      It’s useful with N+1 issues, and to locate stray queries.
      
      By default this new option ignores Rails and Ruby code in order to
      surface only callers from your application Ruby code or your gems.
      
      It is enabled on newly generated Rails 5.2 applications and can be
      enabled on existing Rails applications:
      
      ```ruby
      Rails.application.configure do
        # ...
        config.active_record.verbose_query_logs = true
      end
      ```
      
      The `rails app:upgrade` task will also add it to
      `config/development.rb`.
      
      This feature purposely avoids coupling with
      ActiveSupport::BacktraceCleaner since ActiveRecord can be used without
      ActiveRecord. This decision can be reverted in the future to allow more
      configurable backtraces (the exclusion of gem callers for example).
      3876defd
    • M
      Expose Active Storage routes · ff25c251
      Mehmet Emin INAC 提交于
      ff25c251
  25. 12 12月, 2017 1 次提交
  26. 09 12月, 2017 2 次提交
    • A
      Set the Rails environment from an environment variable · a50b8ea3
      Aaron Patterson 提交于
      Option parsing happens too late to have any impact on the Rails
      environment.  Rails accesses the environment name and memoizes it too
      early in the boot process for a commandline option to have any impact on
      the database connection, so we'll change this test to set the
      environment from an environment variable (and ensure it still works when
      running tests with `ruby`)
      a50b8ea3
    • A
      Add failing test for wrong database connection · a58543db
      Aaron Patterson 提交于
      When tests are run with just `ruby`, the RAILS_ENV is set to
      `development` too early, and we connect to the development database
      rather than the test database.
      a58543db
  27. 07 12月, 2017 1 次提交
    • A
      Fix Rails environment when running tests with Ruby · da225c0d
      Aaron Patterson 提交于
      I frequently run tests with `ruby`, not with a runner like `rake` or
      `rails`.  When running the test with just `ruby` the `RAILS_ENV`
      environment variable did not get set to "test", and this would cause the
      tests to fail (and even mutate the development database!)
      
      This commit adds integration tests for running tests with just `ruby`
      and ensures the environment gets defaulted to "test".  I also added a
      test to ensure that passing an environment to `-e` actually works (and
      fixed that case too).
      
      An interesting / annoying thing is that Minitest picks up it's plugins
      by asking RubyGems for a list of files:
      
        https://github.com/seattlerb/minitest/blob/ca6a71ca901016db09a5ad466b4adea4b52a504a/lib/minitest.rb#L92-L100
      
      This means that RubyGems needs to somehow know about the file before it
      can return it to Minitest.  Since we are not packaging Rails as a Gem
      before running the integration tests on it (duh, why would you do
      that?), RubyGems doesn't know about the file, so it can't tell Minitest,
      so Minitest doesn't automatically require it.  This means I had to
      manually require and insert the plugin in our integration test.  I've
      left comments about that in the test as well.
      
      Ugh.
      da225c0d
  28. 05 12月, 2017 2 次提交
  29. 04 12月, 2017 1 次提交