This reverts commit b7d9d6e2cd
.
Per discussion with @jeremy and @rubys on Campfire.
12 KiB
Rails 4.0.0 (unreleased)
-
Add support for generate scaffold password:digest
- adds password_digest attribute to the migration
- adds has_secure_password to the model
- adds password and password_confirmation password_fields to _form.html
- omits password from index.html and show.html
- adds password and password_confirmation to the controller
- adds unencrypted password and password_confirmation to the controller test
- adds encrypted password_digest to the fixture
Sam Ruby
-
Rails now generates a
test/test_helper.rb
file withfixtures :all
commented out by default, since we don't want to force loading all fixtures for user when a single test is run. However, fixtures are still going to be loaded automatically for test suites.To force all fixtures to be create in your database, use
rails test -f
to run your test.Prem Sichanugrist
-
Add
rails test
command for running testsTo run all tests:
$ rails test
To run a test suite
$ rails test [models,helpers,units,controllers,mailers,...]
To run a selected test file(s):
$ rails test test/unit/foo_test.rb [test/unit/bar_test.rb ...]
To run a single test from a test file
$ rails test test/unit/foo_test.rb -n test_the_truth
For more information, see
rails test --help
.This command will eventually replace
rake test:*
andrake test
tasks.Prem Sichanugrist and Chris Toomey
-
Improve service pages with new layout (404, etc). Stanislav Sobolev
Rails 4.0.0.beta1 (February 25, 2013)
-
Improve
rake stats
for JavaScript and CoffeeScript: ignore block comments and calculates number of functions.Hendy Tanata
-
Ability to use a custom builder by passing
--builder
(or-b
) has been removed. Consider using application template instead. See this guide for more detail: http://guides.rubyonrails.org/rails_application_templates.htmlPrem Sichanugrist
-
Fix
rake db:*
tasks to work withDATABASE_URL
and withoutconfig/database.yml
.Terence Lee
-
Add notice message for destroy action in scaffold generator.
Rahul P. Chaudhari
-
Add two new test rake tasks to speed up full test runs.
test:all
: run tests quickly by merging all types and not resetting db.test:all:db
: run tests quickly, but also reset db.
Ryan Davis
-
Add
--rc
option to support the load of a custom rc file during the generation of a new app.Amparo Luna
-
Add
--no-rc
option to skip the loading of railsrc file during the generation of a new app.Amparo Luna
-
Fixes database.yml when creating a new rails application with '.' Fixes #8304.
Jeremy W. Rowe
-
Restore Rails::Engine::Railties#engines with deprecation to ensure compatibility with gems such as Thinking Sphinx Fixes #8551.
Tim Raymond
-
Specify which logs to clear when using the
rake log:clear
task. (e.g. rake log:clear LOGS=test,staging)Matt Bridges
-
Allow a
:dirs
key in theSourceAnnotationExtractor.enumerate
options to explicitly set the directories to be traversed so it's easier to define custom rake tasks.Brian D. Burns
-
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
-
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
-
The generated
README.rdoc
for new applications invites the user to document the necessary steps to get the application up and running.Xavier Noria
-
Generated applications no longer get
doc/README_FOR_APP
. In consequence, thedoc
directory is created on demand by documentation tasks rather than generated by default.Xavier Noria
-
App executables now live in the
bin/
directory:bin/bundle
,bin/rails
,bin/rake
. Runrake 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 runbundle 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
generatesbin/unicorn
. Add that executable to git and version it just like any other app code.Jeremy Kemper
-
config.assets.enabled
is now true by default. If you're upgrading from a Rails 3.x app that does not use the asset pipeline, you'll be required to addconfig.assets.enabled = false
to your application.rb. If you don't want the asset pipeline on a new app use--skip-sprockets
DHH
-
Environment name can be a start substring of the default environment names (production, development, test). For example: tes, pro, prod, dev, devel. Fixes #8628.
Mykola Kyryk
-
Add
-B
alias for--skip-bundle
option in the rails new generators.Jiri Pospisil
-
Quote column names in generates fixture files. This prevents conflicts with reserved YAML keywords such as 'yes' and 'no' Fixes #8612.
Yves Senn
-
Explicit options have precedence over
~/.railsrc
on therails new
command.Rafael Mendonça França
-
Generated migrations now always use the
change
method.Marc-André Lafortune
-
Add
app/models/concerns
andapp/controllers/concerns
to the default directory structure and load path. See http://37signals.com/svn/posts/3372-put-chubby-models-on-a-diet-with-concerns for usage instructions.DHH
-
The
rails/info/routes
now correctly formats routing output as an html table.Richard Schneeman
-
The
public/index.html
is no longer generated for new projects. Page is replaced by internalwelcome_controller
inside of railties.Richard Schneeman
-
Add
ENV['RACK_ENV']
support torails runner/console/server
.kennyj
-
Add
db
to list of folders included byrake notes
andrake notes:custom
. Antonio Cangiano -
Engines with a dummy app include the rake tasks of dependencies in the app namespace. Fixes #8229.
Yves Senn
-
Add
sqlserver.yml
template file to satisfy-d sqlserver
being passed torails new
. Fixes #6882.Robert Nesius
-
Rake test:uncommitted finds git directory in ancestors Nicolas Despres
-
Add dummy app Rake tasks when
--skip-test-unit
and--dummy-path
is passed to the plugin generator. Fixes #8121.Yves Senn
-
Add
.rake
to list of file extensions included byrake notes
andrake notes:custom
. Brent J. Nordquist -
New test locations
test/models
,test/helpers
,test/controllers
, andtest/mailers
. Corresponding rake tasks added as well. Mike Moore -
Set a different cache per environment for assets pipeline through
config.assets.cache
.Guillermo Iguaran
-
Rails.public_path
now returns a Pathname object. Prem Sichanugrist -
Remove highly uncommon
config.assets.manifest
option for moving the manifest path. This option is now unsupported in sprockets-rails.Guillermo Iguaran & Dmitry Vorotilin
-
Add
config.action_controller.permit_all_parameters
to disable StrongParameters protection, it's false by default.Guillermo Iguaran
-
Remove
config.active_record.whitelist_attributes
andconfig.active_record.mass_assignment_sanitizer
from new applications since MassAssignmentSecurity has been extracted from Rails.Guillermo Iguaran
-
Change
rails new
andrails 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
-
Fixed support for DATABASE_URL environment variable for rake db tasks. Grace Liu
-
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
-
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
-
config.threadsafe!
is deprecated in favor ofconfig.eager_load
which provides a more fine grained control on what is eager loaded José Valim -
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
-
Allow scaffold/model/migration generators to accept a
polymorphic
modifier forreferences
/belongs_to
, for instancerails g model Product supplier:references{polymorphic}
will generate the model with
belongs_to :supplier, polymorphic: true
association and appropriate migration.Aleksey Magusev
-
Set
config.active_record.migration_error
to:page_load
for development Richard Schneeman -
Add runner to Rails::Railtie as a hook called just after runner starts. José Valim & kennyj
-
Add
/rails/info/routes
path, displays same information asrake routes
Richard Schneeman & Andrew White -
Improved
rake routes
output for redirects Łukasz Strzałkowski & Andrew White -
Load all environments available in
config.paths["config/environments"]
. Piotr Sarnacki -
Remove Rack::SSL in favour of ActionDispatch::SSL. Rafael Mendonça França
-
Remove Active Resource from Rails framework. Prem Sichangrist
-
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 toconsole
block. Piotr SarnackiExample:
# 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
-
Add convenience
hide!
method to Rails generators to hide current generator namespace from showing when runningrails generate
. Carlos Antonio da Silva -
Rails::Plugin has gone. Instead of adding plugins to vendor/plugins use gems or bundler with path or git dependencies. Santiago Pastorino
-
Set config.action_mailer.async = true to turn on asynchronous message delivery Brian Cardarella
Please check 3-2-stable for previous changes.