CHANGELOG.md 9.5 KB
Newer Older
S
Santiago Pastorino 已提交
1 2
## Rails 4.0.0 (unreleased) ##

3 4 5 6
*   Add --no-rc option to skip the loading of railsrc file during the generation of a new app.
    
    *Amparo Luna*

7 8 9 10 11
*   Fixes database.yml when creating a new rails application with '.'
    Fix #8304

    *Jeremy W. Rowe*

12 13 14 15 16 17 18 19 20
*   Deprecate the `eager_load_paths` configuration and alias it to `autoload_paths`.
    Since the default in Rails 4.0 is to run in 'threadsafe' mode we need to eager
    load all of the paths in `autoload_paths`. This may have unintended consequences
    if you have added 'lib' to `autoload_paths` such as loading unneeded code or
    code intended only for development and/or test environments. If this applies to
    your application you should thoroughly check what is being eager loaded.

    *Andrew White*

21 22 23 24 25 26
*   Restore Rails::Engine::Railties#engines with deprecation to ensure
    compatibility with gems such as Thinking Sphinx
    Fix #8551

    *Tim Raymond*

27 28 29 30 31
*   Specify which logs to clear when using the `rake log:clear` task.
    (e.g. rake log:clear LOGS=test,staging)

    *Matt Bridges*

32 33 34 35 36 37
*   Allow a `:dirs` key in the `SourceAnnotationExtractor.enumerate` options
    to explicitly set the directories to be traversed so it's easier to define
    custom rake tasks.

    *Brian D. Burns*

38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
*   Deprecate `Rails::Generators::ActiveModel#update_attributes` in favor of `#update`.

    ORMs that implement `Generators::ActiveModel#update_attributes` should change
    to `#update`. Scaffold controller generators should change calls like:

        @orm_instance.update_attributes(...)

    to:

        @orm_instance.update(...)

    This goes along with the addition of `ActiveRecord::Base#update`.

    *Carlos Antonio da Silva*

53 54 55 56 57 58 59 60 61
*   Include `jbuilder` by default and rely on its scaffold generator to show json API.
    Check https://github.com/rails/jbuilder for more info and examples.

    *DHH*

*   Scaffold now generates HTML-only controller by default.

    *DHH + Pavel Pravosud*

X
Xavier Noria 已提交
62 63 64 65 66
*   The generated `README.rdoc` for new applications invites the user to
    document the necessary steps to get the application up and running.

    *Xavier Noria*

67 68 69 70 71 72
*   Generated applications no longer get `doc/README_FOR_APP`. In consequence,
    the `doc` directory is created on demand by documentation tasks rather than
    generated by default.

    *Xavier Noria*

73 74 75 76 77 78 79 80 81 82 83 84 85 86
*   App executables now live in the `bin/` directory: `bin/bundle`,
    `bin/rails`, `bin/rake`. Run `rake rails:update:bin` to add these
    executables to your own app. `script/rails` is gone from new apps.

    Running executables within your app ensures they use your app's Ruby
    version and its bundled gems, and it ensures your production deployment
    tools only need to execute a single script. No more having to carefully
    `cd` to the app dir and run `bundle exec ...`.

    Rather than treating `bin/` as a junk drawer for generated "binstubs",
    bundler 1.3 adds support for generating stubs for just the executables
    you actually use: `bundle binstubs unicorn` generates `bin/unicorn`.
    Add that executable to git and version it just like any other app code.

J
Jeremy Kemper 已提交
87 88
    *Jeremy Kemper*

89
*   `config.assets.enabled` is now true by default. If you're upgrading from a Rails 3.x app
90
    that does not use the asset pipeline, you'll be required to add `config.assets.enabled = false`
91 92
    to your application.rb. If you don't want the asset pipeline on a new app use `--skip-sprockets`

93 94
    *DHH*

95 96 97
*   Environment name can be a start substring of the default environment names
    (production, development, test). For example: tes, pro, prod, dev, devel.
    Fix #8628.
98

99
    *Mykola Kyryk*
100

101
*   Add `-B` alias for `--skip-bundle` option in the rails new generators.
M
Mykola Kyryk 已提交
102

103
    *Jiri Pospisil*
M
Mykola Kyryk 已提交
104

105 106
*   Quote column names in generates fixture files. This prevents
    conflicts with reserved YAML keywords such as 'yes' and 'no'
107
    Fix #8612.
108 109 110

    *Yves Senn*

111 112 113 114
*   Explicit options have precedence over `~/.railsrc` on the `rails new` command.

    *Rafael Mendonça França*

115 116 117 118
*   Generated migrations now always use the `change` method.

    *Marc-André Lafortune*

119
*   Add `app/models/concerns` and `app/controllers/concerns` to the default directory structure and load path.
120
    See http://37signals.com/svn/posts/3372-put-chubby-models-on-a-diet-with-concerns for usage instructions.
D
David Heinemeier Hansson 已提交
121

122 123
    *DHH*

124 125 126
*   The `rails/info/routes` now correctly formats routing output as an html table.

    *Richard Schneeman*
127

128 129
*   The `public/index.html` is no longer generated for new projects.
    Page is replaced by internal `welcome_controller` inside of railties.
S
schneems 已提交
130 131 132

    *Richard Schneeman*

133
*   Add `ENV['RACK_ENV']` support to `rails runner/console/server`.
134 135

    *kennyj*
S
schneems 已提交
136

137 138
*   Add `db` to list of folders included by `rake notes` and `rake notes:custom`. *Antonio Cangiano*

