Commit Graph

391 Commits

Author SHA1 Message Date
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 de4891344c.

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
tanraya 6bd812605d Use local variables in _form.html.erb generated by scaffold generator.
It seems a good idea to use local variables in generated partials instead of using instance variables.

Before

    <%= render 'form' %>

After

    <%= render 'form', product: @product %>
2014-07-26 09:40:24 +06: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 ec0a2b57f6, reversing
changes made to a8bd7b1626.

This reverts commit 555ec36522

This reverts commit 555ec36522

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
Rafael Mendonça França 555ec36522 Add CHANGELOG entry for #12778 [ci skip] 2014-03-28 12:28:28 -03:00
Dmitrii Golub f42c7eee7e Remove sqlite3 lines from .gitignore if the application is not using sqlite3. 2014-03-24 14:53:38 +04:00
robertomiranda 8eac0a6b58 Add Changelog Entry ref #14379 2014-03-17 09:06:00 -05:00
Arun Agrawal 9e61a14d4b Removed unnecessary command "application" 2014-03-10 23:23:12 +01:00
Robin Dupret 9c53b8b89f Make the rails:template rake task load initializers
Templates could rely on irregular inflections or external libraries for
instance so we should load the application's initializers when running
the rails:template task.

The introducing commit of this feature is f7f11361 ; the initializers
have never been loaded invoking this task.

Fixes #12133.
2014-03-08 15:59:22 +01:00
Prem Sichanugrist 2dd2fcf896
Introduce `Rails.gem_version`
This method return `Gem::Version.new(Rails.version)`, suggesting a more
reliable way to perform version comparison.

Example:

    Rails.version #=> "4.1.2"
    Rails.gem_version #=> #<Gem::Version "4.1.2">

    Rails.version > "4.1.10" #=> false
    Rails.gem_version > Gem::Version.new("4.1.10") #=> true
    Gem::Requirement.new("~> 4.1.2") =~ Rails.gem_version #=> true

This was originally introduced as `.version` by @charliesome in #8501
but got reverted in #10002 since it was not backward compatible.

Also, updating template for `rake update_versions`.
2014-03-05 12:37:38 -05:00
Robin Dupret fc61bca31d Avoid namespacing routes inside engines
Since #11544, invoking the controller generator, any generated route is
namespaced according to the class_path method. Since a mountable plugin
is namespaced, creating a controller inside would generate a namespaced
route based on the engine's name.

The controller generator now relies on regular_class_path which does not
contain the class hierarchy but the given path.

Fixes #14079.
2014-02-26 16:06:11 +01:00
Carlos Antonio da Silva 71b3910a7d Point master changelogs to 4-1-stable branch
Remove 4-1 related entries from master [ci skip]
2014-02-25 09:14:36 -03:00
Guillermo Iguaran b1867c85fa Revert "Only lookup `config.log_level` for stdlib `::Logger`. Closes #11665."
This reverts commit e0a521cfcd.

Conflicts:
	railties/CHANGELOG.md

We expect loggers to quack like stdlib logger. If log4r needs different
level= assignment, using a Logger-quacking wrapper is the way to do it.

Fixes #14114.
2014-02-21 09:50:19 -05:00
Yves Senn 37e30d2548 do not crash when `config/secrets.yml` is blank. 2014-02-12 17:17:00 +01:00
Xavier Noria c0fb8d0b9c Merge branch 'dump-schema-after-migration-flag' of git://github.com/emilsoman/rails into emilsoman-dump-schema-after-migration-flag
Conflicts:
	activerecord/CHANGELOG.md
2014-02-06 15:03:20 +01:00
Emil Soman 8806768e9f Add config to disable schema dump after migration
* Add a config on Active Record named `dump_schema_after_migration`
* Schema dump doesn't happen if the config is set to false
* Set default value of the config to true
* Set config in generated production environment file to false
* Update configuration guide
* Update CHANGELOG
2014-02-06 17:38:31 +05:30
Yves Senn 580f0b61dc synchronize 4.1 release notes with CHANGELOGS. [ci skip]
/cc @chancancode
2014-02-06 11:43:16 +01:00
Gert Goet 3858a247bd Add CreateMigration action
This Thor-action isolates the logic whether to (over-)write migration and
what is shown to the user. It's modelled after Thor's CreateFile-action.

