CHANGELOG.md 6.8 KB
Newer Older
1 2 3 4
*   Remove redundant suffixes on generated helpers.

    *Gannon McGibbon*

5 6 7 8
*   Remove redundant suffixes on generated integration tests.

    *Gannon McGibbon*

9 10 11 12
*   Fix boolean interaction in scaffold system tests.

    *Gannon McGibbon*

13 14 15 16
*   Remove redundant suffixes on generated system tests.

    *Gannon McGibbon*

17 18 19 20 21 22
*   Add an `abort_on_failure` boolean option to the generator method that shell
    out (`generate`, `rake`, `rails_command`) to abort the generator if the
    command fails.

    *David Rodríguez*

23 24 25 26
*   Remove `app/assets` and `app/javascript` from `eager_load_paths` and `autoload_paths`.

    *Gannon McGibbon*

27 28 29 30 31 32
*   Add JSON support to rails properties route (`/rails/info/properties`).

    Now, `Rails::Info` properties may be accessed in JSON format at `/rails/info/properties.json`.

    *Yoshiyuki Hirano*

33 34
*   Use Ids instead of memory addresses when displaying references in scaffold views.

35 36 37 38
    Fixes #29200.

    *Rasesh Patel*

39 40 41 42 43
*   Adds support for multiple databases to `rails db:migrate:status`.
    Subtasks are also added to get the status of individual databases (eg. `rails db:migrate:status:animals`).

    *Gannon McGibbon*

44 45 46 47 48 49 50 51
*   Use Webpacker by default to manage app-level JavaScript through the new app/javascript directory.
    Sprockets is now solely in charge, by default, of compiling CSS and other static assets.
    Action Cable channel generators will create ES6 stubs rather than use CoffeeScript.
    Active Storage, Action Cable, Turbolinks, and Rails-UJS are loaded by a new application.js pack.
    Generators no longer generate JavaScript stubs.

    *DHH*, *Lachlan Sylvester*

52 53 54
*   Add `database` (aliased as `db`) option to model generator to allow
    setting the database. This is useful for applications that use
    multiple databases and put migrations per database in their own directories.
55 56

    ```
57
    bin/rails g model Room capacity:integer --database=kingston
58 59 60 61 62
          invoke  active_record
          create    db/kingston_migrate/20180830151055_create_rooms.rb
    ```

    Because rails scaffolding uses the model generator, you can
63
    also specify a database with the scaffold generator.
64 65 66

    *Gannon McGibbon*

67
*   Raise an error when "recyclable cache keys" are being used by a cache store
68 69 70
    that does not explicitly support it. Custom cache keys that do support this feature
    can bypass this error by implementing the `supports_cache_versioning?` method on their
    class and returning a truthy value.
71 72 73

    *Richard Schneeman*

74 75 76
*   Support environment specific credentials file.

    For `production` environment look first for `config/credentials/production.yml.enc` file that can be decrypted by
77
    `ENV["RAILS_MASTER_KEY"]` or `config/credentials/production.key` master key.
78 79 80 81 82
    Edit given environment credentials file by command `rails credentials:edit --environment production`.
    Default paths can be overwritten by setting `config.credentials.content_path` and `config.credentials.key_path`.

    *Wojciech Wnętrzak*

83
*   Make `ActiveSupport::Cache::NullStore` the default cache store in the test environment.
84 85 86

    *Michael C. Nelson*

87 88 89 90
*   Emit warning for unknown inflection rule when generating model.

    *Yoshiyuki Kinjo*

91
*   Add `database` (aliased as `db`) option to migration generator.
92 93 94

    If you're using multiple databases and have a folder for each database
    for migrations (ex db/migrate and db/new_db_migrate) you can now pass the
95
    `--database` option to the generator to make sure the the migration
