Commit Graph

264 Commits

Author SHA1 Message Date
claudiob
b6f50b3fa8 Add --skip-action-mailer (or -M) to rails generate 2015-01-01 18:46:12 -08:00
Alex Robbin
4e0ec961e1 actually autoload all second-level directories called app/*/concerns 2014-12-26 23:21:20 -05:00
Rafael Mendonça França
f25ad07f5a Start Rails 5 development 🎉
We will support only Ruby >= 2.1.

But right now we don't accept pull requests with syntax changes to drop
support to Ruby 1.9.
2014-11-28 15:00:06 -02:00
Derek Prior
323334a775 Generators add foreign keys on references
If you run a generator such as:

```
rails generate model accounts supplier:references
```

The resulting migration will now add the corresponding foreign key
constraint unless the reference was specified to be polymorphic.
2014-11-25 20:22:58 -02:00
Zachary Scott
49f74fbc4d Add a CHANGELOG entry for #16622 and a6de6f5 [ci skip] 2014-11-24 16:13:25 -08:00
Yves Senn
36fe7f3bed Merge pull request #17700 from ShunsukeAida/ignore_log_as_a_whole
why not gitignore /log as a whole?

[ci skip]
2014-11-21 09:10:47 +01:00
Carlos Antonio da Silva
6ff78469cd Improve railties changelog entry and move latest to the top [ci skip] 2014-11-12 14:22:31 -02:00
Rafael Mendonça França
4cd146bae5 Merge pull request #17593 from igas/paths-unshift-arity
Fix Rails::Paths::Path.unshift interface
2014-11-12 12:51:02 -02:00
David Heinemeier Hansson
2a31ea5545 Merge pull request #17348 from DavidGeukers/rake_test_all
simplify rake test vs rake test:all
2014-11-12 13:42:17 +03:00
Igor Kapkov
56dc95bc92 Fix Rails::Paths::Path.unshift interface 2014-11-12 16:27:42 +08:00
David Geukers
3b12abba3c Simplify rake test vs rake test:all
Renames `rake test:all` to `rake test` by changing old `rake test:run` to previous version of `rake test:all`.  Removes old definition of `rake test`. Also renames `rake test:all:db` to `rake test:db` and deprecates `rake test:all` & `rake test:all:db`
2014-11-10 20:33:31 -05:00
Rafael Mendonça França
091652cae8 Merge pull request #16535 from bf4/patch-1
Allow fallback to LegacyKeyGenerator when secret_key_base is not set but secrets.secret_token is
2014-11-10 20:38:46 -02:00
Carlos Antonio da Silva
5da73d9181 Add skip-turbolinks entry to 4.2 release notes and improve changelog
[ci skip]
2014-11-05 08:36:14 -02:00
Benjamin Fleischer
db5f1a46f2 secret_token is now saved in Rails.application.secrets.secret_token
- `secrets.secret_token` is now used in all places `config.secret_token` was
  - `secrets.secret_token`, when not present in `config/secrets.yml`,
    now falls back to the value of `config.secret_token`
  - when `secrets.secret_token` is set, it over-writes
    `config.secret_token` so they are the same (for backwards-compatibility)
  - Update docs to reference app.secrets in all places
    - Remove references to `config.secret_token`, `config.secret_key_base`
- Warn that missing secret_key_base is deprecated
- Add tests for secret_token, key_generator, and message_verifier
  - the legacy key generator is used with the message verifier when
    secrets.secret_key_base is blank and secret_token is set
  - app.key_generator raises when neither secrets.secret_key_base nor
    secret_token are set
  - app.env_config    raises when neither secrets.secret_key_base nor
    secret_token are set
- Add changelog

Run focused tests via
ruby -w -Itest test/application/configuration_test.rb -n '/secret_|key_/'
2014-11-02 21:21:09 -06:00
Rafael Mendonça França
bf17c8a531 Add back --skip-turbolinks and remove --skip-gems
For the most part of cases --skip-gems option just remove one line in
the Gemfile. This is not worth for the complexity it adds.

Closes #17196
2014-10-26 20:47:47 -05:00
Yves Senn
400b0818fa some changelog formatting. [ci skip] 2014-10-16 09:11:41 +02:00
Dan Olson
8e9bc11d22 Remove --skip-action-view option from application generator 2014-09-24 10:25:59 -05:00
Tamir Duberstein
994d3ebe9b Standardize on Rails.application [ci skip]
This seems to be the style settled on in most of the templates.
2014-09-19 10:42:58 -07:00
Rafael Mendonça França
c2dfc31691 Merge pull request #16936 from untidy-hair/plugin_test_db_migrate_path
Specify dummy app's db migrate path in plugin's test_helper.rb

Conflicts:
	railties/CHANGELOG.md
2014-09-18 18:39:44 -03:00
Xavier Noria
112077c255 inject Rack::Lock if config.eager_load is false
If code is not eager loaded constants are loaded on demand. Constant
autoloading is not thread-safe, so if eager loading is not enabled
multi-threading should not be allowed.

This showed up in certain Capybara scenarios: Most Capybara drivers
other than Rack::Test need a web server. In particular, drivers for
JavaScript support. Capybara launches WEBrick in its own thread for
those but that per se is fine, because the spec thread and the server
thread are coordinated.

Problem comes if the page being served in the spec makes Ajax calls.
Those may hit WEBrick in parallel, and since WEBrick is multi-threaded
and allow_concurrency? returns true in the test environment before
this patch, threads are spawned to serve those parallel requests. On
the other hand, since eager_load is false by default in the test
environment, constants are not preloaded.

So the suite is autoloading constants in a multi-threaded set. That's
a receipt for paracetamol. The symptom is random obscure errors whose
messages point somehow to constant autoloading.

As a consequence of this fix for allow_concurrency? WEBrick in
Capybara scenarios no longer runs in multi-threaded mode.

Fixes #15089.
2014-09-18 23:04:08 +02:00
Yukio Mizuta
7137c6b775 Specify dummy app's db migrate path in plugin's test_helper.rb 2014-09-16 20:21:17 -07:00
Yukio Mizuta
8c9b347342 Use dynamic path for dummy app location in plugin's test_helper.rb 2014-09-14 10:55:19 -07:00
Guo Xiang Tan
a32298ffb3 Fix spelling. [CI SKIP] 2014-08-27 20:13:41 +08:00
Yves Senn
b9b521306c fix broken gem method with non-String arguments. Closes #16709.
This was caused by #15327.
2014-08-27 12:30:35 +02:00
Carlos Antonio da Silva
2f7ac9cdcc Fix setting simple values to the new config.x
Previously setting simple values to the config.x object resulted in the
following:

    config.x.super_debugger = true
    config.x.super_debugger #=> {}

Which was against the examples showed in the changelog/release notes.
2014-08-19 21:59:01 -03:00
Rafael Mendonça França
43073b393d Revert "Improve custom configuration"
This reverts commit de4891344ccc074f6d5693f4fac6ad610584e336.

Conflicts:
	railties/lib/rails/railtie/configuration.rb

It added regression. Will be back after the beta
2014-08-19 19:41:15 -03:00
Guillermo Iguaran
b9700c1e51 Merge pull request #16561 from gsamokovarov/mention-web-console-in-changelog
Mention web-console in 4.2 release notes
2014-08-19 16:20:53 -05:00
Genadi Samokovarov
5407084cc5 Mention web-console in 4.2 release notes
Mention the web-console inclusion in the default Gemfile in the Release
notes and the railties changelog. We can eventually mention it in the
upgrade guide, if needed.

[ci skip]
2014-08-20 00:01:10 +03:00
Rafael Mendonça França
de4891344c Improve custom configuration
1. Hashes can be assigned
2. We don't need a special level anymore

The method chain only works in the top level.

If users need a second level they need to assign a OrderedOptions to the
key:

    config.resque.server = ActiveSupport::OrderedOptions.new
    config.resque.server.url = "http://localhost"
    config.resque.server.port = 3000

[Rafael Mendonça França + Carlos Antonio da Silva]
2014-08-19 13:59:22 -03:00
Sean Griffin
fdfc0fc6c9 Add a required option to the model generator
Syntax was chosen to follow the passing of multiple options to
decimal/numeric types. Curly braces, and allowing any of `,`, `.`, or
`-` to be used as a separator to avoid the need for shell quoting. (I'm
intending to expand this to all columns, but that's another PR.

The `required` option will cause 2 things to change. `required: true`
will be added to the association. `null: false` will be added to the
column in the migration.
2014-08-08 10:29:27 -06:00
Yves Senn
a819211984 Merge pull request #16359 from skanev/after-bundle-in-rails-templates
Add an after_bundle callback in Rails templates

Conflicts:
	railties/CHANGELOG.md
2014-08-06 08:49:00 +02:00
David Heinemeier Hansson
611849772d Pull in the custom configuration concept from dhh/custom_configuration 2014-08-03 15:48:14 -07:00
Stefan Kanev
097b210189 Add an after_bundle callback in Rails templates
The template runs before the generation of binstubs – this does not
allow to write one, that makes an initial commit to version control.
It is solvable by adding an after_bundle callback.
2014-08-03 00:29:29 +02:00
Yves Senn
94abb92c8d Merge pull request #16328 from noinkling/template_password_confirmation_fix
Give password_confirmation div the "field" class in the scaffold generator "_form" partial
2014-07-29 12:22:22 +02:00
Rafael Mendonça França
9629dea4fb Add Rails::Application#config_for
This is a convenience for loading configuration for the current Rails
environment.
2014-07-15 15:35:13 -03:00
Godfrey Chan
00aae7cb38 Synced 4.2 release notes with the latest commits.
Also reordered some of the items to put newer ones on top (same order as
CHANGELOGs), which makes it easier to diff while we are still working on it.
2014-07-11 02:16:57 -07:00
Zachary Scott
2f716694f2 Change back occurrences of SQLite(3) to sqlite3 when referring to the
adapter, fixed from #16057 [ci skip]
2014-07-06 11:47:16 -07:00
Akshay Vishnoi
ddad32978d [ci skip] /sqlite/i --> SQLite 2014-07-06 15:23:12 +05:30
Rafael Mendonça França
84a13e019e Deprecate Rails::Rack::LogTailer
It was being used by Rails for show the development logs but since Rails
4 it is not being used anymore on the framework.

This class seems to be private but it were part of the public API we are
deprecating before removing.
2014-06-17 22:48:28 -03:00
Rafael Mendonça França
1056589580 Add a generic --skip-gems options to generator
Also remove --skip-turbolinks.

This option is useful if users want to remove some gems like jbuilder,
turbolinks, coffee-rails, etc that don't have specific options on the
generator.

    rails new my_app --skip-gems turbolinks coffee-rails
2014-06-17 20:35:09 -03:00
schneems
72f45ba292 Emit suggested generator names when not found
When someone types in a generator command it currently outputs all generators. Instead we can attempt to find a subtle mis-spelling by running all generator names through a levenshtein_distance algorithm provided by rubygems. 

So now a failure looks like this:

```ruby
$ rails generate migratioooons
Could not find generator 'migratioooons'. Maybe you meant 'migration' or 'integration_test' or 'generator'
Run `rails generate --help` for more options.
```

If the suggestions are bad we leave the user with the hint to run `rails generate --help` to see all commands.
2014-06-04 16:28:43 -05:00
Yves Senn
7ba6b75910 bin/setup script to bootstrap applications. 2014-05-30 11:15:56 +02:00
Yves Senn
99873ca1ea Revert "Merge pull request #12778 from etehtsea/rake-default-fix"
This reverts commit ec0a2b57f67c9153cb5f7bbe2a3f66d13fe64bdd, reversing
changes made to a8bd7b16260c217290ef8fe3a166fcceac442c62.

This reverts commit 555ec36522011862c03b483c53be32410594a51e

This reverts commit 555ec36522011862c03b483c53be32410594a51e

By default, Rails uses the `default` Rake task to run all tests.
This commit changed the environment of the default task to `development`.
This clears the development database and has other negative consequences.
2014-05-28 17:43:45 +02:00
alexbel
6aaf4bff18 Replace double quotes with single quotes while adding an entry into Gemfile 2014-05-26 19:08:03 -04:00
Zachary Scott
1d7b3fa84c Future port c8ddb61 2014-05-23 14:45:21 -07:00
Dan Kang
f369bcf9a0 Default config.assets.digests to true in development 2014-05-17 23:01:22 -04:00
Pier-Olivier Thibault
d14fab04ff Use Rails::Paths::Path#existent in database_configuration
Database configuration was trying to load the first path that
config.paths['config/database'] was returning even if the path didn't
exist in the filesystem.

Because Rails::Paths::Path has the possibility to return more than 1
path (as an array), database_configuration should filter down the paths
to the existing one and then load the first one.

This would make it possible to move the database.yml file and add the
new path to paths['config/database'] and still load the configurations.
2014-05-07 18:18:00 -04:00
Arun Agrawal
c694c8e25c skip-git should not hit git commands plugin generators 2014-05-02 15:38:58 +02:00
Rafael Mendonça França
43f525031a Make console and generators blocks works at Application instance level
Like rake tasks and runner blocks these blocks should also being shared
between applications since they are stored at the classes.

Fixes #14748
2014-04-14 18:59:47 -03:00
Matthew Draper
f612c2b052 Move assets precompile (and version) to an initializer
sprockets-rails 2.1 needs the precompile list to be available in all
environments.
2014-04-11 22:47:54 +09:30