This solves the issue that removing a non-existing migration, tried to
remove the template-path (#13588).

Related issues: #12674
2014-01-28 00:01:19 +01:00
Robin Dupret fe63933cee Add a missing changelog entry for #13825 [ci skip] 2014-01-25 22:12:28 +01:00
robertomiranda 7671590fe2 Update Changelog, Spring is under rails/spring [ci skip] 2014-01-19 08:50:15 -05:00
Carlos Antonio da Silva 1c88b363a3 Unify changelog entries about single quotes [ci skip] 2014-01-15 19:26:00 -02:00
Chulki Lee 1ab6c656d6 Use single quotes in generated files 2014-01-14 11:13:42 -08:00
Cristian Mircea Messel 9cdc7c0614 single quotes for controller generated routes
Write routes in route.rb with single quotes

    get 'welcome/index'

instead of

    get "welcome/index"
2014-01-14 09:31:51 +02:00
Yves Senn e0a521cfcd Only lookup `config.log_level` for stdlib `::Logger`. Closes #11665.
This prevents Rails from assigning meaningless log levels to third
party loggers like log4r. If `Rails.logger` is not `kind_of?(::Logger)`
we simply assign the `config.log_level` as is.

This bug was introduced by #11665.
2014-01-13 19:00:45 +01:00
Xavier Noria db11682c2b fixes a typo in a CHANGELOG 2014-01-12 22:24:28 +01:00
Xavier Noria 6049249c6c upgrade SDoc
Kudos to @zzak for taking over SDoc and make it work with RDoc 4.
2014-01-12 22:18:44 +01:00
Jon Leighton ff7ab3bc78 Automatically maintain test database schema
* Move check from generated helper to test_help.rb, so that all
  applications can benefit
* Rather than just raising when the test schema has pending migrations,
  try to load in the schema and only raise if there are pending
  migrations afterwards
* Opt out of the check by setting
  config.active_record.maintain_test_schema = false
* Deprecate db:test:* tasks. The test helper is now fully responsible
  for maintaining the test schema, so we don't need rake tasks for this.
  This is also a speed improvement since we're no longer reloading the
  test database on every call to "rake test".
2014-01-02 13:49:00 +00:00
José Valim 2d4cfb2840 Update CHANGELOG [ci skip] 2013-12-23 20:34:11 +01:00
Robin Dupret d39db9da1a Add a changelog entry for #13326 [ci skip] 2013-12-21 14:49:16 +01:00
Kassio Borges 02c814c992 `html` and `text` templates for mailers by default 2013-12-20 18:34:57 -02:00
Rafael Mendonça França bfdae1775a Make possible to use symbol as the verifier name 2013-12-19 17:06:40 -02:00
Rafael Mendonça França 61f6b47204 Change the message verifier argument to verifier_name 2013-12-19 17:05:22 -02:00
Guillermo Iguaran 83e4dde41a Add changelog entries about secrets.yml and secrets.secret_key_base 2013-12-17 12:40:13 -05:00
Huiming Teo 971d5107cd fixed rails dbconsole to support ENV['DATABASE_URL']. 2013-12-16 18:31:49 +08:00
Yves Senn 64c784f553 end sentences with a `.`. [ci skip] 2013-12-05 11:33:12 +01:00
Rafael Mendonça França 48c703b055 Make salt argument required for message verifier 2013-12-04 23:11:42 -02:00
Rafael Mendonça França d3d8498867 Fix typos 2013-12-04 22:56:48 -02:00
Rafael Mendonça França f98bd42854 No need to configure salts 2013-12-04 22:56:48 -02:00
Rafael Mendonça França 2be4916e8e Make possibile to get different message verifiers 2013-12-04 22:56:47 -02:00
Rafael Mendonça França 609c217628 Rename verifier to message_verifier 2013-12-04 22:56:47 -02:00
Rafael Mendonça França 69ac53cfec Add documentation and CHANGELOG entry to Application#verifier 2013-12-04 22:56:47 -02:00
Jon Leighton df50e3064a Install Spring preloader when generating new applications 2013-12-03 23:07:40 +00:00
Prathamesh Sonpatki 4816fdd385 Use .railsrc while creating new plugin if available
- Fixes #10700
2013-12-01 20:47:15 +05:30
Carlos Antonio da Silva 18964368f3 Improve changelogs
Also make Action Mailer changelog format more consistent with the
others [ci skip]
2013-11-22 08:30:04 -02:00
Lauro Caetano c09ef94a49 Remove turbolinks when generating a new application based on a template
that skips it.

It can be skipped adding `add_gem_entry_filter { |gem| gem.name != "turbolinks" }` to the template.
2013-11-21 23:31:57 -02:00
Paul Nikitochkin 251923c7a8 Instrument each load config initializer
In order to simplify profiling loading of initializers,
added instument for tracking load config initializer event from
`config/initializers`
2013-11-16 21:47:08 +02:00
Mike Pack ec3134739c Allow Pathnames to be added to eager load paths 2013-11-11 11:36:44 -07:00
Dmitry Korotkov bc010e7140 Fix missing line and shadow on static error pages [ci skip] 2013-11-11 11:17:44 +04:00
Carlos Antonio da Silva b5cd187ae4 Fix typo in railties changelog
Also improve the example to show as shell command [ci skip]
2013-11-04 12:53:19 -02:00
Yves Senn 84eac5dab8 BACKTRACE environment variable to show unfiltered backtraces.
We used to support the `BACKTRACE` environment variable but when
we switched to MiniTest it got removed: f9382cd794

This commit adds back the functionality to show the unfiltered backtrace when needed.
This also works when you run your tests with `rake`:

* `BACKTRACE=1 bin/rake test`
* `BACKTRACE=1 ruby -Itest ...`
2013-11-04 10:00:44 +01:00
Arun Agrawal fae08dd9ca No web-console for now 2013-11-03 22:19:17 +01:00
Robin Dupret 84e261b930 Removal of javascript related gems when creating an app
Commit 0417bc8 add the coffee-rails and javascript runtime gems even
when passing the --skip-javascript option but this is not the desired
behavior.

Also remove all javascript related stuff in the generated application
such as the vendor/assets/javascripts folder.
2013-10-27 18:44:03 +01:00
Robin Dupret 52b252614e Make the application name snake cased when it contains spaces
The application name is used to fill the `database.yml` and
`session_store.rb` files ; previously, if the provided name contained
whitespaces, it led to unexpected names in these files.

Since Shellwords.escape adds backslashes to escape spaces, the app_name
should remove them and replace any space with an underscore (just like
periods previously).

Also improve the assert_file helper to work with paths containing spaces
using String#shellescape.
2013-10-22 14:13:14 +02:00
Rafael Mendonça França 790b4011b2 Fix typo in the changelog entry
[ci skip]
2013-10-15 18:04:02 -03:00
yalab 4f642dcb39 Added --model-name option scaffold_controller_generator. 2013-10-15 15:35:15 +09:00
Ben Pickles 4de8851289 Expose MiddlewareStack#unshift to environment configuration. 2013-10-09 12:25:29 +01:00
Genadi Samokovarov b4fd1e338b Add a CHANGELOG entry about Web Console inclusion 2013-09-24 19:55:09 +03:00
schneems 5f98bb402b Only output Server logs in Development
Right now when you start a server via `rails s`, the logger gets extended so that it logs to the file system and also to stdout. This extension behavior is not "intelligent" and if the default logger is already set to output to stdout, then the contents will be received twice.

To capture logs in accordance with http://www.12factor.net/logs some platforms require the logs to be sent to standard out. If a logger is set to stdout, and the server is started using `rails server` instead of another method (i.e. `thin start` etc.) then the app will produce double logs.

This PR fixes the issue by only extending the logger to standard out in the development environment. So that in production you don't get double logs like this:

```
ActionView::Template::Error (wrong number of arguments (5 for 4)):
    1: <% lang_index = 0 %>
    2: <div class="row">
    3:   <ul class="nav nav-tabs nav-stacked span2" data-tabs="tabs" id="repo-tabs">
    4:     <% repos.group_by(&:language).each do |lang, repos| %>
    5:       <% unless lang == nil %>
    6:         <li><a href="#<%= "#{lang.parameterize}#{lang.hash}" %>" data-toggle="tab"><%= lang %></a></li>
    7:       <% end -%>
  app/views/shared/_repos.html.erb:4:in `_app_views_shared__repos_html_erb___1685450633638247395_70300668607000'
  app/views/pages/index.html.erb:13:in `_app_views_pages_index_html_erb__2084723628308867770_70300687584880'

ActionView::Template::Error (wrong number of arguments (5 for 4)):
    1: <% lang_index = 0 %>
    2: <div class="row">
    3:   <ul class="nav nav-tabs nav-stacked span2" data-tabs="tabs" id="repo-tabs">
    4:     <% repos.group_by(&:language).each do |lang, repos| %>
    5:       <% unless lang == nil %>
    6:         <li><a href="#<%= "#{lang.parameterize}#{lang.hash}" %>" data-toggle="tab"><%= lang %></a></li>
    7:       <% end -%>
  app/views/shared/_repos.html.erb:4:in `_app_views_shared__repos_html_erb___1685450633638247395_70300668607000'
  app/views/pages/index.html.erb:13:in `_app_views_pages_index_html_erb__2084723628308867770_70300687584880'
```

ATP Railties. Opened against master in favor of #10999
2013-09-22 20:56:31 -05:00
Piotr Sarnacki 47ac67b8d4 Don't require using application_name before options
Before this commit options for `rails new` and `rails plugin new` had to
be passed in a strict order, trying to execute a following command:

    rails new -J path/to/app

resulted in an error.

This commit fixes the situation and allows to pass path to app anywhere
after `new`
2013-09-13 18:02:25 +02:00
Josh Crowder f3073773a3 Adding LESS to rake notes 2013-08-15 11:30:01 +01:00
Prathamesh Sonpatki 53c5794a4b Generate namespaced routes correctly for generators. Fix for #11532 2013-08-14 08:53:38 +05:30
Rafael Mendonça França d86ccec097 Use the right instrumentation name
The pattern is event.component

Closes #11769

Conflicts:
	railties/CHANGELOG.md
2013-08-05 18:20:22 -03:00
Rafael Mendonça França 3a7e321246 Add CHANGELOG entry for #11665
[ci skip]
2013-08-04 11:38:14 -03:00
Carlos Antonio da Silva 4cf805a6d9 Move changelog entry to the top [ci skip] 2013-07-29 08:03:41 -03:00
Pawel Janiak f18aecfe7b Changed stylesheet load order in the stylesheet manifest generator. 2013-07-28 15:05:17 +02:00
Josef Šimánek 5ecd125a62 Added generated unit test for generator generator and new test:generators rake task included in test:all rake task. 2013-07-16 09:38:13 +02:00
Josef Šimánek 8e1656e76f Remove update:application_controller rake task. 2013-07-13 14:44:06 +02:00
Paul Nikitochkin 9cac69c602 #11381: Ignore config.eager_load=true for rake
Closes #11381
2013-07-10 21:43:15 +03:00
Yuri Artemev dd996ad394 handle notes in *.sass files 2013-07-08 19:13:01 +04:00
Arun Agrawal 4a2a504f40 Removed deprecated `Rails.application.railties.engines`. 2013-07-04 19:56:23 +02:00
Arun Agrawal 7e897d469f Added missing CHANGELOG from PR #11279 [ci skip] 2013-07-03 22:10:31 +02:00
Vipul A M 822d995627 Remove deprecated `ActiveRecord::Generators::ActiveModel#update_attributes` in
favor of `ActiveRecord::Generators::ActiveModel#update`
2013-07-03 22:33:57 +05:30
Vipul A M d50483b048 Remove deprecated `config.whiny_nils` 2013-07-02 09:25:08 +05:30
schneems ec8d8652f3 s/plugin_new/plugin
There are historical reasons that the `plugin` command was `plugin_new`, now those are no longer applicable, we should remove the naming edge case from the project. This PR is based off of comments from #11176

ATP Railties
2013-06-30 22:03:39 -04:00
schneems 6ce18ba7dc Fix `rails plugin --help`
Right now if you run the `rails plugin --help` command it fails because rails expects a command in `railties/lib/rails/commands/plugin.rb` that does not exist because the file is named `plugin_new`. This is the error:

```
ruby-2.0.0-p0  ~/documents/projects/tmp/vanilla (master)
$ rails plugin --help
/Users/schneems/.rvm/gems/ruby-2.0.0-p0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require': cannot load such file -- rails/commands/plugin (LoadError)
	from /Users/schneems/.rvm/gems/ruby-2.0.0-p0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
	from /Users/schneems/.rvm/gems/ruby-2.0.0-p0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
	from /Users/schneems/.rvm/gems/ruby-2.0.0-p0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
	from /Users/schneems/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0/lib/rails/commands.rb:49:in `<top (required)>'
	from bin/rails:4:in `require'
	from bin/rails:4:in `<main>'
```
2013-06-29 14:34:46 +03:00
Nikita Fedyashev e68183cccb Omit turbolinks configuration completely on skip_javascript generator option 2013-06-28 18:53:32 +06:00
Carlos Antonio da Silva f5df6e5a6d Review railties changelog [ci skip] 2013-06-26 20:17:58 -03:00
wangjohn 3e5dbda5bb Removing deprecated rake tasks.
The `rake test:recent` and `rake test:uncommitted` tasks were
deprecated and are now being removed.
2013-06-24 09:35:15 -04:00
Sıtkı Bağdat f0e4254bfa Use Colspan in th Tags
Is it more suitable that using ```<th colspan="3">``` instead of three empty ```<th>```? It is simple, but what i am missing about it?

Change repetitive th tags to use colspan attribute

Update CHANGELOG.md

Update CHANGELOG.md
2013-06-17 19:59:02 +03:00
Xavier Noria 7d40aa4ddb registers recent patch in the railties CHANGELOG 2013-06-06 23:16:04 +02:00
Prathamesh Sonpatki f8a3dda6ce Fxied some typos 2013-05-18 19:23:30 +05:30
Rafael Mendonça França d093f8437a Review the CHANGELOG entry [ci skip] 2013-05-04 10:53:53 -03:00
Arun Agrawal f1805a6978 Fixes Scaffold generator with --assets=false
Scaffold generator with --assets=false option 
outputs an error

See #9525
2013-05-04 15:48:44 +02:00
wangjohn 81b7416afa Removing Railtie::Configurable from the base Railtie object and making
Railtie itself abstract. This stops the weird behavior of forcing
subclasses of Railtie to include the Configurable module.
2013-04-29 13:06:29 -04:00
Rafael Mendonça França feb44b9213 rails/master is now 4.1.0.beta 2013-04-29 13:15:24 -03:00
Yves Senn c245437de7 use unified and clean formatting in CHANGELOGS. [ci skip] 2013-04-12 15:52:43 +02:00
Aaron Patterson c7a148f389 removing `rails test`, updating docs to show how to use `rake test` 2013-04-05 15:44:41 -07:00
Steve Klabnik fc11375584 CHANGELOG entry for rails.png removal. 2013-04-02 17:37:37 -07:00
Rafael Mendonça França 3073c3d3ae ✂️
[ci skip]
2013-04-01 16:56:20 -03:00
Rafael Mendonça França 38bda383ee Remove CHANGELOG entry for #10002
[ci skip]
2013-04-01 16:34:30 -03:00
Rafael Mendonça França ec55f37027 Merge pull request #9991 from Passionate/patch-1
improve readability
2013-03-30 10:03:24 -07:00
Xavier Noria 2cc934a03d registers the new doc:rails behaviour in the changelog 2013-03-30 00:10:52 +01:00
Paritosh Piplewar 737f618f38 improve readability 2013-03-29 05:29:08 +05:30
Gabe Kopley 940da7d9cb Put coffee-rails in top-level of generated Gemfile
v3 of pull request based on additional feedback from @jeremy
2013-03-24 22:31:48 -07:00
Charlie Somerville 8f05fee1ff add changelog entry 2013-03-24 12:43:31 +11:00
Kevin Glowacz 2e5f49dcbf Don't generate a scaffold.css if no-assets 2013-03-20 15:24:45 -05:00
Steve Klabnik 1a9055073d Revert "make new rails apps log to STDOUT"
This reverts commit b7d9d6e2cd.

Per discussion with @jeremy and @rubys on Campfire.
2013-03-15 10:38:00 -07:00
Terence Lee b7d9d6e2cd make new rails apps log to STDOUT 2013-03-15 10:05:10 -07:00
Sam Ruby 3008994d1e 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 entirely 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
2013-03-13 16:06:33 -04:00
Carlos Antonio da Silva cd9f7508df Move some railties changelog entries to the top [ci skip] 2013-03-13 14:03:14 -03:00
Dalibor Nasevic df85dfa6fa Improve wording for rails test command 2013-03-09 16:03:55 -05:00
Prem Sichanugrist 1a0c58b298 Load fixtures only when running suites, or `-f`
* `rails test -f` will run the test suites with all fixtures loaded
* New application will now generated without `fixtures :all` line
  enabled by default.
2013-03-09 16:03:55 -05:00
Prem Sichanugrist and Chris Toomey b4df25366a Add `rails test` command to run the test suite
To run the whole test suite:

    $ rails test

To run the test file(s):

    $ rails test test/unit/foo_test.rb [test/unit/bar_test.rb ...]

To run the test suite

    $ rails test [models,helpers,units,controllers,mailers,...]

For more information, see `rails test --help`.

This command will eventually replacing `rake test:*`, and `rake test`
command will actually invoking `rails test` instead.
2013-03-09 16:03:54 -05:00
Yves Senn a58e660837 Use "Fixes" in place of "Fix" in changelogs for consistency [ci skip]. 2013-03-09 20:57:17 +01:00
Stanislav 40f1642b67 New beauty pages(404, 422, 500)
moving changelog note to unreleased section

New beauty pages(404, 422, 500)
2013-03-02 00:24:54 +06:00
Rafael Mendonça França 0f75e2c51f Update CHANGELOGS 2013-02-26 13:45:57 -03:00
David Heinemeier Hansson c0bc9ce38c Preparing for 4.0.0.beta1 release 2013-02-25 08:31:50 -06:00
Hendy Tanata 82e345dd7a Improve `rake stats` for JavaScript and CoffeeScript.
Ignore block comments and calculates number of functions.
2013-02-25 21:08:11 +08:00
Prem Sichanugrist 2da5ea1c9f Remove `--builder` option from `rails` command
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.html
2013-02-24 14:31:08 -05:00
Yves Senn 6bd1cae459 Revert "move config.assets.precompile into config/application.rb"
This reverts commit 304f4d4c25.

As it turns out everything should behave as it did and we don't
need to move this configuration option.
2013-02-24 18:01:43 +01:00
Rafael Mendonça França b85f63bbd0 Merge pull request #9341 from senny/move_precompiled_asset_config_to_application
move config.assets.precompile into config/application.rb
2013-02-20 08:18:08 -08:00
Yves Senn 304f4d4c25 move config.assets.precompile into config/application.rb 2013-02-20 15:53:37 +01:00
Terence Lee b1de1892bc update changelog 2013-02-21 01:25:05 +11:00
Andrew White 9d9b22f47a Revert "Deprecate the `eager_load_paths` configuration"
Because of the possibility of lib being unintentionally eager loaded
it's been agreed that we'll leave autoload paths and eager load paths
separate for Rails 4.0.

This reverts commit 0757b3388f.

Conflicts:
	railties/CHANGELOG.md
2013-02-19 07:22:37 +00:00
Carlos Antonio da Silva 7765ee0e47 Add changelog entry for #9177 [ci skip]
Add test:all and test:all:db rake tests to speed up full test runs.
2013-02-11 11:25:13 -02:00
Rahul P. Chaudhari afdb84a1fe Added notice message for destroy method in scaffold 2013-02-10 01:19:02 +05:30
Amparo Luna 5f1dc8e3b7 Add --rc option to support the load of a custom rc file 2013-02-01 23:17:41 -05:00
Amparo Luna a1e1af9b21 Add --no-rc option to skip the loading of railsrc file 2013-01-31 19:30:47 -05:00
Rafael Mendonça França 9826823e66 Merge pull request #8303 from jeremywrowe/master
Fixes improper database name when creating a new rails app with a '.'

Conflicts:
	railties/CHANGELOG.md
2013-01-25 10:21:48 -02:00
Andrew White 0757b3388f Deprecate the `eager_load_paths` configuration
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` so we alias
`eager_load_paths` to it. 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.
2013-01-24 23:54:41 +00:00
Rafael Mendonça França 19bd2f2279 Merge pull request #8557 from timraymond/add_back_engines_and_deprecate
Adding Back Rails::Engine::Railties#engines

Conflicts:
	railties/CHANGELOG.md
2013-01-22 00:00:20 -02:00
Matt Bridges 08ac4b9672 clear specific logs when using rake log:clear 2013-01-16 17:12:32 -06:00
Jeremy W. Rowe c45980fe6e Fixes improper database name when a '.' is included while creating a new rails
application. EG: `rails new something.awesome.com`
Conflicts:
	railties/CHANGELOG.md
2013-01-16 15:12:31 -06:00
Brian D. Burns 5a9b3b7a74 allow :dirs option for .enumerate
Allows custom rake tasks to be defined using:

  SourceAnnotationExtractor.enumerate 'TODO|FIXME', dirs: %w(app lib), tag: true
2013-01-15 14:14:05 -05:00
Carlos Antonio da Silva 2549a3b088 Deprecate `Rails::Generators::ActiveModel#update_attributes`
Deprecate #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`,
introduced in cb2bd4aa61.
2013-01-12 10:52:13 -02:00
Carlos Antonio da Silva 39a88f6f0e Add changelog entry for scaffold generator and jbuilder changes
Introduced in 3bfd99defb.
Related to #8840.

[ci skip]
2013-01-11 09:27:48 -02:00
Xavier Noria 6cf47c533d new README generated for new apps 2013-01-08 00:50:56 +01:00
Xavier Noria 553b6958dc doc/README_FOR_APP is no longer generated 2013-01-08 00:50:56 +01:00
Jeremy Kemper 2c9d129fb4 Take the heat 🔥 2013-01-06 21:53:30 -07:00
Jeremy Kemper 009873aec8 Introduce ./bin for your app's executables: bin/bundle, bin/rails, bin/rake. Executable scripts are versioned code like the rest of your app. To generate a stub for a bundled gem: 'bundle binstubs unicorn' and 'git add bin/unicorn' 2013-01-06 21:41:36 -07:00
Rafael Mendonça França 9665f5e46c Remove the content_tag_for change from CHANGELOG since it was reverted 2013-01-05 18:14:58 -03:00
David Heinemeier Hansson 201f8d7753 config.assets.enabled is now true by default 2013-01-05 17:56:53 +01:00
Carlos Antonio da Silva 149b86d97b Move changelog entry in railties to the top
Other minor changelog improvements [ci skip]
2013-01-04 22:49:14 -02:00
Matt Bridges 216d5fd8f6 Small typo fix in railties/CHANGELOG.md 2013-01-04 16:08:28 -06:00
Mykola Kyryk 4fa6088b42 This commit fixes issue #8628
Allow environment name to start with a substring of the default
environment names.
For example: tes, pro, prod, dev, devel, etc.

Fixing identation.

Adding test for Rails::Console.parse_arguments method.

Fix issue 8628 for Rails::DBConsole.
2013-01-04 17:05:49 +02:00
Tim Raymond 48d5a33269 Adding Back Rails::Engine::Railties#engines
Removing it breaks functionality with gems such as Thinking Sphinx.
This restores it with a deprecation warning. Closes #8551
2013-01-03 14:00:32 -05:00
Jiri Pospisil fc7b8d38c1 Add missing changelog entry for #8676 [ci skip] 2013-01-02 11:41:35 +01:00
Yves Senn edae4777ad quote column names in generated fixture files 2012-12-26 16:17:47 +01:00
Rafael Mendonça França 33e52d379e Explicit options should have precedence over railsrc on the `rails new`
command

Closes #8545
2012-12-24 00:03:13 -03:00
Jeremy Kemper f9da785d0b Move background jobs to the 'jobs' branch until fully baked. Not shipping with Rails 4.0. 2012-12-21 16:29:47 -08:00
Andy Lindeman 33b3fa67c4 Revert "Make sure that RAILS_ENV is set when accessing Rails.env"
This reverts commit b3125c89f4.

* It is not desirable to set `ENV['RAILS_ENV']`; otherwise, it will leak
  through to rake tasks such as `rake test` or `rake spec`. See #7175
  for more details.
2012-12-21 17:22:57 -05:00
Marc-Andre Lafortune a81845f268 Update Migration and 4.0 Release Guides, Changelogs [#8267] 2012-12-21 13:56:16 -05:00
Francesco Rodriguez b565a7a3b4 fix railties CHANGELOG [ci skip] 2012-12-18 16:18:29 -05:00
Rafael Mendonça França 7f96e4317e Revert "Merge pull request #7587 from elia/fix-too-eager-loading"
This reverts commit 3663057518.

REASON: This caused a regression that add app folder in the eager load
path. See #8146 for more information.

Conflicts:
	railties/CHANGELOG.md
2012-12-18 16:05:30 -03:00
David Heinemeier Hansson 15c40b2ef5 Fix changelog 2012-12-18 16:32:11 +01:00
David Heinemeier Hansson 09aeee7247 Merge 2012-12-18 16:29:00 +01:00
David Heinemeier Hansson f6bbc3f582 Add app/models/concerns and app/controllers/concerns to the default directory structure and load path 2012-12-18 16:26:08 +01:00
schneems 8a59b87374 HTML formatting to Rails::InfoController#routes
This PR adds formatting and meta-data to the display of the internal routes. Users can now toggle between showing helpers with the `_path` or _`url` suffix. 

There are multiple ways to achieve this, this method uses partials for formatting and meta-data. The partials can be re-used when rendering `routing_error.erb`, though that will need to be in a separate PR.

![](http://f.cl.ly/items/3A2p3c1T1t2f2X2R2K2S/Screen%20Shot%202012-12-12%20at%202.28.01%20PM.png)


ATP Railties
2012-12-17 12:41:54 -06:00
Carlos Antonio da Silva df9f9b7f3e Convert changelogs to 1.9 hash style and fix some formatting [ci skip] 2012-12-14 20:25:22 -02:00
schneems baea5d69be Use Rails to Render Default Index Page
This is an alternative implementation to #7771 thanks to the advice of @spastorino

Rails is a dynamic framework that serves a static index.html by default. One of my first questions ever on IRC was solved by simply deleting my public/index.html file. This file is a source of confusion when starting as it over-rides any set "root" in the routes yet it itself is not listed in the routes. By making the page dynamic by default we can eliminate this confusion.

This PR moves the static index page to an internal controller/route/view similar to `rails/info`. When someone starts a rails server, if no root is defined, this route will take over and the "dynamic" index page from rails/welcome_controller will be rendered. These routes are only added in development. If a developer defines a root in their routes, it automatically takes precedence over this route and will be rendered, with no deleting of files required. 

In addition to removing this source of confusion for new devs, we can now use Rails view helpers to build and render this page. While not the primary intent, the added value of "dogfooding" should not be under-estimated.

The prior PR #7771 had push-back since it introduced developer facing files. This PR solves all of the same problems, but does not have any new developer facing files (it actually removes one). 

cc/ @wsouto, @dickeyxxx, @tyre, @ryanb, @josevalim, @maxim, @subdigital, @steveklabnik

ATP Railties and Actionpack.
2012-12-10 16:15:04 -08:00
kennyj a7695579a5 Add ENV['RACK_ENV'] support to rake runner/console/server. 2012-12-06 02:05:33 +09:00
Antonio Cangiano 553b563749 Add db to the list of default annotation folders 2012-12-01 12:23:39 -08:00
Yves Senn a1fd9cd1a0 require bundler groups to include rake-tasks in engines
If you generate a full engine, this will include rake tasks from
your gem under the `app` namespace. For example if you have a dependency
on `rspec-rails` in your engine's `gemspec`. You will get the task `app:spec`

Closes #8229
2012-11-18 18:03:27 +01:00
Yves Senn 7cb0c8852b cleanup, remove whitspace from railties CHANGELOG 2012-11-18 18:03:27 +01:00
Robert Nesius 716222c664 Adding sqlserver.yml template to satisfy "-d sqlserver" being given
invocations of "rails new".
2012-11-16 23:20:59 -06:00
Nicolas Despres f945178a60 Add ChangeLog entry. 2012-11-13 19:05:38 +01:00
Yves Senn 1785bf7d67 `plugin new` adds dummy app tasks when necessary.
Closes #8121

The `plugin new` generator always adds the dummy app rake tasks,
when a dummy app was created.
2012-11-08 13:08:19 +01:00
Steve Klabnik b3125c89f4 Make sure that RAILS_ENV is set when accessing Rails.env
Fixes #8025
2012-10-31 17:05:26 -07:00
Rafael Mendonça França 3663057518 Merge pull request #7587 from elia/fix-too-eager-loading
Should not eager_load app/assets
Conflicts:
	railties/CHANGELOG.md
2012-10-29 11:14:14 -02:00
Jeremy Kemper c8fe0d58bc Backpedal from class-oriented config.queue. Set an actual queue instance. 2012-10-12 22:27:41 -07:00
Brent J. Nordquist 06129c0e3f Add .rake to `rake notes` and `rake notes:custom` 2012-10-12 10:52:22 -05:00
Mike Moore 2a68f68aea Update test locations
Change the default test locations to avoid confusion around the common
testing terms "unit" and "functional".
Add new rake tasks for the new locations, while maintaining backwards
compatibility with the old rake tasks.

New testing locations are as follows:

    app/models -> test/models (was test/units)
    app/helpers -> test/helpers (was test/units/helpers)
    app/controllers -> test/controllers (was test/functional)
    app/mailers -> test/mailers (was test/functional)
2012-10-09 17:53:56 -06:00
Guillermo Iguaran 9f3d864855 Add missing entry in CHANGELOG about config.assets.cache change 2012-10-09 12:16:51 -05:00
Prem Sichanugrist 26fe77b27d Make Rails.public_path return a Pathname 2012-10-02 20:44:02 -04:00
Guillermo Iguaran 66ed71fd6f Remove highly uncommon `config.assets.manifest` option for moving the manifest path.
This option is now unsupported in sprockets-rails.
2012-09-19 18:02:37 -05:00
Guillermo Iguaran 1f4c89fbde Update changelogs to add entries about strong_parameters integration 2012-09-19 17:50:39 -05:00
Derek Prior ceb05bd1b2 change app/plugin generators to be more SCM agnostic
Users of other SCM's can now generate rails
apps that will add the "empty" directories to source control,
but will not have a useless .gitignore or mis-named .gitkeep
files.

* Change `rails new` and `rails plugin new` generators to name
  the `.gitkeep` 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.

It closes #2800.
2012-09-12 20:36:00 -05:00
Grace Liu 148c50b49a fixed support for DATABASE_URL for rake db tasks
- added tests to confirm establish_connection uses DATABASE_URL and
  Rails.env correctly even when no arguments are passed in.
- updated rake db tasks to support DATABASE_URL, and added tests to
  confirm correct behavior for these rake tasks.  (Removed
  establish_connection call from some tasks since in those cases
  the :environment task already made sure the function would be called)
- updated Resolver so that when it resolves the database url, it
  removes hash values with empty strings from the config spec (e.g.
  to support connection to postgresql when no username is specified).
2012-09-11 20:40:13 -07:00
needfeed 844ea9c07e Support MySQL SSL in rails dbconsole. 2012-09-10 12:36:49 -07:00
Xavier Noria 810a50dacf CHANGELOGs are now per branch
Changes in old branches needed to be manually synched in CHANGELOGs of newer ones.
This has proven to be brittle, sometimes one just forgets this manual step.
With this commit we switch to CHANGELOGs per branch. When a new major version is
cut from master, the CHANGELOGs in master start being blank.

A link to the CHANGELOG of the previous branch allows anyone interested to
follow the history.
2012-08-28 21:15:16 +02:00
José Valim 5d416b9078 Deprecate config.threadsafe! 2012-08-21 14:47:43 -03:00
Piotr Sarnacki 5b3bb61f3f Fix handling SCRIPT_NAME from within mounted engine's
When you mount your application at a path, for example /myapp, server
should set SCRIPT_NAME to /myapp. With such information, rails
application knows that it's mounted at /myapp path and it should generate
routes relative to that path.

Before this patch, rails handled SCRIPT_NAME correctly only for regular
apps, but it failed to do it for mounted engines. The solution was to
hardcode default_url_options[:script_name], which is not the best answer
- it will work only when application is mounted at a fixed path.

This patch fixes the situation by respecting original value of
SCRIPT_NAME when generating application's routes from engine and the
other way round - when you generate engine's routes from application.

This is done by using one of 2 pieces of information in env - current
SCRIPT_NAME or SCRIPT_NAME for a corresponding router. This is because
we have 2 cases to handle:

- generating engine's route from application: in this situation
  SCRIPT_NAME is basically SCRIPT_NAME set by the server and it
  indicates the place where application is mounted, so we can just pass
  it as :original_script_name in url_options. :original_script_name is
  used because if we use :script_name, router will ignore generating
  prefix for engine

- generating application's route from engine: in this situation we
  already lost information about the SCRIPT_NAME that server used. For
  example if application is mounted at /myapp and engine is mounted at
  /blog, at this point SCRIPT_NAME is equal /myapp/blog. Because of that
  we need to keep reference to /myapp SCRIPT_NAME by binding it to the
  current router. Later on we can extract it and use when generating url

Please note that starting from now you *should not* use
default_url_options[:script_name] explicitly if your server already
passes correct SCRIPT_NAME to rack env.

(closes #6933)
2012-08-11 00:21:46 +02:00
David Heinemeier Hansson fb883318c8 Revert "The application generator generates `public/humans.txt` with some basic data". I dont consider this something most people is going to want most of the time. If you want to add it in your own app, knock yourself out. But it doesnt belong in Rails imo 2012-08-07 11:18:00 -05:00
Aleksey Magusev 0cae7c60ac Add references statements to migration generator
AddXXXToYYY/RemoveXXXFromYYY migrations are produced 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
2012-07-08 23:03:05 +04:00
Carlos Antonio da Silva d79ca9288e Add changelog entry for polymorphic option in model generator
Pull request #6856, merged in 52f6e47682.
[ci skip]
2012-06-27 13:07:32 -03:00
Brian Cardarella d1d6c364d0 Updated Changelogs 2012-06-23 15:21:33 -04:00
José Valim 03f2249153 Use . instead of :: for class methods, add CHANGELOG entries 2012-06-10 11:38:37 +02:00