139 140 141 142 143
*   Engines with a dummy app include the rake tasks of dependencies in the app namespace.
    Fix #8229

    *Yves Senn*

144
*   Add `sqlserver.yml` template file to satisfy `-d sqlserver` being passed to `rails new`.
145 146
    Fix #6882

147
    *Robert Nesius*
148

N
Nicolas Despres 已提交
149 150
*   Rake test:uncommitted finds git directory in ancestors *Nicolas Despres*

151
*   Add dummy app Rake tasks when `--skip-test-unit` and `--dummy-path` is passed to the plugin generator.
152 153 154 155
    Fix #8121

    *Yves Senn*

156 157
*   Add `.rake` to list of file extensions included by `rake notes` and `rake notes:custom`. *Brent J. Nordquist*

M
Mike Moore 已提交
158 159 160
*   New test locations `test/models`, `test/helpers`, `test/controllers`, and
    `test/mailers`. Corresponding rake tasks added as well. *Mike Moore*

161
*   Set a different cache per environment for assets pipeline
162 163 164 165
    through `config.assets.cache`.

    *Guillermo Iguaran*

166 167
*   `Rails.public_path` now returns a Pathname object. *Prem Sichanugrist*

168
*   Remove highly uncommon `config.assets.manifest` option for moving the manifest path.
169
    This option is now unsupported in sprockets-rails.
170 171 172

    *Guillermo Iguaran & Dmitry Vorotilin*

173 174 175 176 177
*   Add `config.action_controller.permit_all_parameters` to disable
    StrongParameters protection, it's false by default.

    *Guillermo Iguaran*

178
*   Remove `config.active_record.whitelist_attributes` and
179 180 181 182 183
    `config.active_record.mass_assignment_sanitizer` from new applications since
    MassAssignmentSecurity has been extracted from Rails.

    *Guillermo Iguaran*

184 185 186 187 188 189 190 191 192 193
*   Change `rails new` and `rails plugin new` generators to name the `.gitkeep` files
    as `.keep` in a more SCM-agnostic way.

    Change `--skip-git` option to only skip the `.gitignore` file and still generate
    the `.keep` files.

    Add `--skip-keeps` option to skip the `.keep` files.

    *Derek Prior & Francesco Rodriguez*

194 195
*   Fixed support for DATABASE_URL environment variable for rake db tasks. *Grace Liu*

N
needfeed 已提交
196 197 198
*   rails dbconsole now can use SSL for MySQL. The database.yml options sslca, sslcert, sslcapath, sslcipher,
    and sslkey now affect rails dbconsole. *Jim Kingdon and Lars Petrus*

199 200 201 202 203
*   Correctly handle SCRIPT_NAME when generating routes to engine in application
    that's mounted at a sub-uri. With this behavior, you *should not* use
    default_url_options[:script_name] to set proper application's mount point by
    yourself. *Piotr Sarnacki*

J
José Valim 已提交
204 205
*   `config.threadsafe!` is deprecated in favor of `config.eager_load` which provides a more fine grained control on what is eager loaded *José Valim*

206 207 208 209 210 211 212 213 214 215 216
*   The migration generator will now produce AddXXXToYYY/RemoveXXXFromYYY migrations with references statements, for instance

        rails g migration AddReferencesToProducts user:references supplier:references{polymorphic}

    will generate the migration with:

        add_reference :products, :user, index: true
        add_reference :products, :supplier, polymorphic: true, index: true

    *Aleksey Magusev*

217 218 219 220 221 222 223 224 225 226
*   Allow scaffold/model/migration generators to accept a `polymorphic` modifier
    for `references`/`belongs_to`, for instance

        rails g model Product supplier:references{polymorphic}

    will generate the model with `belongs_to :supplier, polymorphic: true`
    association and appropriate migration.

    *Aleksey Magusev*

227 228
*   Set `config.active_record.migration_error` to `:page_load` for development *Richard Schneeman*

229 230
*   Add runner to Rails::Railtie as a hook called just after runner starts. *José Valim & kennyj*

231 232
*   Add `/rails/info/routes` path, displays same information as `rake routes` *Richard Schneeman & Andrew White*

233 234
*   Improved `rake routes` output for redirects *Łukasz Strzałkowski & Andrew White*

235 236
*   Load all environments available in `config.paths["config/environments"]`. *Piotr Sarnacki*

237 238
*   Remove Rack::SSL in favour of ActionDispatch::SSL. *Rafael Mendonça França*

239 240
*   Remove Active Resource from Rails framework. *Prem Sichangrist*

241 242 243 244 245 246 247 248 249 250 251 252
*   Allow to set class that will be used to run as a console, other than IRB, with `Rails.application.config.console=`. It's best to add it to `console` block. *Piotr Sarnacki*

    Example:

        # it can be added to config/application.rb
        console do
          # this block is called only when running console,
          # so we can safely require pry here
          require "pry"
          config.console = Pry
        end

253 254 255
*   Add convenience `hide!` method to Rails generators to hide current generator
    namespace from showing when running `rails generate`. *Carlos Antonio da Silva*

S
Santiago Pastorino 已提交
256 257
*   Rails::Plugin has gone. Instead of adding plugins to vendor/plugins use gems or bundler with path or git dependencies. *Santiago Pastorino*

B
Brian Cardarella 已提交
258 259 260
*   Set config.action_mailer.async = true to turn on asynchronous
    message delivery *Brian Cardarella*

X
Xavier Noria 已提交
261
Please check [3-2-stable](https://github.com/rails/rails/blob/3-2-stable/railties/CHANGELOG.md) for previous changes.