96 97 98
    is inserted into the correct folder.

    ```
99
    rails g migration CreateHouses --database=kingston
100 101 102 103 104 105
      invoke  active_record
      create    db/kingston_migrate/20180830151055_create_houses.rb
    ```

    *Eileen M. Uchitelle*

106 107 108 109
*   Deprecate `rake routes` in favor of `rails routes`.

    *Yuji Yaginuma*

110 111 112 113
*   Deprecate `rake initializers` in favor of `rails initializers`.

    *Annie-Claude Côté*

114 115 116 117
*   Deprecate `rake dev:cache` in favor of `rails dev:cache`.

    *Annie-Claude Côté*

118 119 120
*   Deprecate `rails notes` subcommands in favor of passing an `annotations` argument to `rails notes`.

    The following subcommands are replaced by passing `--annotations` or `-a` to `rails notes`:
121 122 123 124
    - `rails notes:custom ANNOTATION=custom` is deprecated in favor of using `rails notes -a custom`.
    - `rails notes:optimize` is deprecated in favor of using `rails notes -a OPTIMIZE`.
    - `rails notes:todo` is deprecated in favor of  using`rails notes -a TODO`.
    - `rails notes:fixme` is deprecated in favor of using `rails notes -a FIXME`.
125 126 127 128 129 130 131 132 133 134 135 136

    *Annie-Claude Côté*

*   Deprecate `SOURCE_ANNOTATION_DIRECTORIES` environment variable used by `rails notes`
    through `Rails::SourceAnnotationExtractor::Annotation` in favor of using `config.annotations.register_directories`.

    *Annie-Claude Côté*

*   Deprecate `rake notes` in favor of `rails notes`.

    *Annie-Claude Côté*

R
Ryuta Kamizono 已提交
137
*   Don't generate unused files in `app:update` task.
138

R
Ryuta Kamizono 已提交
139
    Skip the assets' initializer when sprockets isn't loaded.
140

R
Ryuta Kamizono 已提交
141
    Skip `config/spring.rb` when spring isn't loaded.
142

R
Ryuta Kamizono 已提交
143
    Skip yarn's contents when yarn integration isn't used.
144

145 146
    *Tsukuru Tanimichi*

147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
*   Make the master.key file read-only for the owner upon generation on
    POSIX-compliant systems.

    Previously:

        $ ls -l config/master.key
        -rw-r--r--   1 owner  group      32 Jan 1 00:00 master.key

    Now:

        $ ls -l config/master.key
        -rw-------   1 owner  group      32 Jan 1 00:00 master.key

    Fixes #32604.

    *Jose Luis Duran*

164 165 166 167 168 169 170 171
*   Deprecate support for using the `HOST` environment to specify the server IP.

    The `BINDING` environment should be used instead.

    Fixes #29516.

    *Yuji Yaginuma*

172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
*   Deprecate passing Rack server name as a regular argument to `rails server`.

    Previously:

        $ bin/rails server thin

    There wasn't an explicit option for the Rack server to use, now we have the
    `--using` option with the `-u` short switch.

    Now:

        $ bin/rails server -u thin

    This change also improves the error message if a missing or mistyped rack
    server is given.

    *Genadi Samokovarov*

190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
*   Add "rails routes --expanded" option to output routes in expanded mode like
    "psql --expanded". Result looks like:

    ```
    $ rails routes --expanded
    --[ Route 1 ]------------------------------------------------------------
    Prefix            | high_scores
    Verb              | GET
    URI               | /high_scores(.:format)
    Controller#Action | high_scores#index
    --[ Route 2 ]------------------------------------------------------------
    Prefix            | new_high_score
    Verb              | GET
    URI               | /high_scores/new(.:format)
    Controller#Action | high_scores#new
    ```

    *Benoit Tigeot*

J
Jeremy Daer 已提交
209 210 211 212 213
*   Rails 6 requires Ruby 2.4.1 or newer.

    *Jeremy Daer*


214
Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/railties/CHANGELOG.md) for previous changes.