Commit Graph

3972 Commits

Author SHA1 Message Date
Rafael Mendonça França
5da4d5142a Add active_support/testing/autorun
minitest/autorun load minitest/spec polluting the global namespace with
the DSL that we don't want on Rails
2012-12-31 13:57:24 -03:00
Santiago Pastorino
219e831d15 Improve secret_token deprecation message 2012-12-30 15:43:40 -02:00
Jeremy Kemper
1e9d6e7b56 Revert "Install binstubs by default"
This reverts commit f34c27a452418d8aa17f92bb0fd7ae97b5f7e252.

We'll be taking a different tack on this with new `bundle binstubs <gem>` support.
2012-12-28 14:23:01 -07:00
Jeremy Kemper
a79300a0d8 Revert "Detect rbenv and update the shebang"
This reverts commit 7173c4f931c9026bd3bc0b644d93dae744433f09.
This reverts commit a562f9fa09967eba26dff1c3bc8aa85b6f0a72ff.
2012-12-28 14:21:24 -07:00
Jeremy Kemper
6b18a79abe Consistent punctuation for @jaroslawr :bowtie: 2012-12-27 13:48:09 -07:00
Rafael Mendonça França
d792737207 Merge pull request #8616 from senny/8612_respect_yaml_keywords
quote column names in generated fixture files
2012-12-26 07:20:46 -08:00
Yves Senn
edae4777ad quote column names in generated fixture files 2012-12-26 16:17:47 +01:00
David Heinemeier Hansson
61b91c4c55 Revert "Ignore /bin on new apps" -- given the move to default binstubs, we want you to check those in!
This reverts commit 35c554f0bf518e1068e79002a462c3deba649e9b.
2012-12-26 13:02:59 +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
Hrvoje Šimić
2e02752e8d remove duplication from Rails::Application docs 2012-12-24 02:50:32 +01:00
Yehuda Katz
a4d21f764c Fix spacing regression in scaffold generator 2012-12-22 23:05:53 -08:00
Guillermo Iguaran
e738acd080 Fix syntax error in controller template 2012-12-22 23:46:51 -05:00
José Valim
35c554f0bf Ignore /bin on new apps 2012-12-22 21:21:06 +01:00
Yehuda Katz
cb025f850c Add --no-html to scaffold generator 2012-12-22 12:18:13 -08:00
Yehuda Katz
7173c4f931 Detect rbenv and update the shebang 2012-12-22 11:13:10 -08:00
Yehuda Katz
f34c27a452 Install binstubs by default 2012-12-22 10:57:50 -08: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 b3125c89f42968bec6ee0b92ab93e36dbc36d5c3.

* 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
Andrew White
56fee39c39 Integrate Journey into Action Dispatch
Move the Journey code underneath the ActionDispatch namespace so
that we don't pollute the global namespace with names that may
be used for models.

Fixes rails/journey#49.
2012-12-19 22:13:08 +00:00
Rafael Mendonça França
7f96e4317e Revert "Merge pull request #7587 from elia/fix-too-eager-loading"
This reverts commit 3663057518eb9acf9b1e72f47dcb07038e6b7368.

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
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
37d9c44b6d Format routes as html on debug page
When someone gets a routing exception, the routes are rendered (starting in Rails 4.0). This PR brings parity between the html routes in the `rails/info/routes` path and when rendered from an exception. This is the continuation of #8521 which brought html formatted routes. 

In addition to bringing parity to the two views, we're keeping our views DRY by rendering off of the same partials. In this case Railties depends on partials provided by ActionDispatch. I'm open to alternative implementations. Ideally both views will use the same code so any improvements or updates to it will be reproduced on both.

<hr />

![](http://f.cl.ly/items/3O1D0K1v0j0i343O3T3T/Screen%20Shot%202012-12-17%20at%203.07.20%20PM.png)
2012-12-17 15:59:15 -06: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
Sam Ruby
b9eb784208 Remove blank lines from generated Gemfile
Introduced by 059bdc3415b0f1fb436c56a399a41b90fe3e87f0
2012-12-15 12:26:30 -05:00
Vijay Dev
5cc178a291 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	actionpack/lib/action_view/helpers/form_helper.rb
	railties/lib/rails/info_controller.rb
2012-12-15 21:20:28 +05:30
Vijay Dev
561e5ab82e copy editing [ci skip] 2012-12-15 21:15:05 +05:30
Vijay Dev
751dd9e4c2 Revert "Add quotes to Numeric Passwords to force string(sqlserver)"
This reverts commit d1e70cb7b410f5151b08af9b38b2d6d80c1c61c2.
2012-12-15 20:59:52 +05:30
Vijay Dev
df33446f7c Revert "Add quotes to Numeric Passwords to force string(jdbcmysql)"
This reverts commit 2f0311d79af01dc59ab3bd95cd6a56511258f917.
2012-12-15 20:59:35 +05:30
Vijay Dev
57bfd19ba4 Revert "Add quotes to Numeric Passwords to force string(jdbcpostgresql)"
This reverts commit db9b619f2851d7aeef9b239f6c19d0076faf5909.
2012-12-15 20:59:23 +05:30
Vijay Dev
5e42488f17 Revert "Add quotes to Numeric Passwords to force string(MySql)"
This reverts commit e5f8b2be64a74ce05e7c8b873d3e795e7bc68df5.
2012-12-15 20:58:40 +05:30
Vijay Dev
7124e39e0c Revert "Add quotes to Numeric Passwords to force string(Postgres)"
This reverts commit 6e72099a382c9731c7b40aa1b10237318e31ac92.

Reason: Feel that this isn't the right place.
2012-12-15 20:57:38 +05:30
Steve Klabnik
8554537e48 Revert "Merge pull request #8499 from schneems/schneems/html-route-inspector"
This reverts commit ae68fc3864e99ab43c18fd12577744e1583f6b64, reversing
changes made to 0262a18c7b0ab6f60fee842b3007388f9ffeb0fa.

See here: https://github.com/rails/rails/pull/8499#issuecomment-11356417
2012-12-14 15:44:57 -05:00
Gaurish Sharma
fcdc0d8335 Change method is default since rails 3.1 [ci skip]
Since Rails 3.1, change method is preferred for writing
migrations. Updated the example, because that command
would generate migration with change method.
2012-12-14 10:43:13 +05:30
Steve Klabnik
ae68fc3864 Merge pull request #8499 from schneems/schneems/html-route-inspector
Output routes in :html format
2012-12-13 08:30:51 -08:00
Teng Siong Ong
059bdc3415 don't include debugger gem if jruby is used since it doesn't work on jruby. 2012-12-12 21:58:29 -08:00
schneems
08d7b186fd Output routes in :html format
By formatting routes for different media (txt/html) we can apply optimizations based on the format. We can include meta-data in the HTML to allow a rich experience while rendering and viewing the routes. This PR shows route helpers as they are used with the `_path` extension, it also has a javascript toggle on the top to switch to `_url`. This way the developer can see the exact named route helper they can use instead of having to modify a base. 

This is one example of an optimization that could be applied. Eventually we can link out to guides for the different columns to better explain what helper, HTTP Verb, Path, and Controller#action indicate. We could even add a route search box that could allow developers to input a given route and see all of the routes that match it. These are stand alone features and should be delivered separately.
2012-12-12 14:21:02 -06:00
George Claghorn
9f5622f6a3 Explain how to supersede the new dynamic welcome page
The old, static welcome page instructed developers to delete the
public/index.html file and set a root route.  The new, dynamic welcome
page should tell developers (a) why they're seeing it when it doesn't
correspond to anything in the viewable app source and (b) that it can
be superseded with a root route.
2012-12-11 01:43:02 -05:00
Santiago Pastorino
603e7f7ea5 Merge pull request #8468 from schneems/schneems/rack-index-page
Use Rails to Render Default Index Page
2012-12-10 19:49:10 -08:00
Rafael Mendonça França
8dac9768b1 Make sure that no extra spaces are created with a non-polymorphic
attributes
2012-12-10 23:16:48 -03:00
Richard Schneeman
0807f6e861 Update railties/lib/rails/info_controller.rb
# :nodoc: the rails/info_controller
2012-12-10 16:15:30 -08: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
Rafael Mendonça França
9e42cd8686 Merge branch 'scaffold_fixes' 2012-12-10 00:36:31 -03:00
Rafael Mendonça França
05e6123653 Merge pull request #8472 from schneems/schneems/expand_path
Use `File.expand_path` instead of `File.join`
2012-12-09 19:05:00 -08:00
Rafael Mendonça França
95ccbd847d Add GeneratedAttribute#column_name to get the name of the column in the
database
2012-12-10 00:01:41 -03:00
Rafael Mendonça França
80735ff4c0 Extract a attributes_names method to avoid duplication 2012-12-10 00:01:41 -03:00
Rafael Mendonça França
b05b77be9c Deal with polymorphic attributes correctly in the generators 2012-12-10 00:01:41 -03:00
Rafael Mendonça França
4a487f94b9 Make references and belongs_to attributes to generate the _id column in
fixtures
2012-12-10 00:01:40 -03:00
Rafael Mendonça França
3d8fcdd3bf Put the reference and belongs_to attributes in the scaffold tests. 2012-12-10 00:01:40 -03:00
schneems
e073b038b7 Use File.expand_path instead of File.join
cc/ @carlosantoniodasilva
2012-12-09 17:51:58 -08:00
Gaurish Sharma
d1e70cb7b4 Add quotes to Numeric Passwords to force string(sqlserver)
If you have numeric password for your database, like below:
```yaml
development:
  adapter: mysql2
  encoding: utf8
  database: myblog_development
  pool: 5
  username: root
  password: 123456
```


you will get the following obscure error with unhelpful stack-trace

```shell
/home/gaurish/.rvm/gems/ruby-1.9.3-p286-perf/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': can't convert Fixnum into String (TypeError)
        from /home/gaurish/.rvm/gems/ruby-1.9.3-p286-perf/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:444:in `new_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:454:in `checkout_new_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:425:in `acquire_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:362:in `block in checkout'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `checkout'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:271:in `block in connection'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:270:in `connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:545:in `retrieve_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_handling.rb:53:in `connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/railtie.rb:153:in `block in <class:Railtie>'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:30:in `instance_exec'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:30:in `run'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:180:in `each'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:54:in `run_initializers'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:216:in `initialize!'
        from /home/gaurish/code/repo/rails/railties/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from /tmp/numericpass/config/environment.rb:5:in `<top (required)>'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:190:in `require'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:190:in `require_environment!'
        from /home/gaurish/code/repo/rails/railties/lib/rails/commands.rb:70:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
```
Looking [Can't convert fixnum to string during rake db:create](http://stackoverflow.com/questions/3765834/cant-convert-fixnum-to-string-during-rake-dbcreate), it seems lot of people have faced the same error.

so adding a note informing about numeric passwords seems like a good idea
2012-12-10 01:31:39 +05:30
Gaurish Sharma
2f0311d79a Add quotes to Numeric Passwords to force string(jdbcmysql)
If you have numeric password for your database, like below:
```yaml
development:
  adapter: mysql2
  encoding: utf8
  database: myblog_development
  pool: 5
  username: root
  password: 123456
```


you will get the following obscure error with unhelpful stack-trace

```shell
/home/gaurish/.rvm/gems/ruby-1.9.3-p286-perf/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': can't convert Fixnum into String (TypeError)
        from /home/gaurish/.rvm/gems/ruby-1.9.3-p286-perf/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:444:in `new_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:454:in `checkout_new_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:425:in `acquire_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:362:in `block in checkout'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `checkout'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:271:in `block in connection'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:270:in `connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:545:in `retrieve_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_handling.rb:53:in `connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/railtie.rb:153:in `block in <class:Railtie>'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:30:in `instance_exec'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:30:in `run'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:180:in `each'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:54:in `run_initializers'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:216:in `initialize!'
        from /home/gaurish/code/repo/rails/railties/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from /tmp/numericpass/config/environment.rb:5:in `<top (required)>'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:190:in `require'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:190:in `require_environment!'
        from /home/gaurish/code/repo/rails/railties/lib/rails/commands.rb:70:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
```
Looking [Can't convert fixnum to string during rake db:create](http://stackoverflow.com/questions/3765834/cant-convert-fixnum-to-string-during-rake-dbcreate), it seems lot of people have faced the same error.

so adding a note informing about numeric passwords seems like a good idea
2012-12-10 01:28:09 +05:30
Gaurish Sharma
db9b619f28 Add quotes to Numeric Passwords to force string(jdbcpostgresql)
If you have numeric password for your database, like below:
```yaml
development:
  adapter: mysql2
  encoding: utf8
  database: myblog_development
  pool: 5
  username: root
  password: 123456
```


you will get the following obscure error with unhelpful stack-trace

```shell
/home/gaurish/.rvm/gems/ruby-1.9.3-p286-perf/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': can't convert Fixnum into String (TypeError)
        from /home/gaurish/.rvm/gems/ruby-1.9.3-p286-perf/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:444:in `new_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:454:in `checkout_new_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:425:in `acquire_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:362:in `block in checkout'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `checkout'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:271:in `block in connection'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:270:in `connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:545:in `retrieve_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_handling.rb:53:in `connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/railtie.rb:153:in `block in <class:Railtie>'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:30:in `instance_exec'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:30:in `run'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:180:in `each'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:54:in `run_initializers'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:216:in `initialize!'
        from /home/gaurish/code/repo/rails/railties/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from /tmp/numericpass/config/environment.rb:5:in `<top (required)>'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:190:in `require'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:190:in `require_environment!'
        from /home/gaurish/code/repo/rails/railties/lib/rails/commands.rb:70:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
```
Looking [Can't convert fixnum to string during rake db:create](http://stackoverflow.com/questions/3765834/cant-convert-fixnum-to-string-during-rake-dbcreate), it seems lot of people have faced the same error.

so adding a note informing about numeric passwords seems like a good idea
2012-12-10 01:26:26 +05:30
Gaurish Sharma
e5f8b2be64 Add quotes to Numeric Passwords to force string(MySql)
If you have numeric password for your database, like below:
```yaml
development:
  adapter: mysql2
  encoding: utf8
  database: myblog_development
  pool: 5
  username: root
  password: 123456
```
you will get the following obscure error with unhelpful stack-trace

```shell
$ c
/home/gaurish/.rvm/gems/ruby-1.9.3-p286-perf/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': can't convert Fixnum into String (TypeError)
        from /home/gaurish/.rvm/gems/ruby-1.9.3-p286-perf/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:444:in `new_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:454:in `checkout_new_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:425:in `acquire_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:362:in `block in checkout'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `checkout'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:271:in `block in connection'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:270:in `connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:545:in `retrieve_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_handling.rb:53:in `connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/railtie.rb:153:in `block in <class:Railtie>'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:30:in `instance_exec'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:30:in `run'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:180:in `each'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:54:in `run_initializers'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:216:in `initialize!'
        from /home/gaurish/code/repo/rails/railties/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from /tmp/numericpass/config/environment.rb:5:in `<top (required)>'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:190:in `require'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:190:in `require_environment!'
        from /home/gaurish/code/repo/rails/railties/lib/rails/commands.rb:70:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
```
Looking [Can't convert fixnum to string during rake db:create](http://stackoverflow.com/questions/3765834/cant-convert-fixnum-to-string-during-rake-dbcreate), it seems lot of people have faced the same error.

so adding a note informing about numeric passwords seems like a good idea
2012-12-10 01:22:25 +05:30
Gaurish Sharma
6e72099a38 Add quotes to Numeric Passwords to force string(Postgres)
If you have numeric password for your database, like below:
```yaml
development:
  adapter: mysql2
  encoding: utf8
  database: myblog_development
  pool: 5
  username: root
  password: 123456
```
you will get the following obscure error with unhelpful stack-trace

```shell
$ c
/home/gaurish/.rvm/gems/ruby-1.9.3-p286-perf/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': can't convert Fixnum into String (TypeError)
        from /home/gaurish/.rvm/gems/ruby-1.9.3-p286-perf/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:444:in `new_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:454:in `checkout_new_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:425:in `acquire_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:362:in `block in checkout'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `checkout'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:271:in `block in connection'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:270:in `connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:545:in `retrieve_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/connection_handling.rb:53:in `connection'
        from /home/gaurish/code/repo/rails/activerecord/lib/active_record/railtie.rb:153:in `block in <class:Railtie>'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:30:in `instance_exec'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:30:in `run'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:180:in `each'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
        from /home/gaurish/.rvm/rubies/ruby-1.9.3-p286-perf/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
        from /home/gaurish/code/repo/rails/railties/lib/rails/initializable.rb:54:in `run_initializers'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:216:in `initialize!'
        from /home/gaurish/code/repo/rails/railties/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from /tmp/numericpass/config/environment.rb:5:in `<top (required)>'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:190:in `require'
        from /home/gaurish/code/repo/rails/railties/lib/rails/application.rb:190:in `require_environment!'
        from /home/gaurish/code/repo/rails/railties/lib/rails/commands.rb:70:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
```
Looking [Can't convert fixnum to string during rake db:create](http://stackoverflow.com/questions/3765834/cant-convert-fixnum-to-string-during-rake-dbcreate), it seems lot of people have faced the same error. 

so adding a note informing about numeric passwords seems like a good idea
2012-12-10 01:20:36 +05:30
Rafael Mendonça França
b4b8c26b6e Use the references and belongs_id ids in the scaffold_controller
generator
2012-12-09 16:32:54 -03:00
Rafael Mendonça França
6897a83f4e Remove the spaces after the open bracket and before the close bracket.
All our generated code follow this rule
2012-12-09 13:57:56 -03:00
George Claghorn
6e0eb9235a Make code statistics rake task handle new test locations properly
As of 2a68f68aead9fd65ecac8062ca8efc15f5bab418:

- Unit tests are now in test/models, instead of test/units
- Functional tests are now in test/controllers, instead of
  test/functional
- Helper tests are now in test/helpers, instead of test/units/helpers
- Mailer tests are now in test/mailers, instead of test/functional

Update the rake task for code statistics (`rake stats`) so that it
recognizes files in the above locations as tests, and accurately
calculates statistics such as "Test LOC" and "Code to Test Ratio."
Safely handle Rails apps that still have tests in the old locations.
2012-12-09 00:04:36 -05:00
Carlos Antonio da Silva
314e4bbaea Fix method assertion ensuring it will match "end" with the same indentation
Otherwise it was matching "end" lines from blocks within the method body,
making tests such as the migration ones fail.
2012-12-08 20:40:35 -02:00
Carlos Antonio da Silva
49295e72d3 Merge pull request #8461 from frodsan/fix_assert_method_generators
Fix #assert_instance_method to also assert indented methods
2012-12-08 08:00:52 -08:00
Francesco Rodriguez
0e027f4fe3 Fix #assert_instance_method to also assert indented methods 2012-12-08 09:44:45 -05:00
Carlos Antonio da Silva
bef330803a Merge pull request #8395 from bmaland/attr_accessors
Use attr_accessor for Rails.{application,cache,logger}
2012-12-08 06:14:17 -08:00
Francesco Rodriguez
a3c29b70a9 use :only instead of :except callback option in the controller template
As [Security Guide](http://edgeguides.rubyonrails.org/security.html#whitelists-versus-blacklists)
says, it's better to use `before_filter only: []` instead of `except: []`
so we don't forget to turn the filter off for newly added actions.
2012-12-07 19:31:14 -05:00
David Heinemeier Hansson
339e4e80d5 Let the scaffold example use the "set shared record" pattern to explain callbacks 2012-12-07 20:38:53 +01:00
Nick Reed
b8b9b766b7 Revert turbolinks load order requirement 2012-12-05 11:51:16 -06:00
kennyj
a7695579a5 Add ENV['RACK_ENV'] support to rake runner/console/server. 2012-12-06 02:05:33 +09:00
Andrew White
e905639af2 Merge pull request #8404 from freegenie/filter_redirects 2012-12-05 02:21:44 -08:00
Fabrizio Regini
86e3aaab93 Adding filter capability to ActionController logs 2012-12-05 11:07:14 +01:00
claudiob
019df98875 Replace comments' non-breaking spaces with spaces
Sometimes, on Mac OS X, programmers accidentally press Option+Space
rather than just Space and don’t see the difference. The problem is
that Option+Space writes a non-breaking space (0XA0) rather than a
normal space (0x20).

This commit removes all the non-breaking spaces inadvertently
introduced in the comments of the code.
2012-12-04 22:11:54 -08:00
David Heinemeier Hansson
225989316f Track the default application.css/js files for turbolinks as per version 0.6.0 2012-12-04 16:39:37 +01:00
Yasuharu Ozaki
13ba4fe6f6 Locate =require turbolinks at the bottom of application.js
Turbolinks should be located at the bottom of application.js
to detect assets change properly.
2012-12-04 11:18:44 +09:00
kennyj
0f47c49678 Fix wrong doc and message about rails profiler. 2012-12-04 02:21:31 +09:00
Rafael Mendonça França
7730655073 Merge pull request #8394 from acangiano/add_db_folder_to_annotations
Add db to the list of default annotation folders
2012-12-01 21:48:46 -08:00
Matthew M. Boedicker
368e4f0eef Quote ~ in git config global excludes command.
This will put ~/ in .gitconfig so it will not be hardcoded to the home
directory where the command was run.
2012-12-01 15:14:01 -08:00
Bjørn Arild Mæland
b9d1d2cdda Use attr_accessor for Rails.{application,cache,logger} 2012-12-01 21:41:54 +01:00
Antonio Cangiano
553b563749 Add db to the list of default annotation folders 2012-12-01 12:23:39 -08:00
Amparo Luna
8fc0c98ec1 Gemfile source url for plugins updated 2012-11-29 11:23:32 -05:00
Rafael Mendonça França
ccecab3ba9 Remove observers and sweepers
They was extracted from a plugin.

See https://github.com/rails/rails-observers

[Rafael Mendonça França + Steve Klabnik]
2012-11-28 22:46:49 -02:00
Rafael Mendonça França
5b9c9026c4 Revert "Merge pull request #8341 from amatsuda/bundle_source_rubygems"
This reverts commit 33b29e0112db62d3a8c798bb58f51c0a839d9e26, reversing
changes made to ac8c729342e6b020a57d0d6887c8a8d5b39f96e0.

Reason:

https://github.com/rails/rails/pull/4684#commitcomment-920313
2012-11-27 14:59:58 -02:00
Akira Matsuda
4ed645b37e default source in Gemfiles to :rubygems rather than hardcoding the URL
* I guess this would be the preferrable default for Bundler
* current version of Bundler converts :rubygems into 'http://rubygems.org', not https://,
  and that will help those who are working on a very poor network environment that doesn't allow SSL
2012-11-28 01:15:02 +09:00
Arun Agrawal
4a7a858ae7 Initialize accessors to remove some warnings in Ruby 2.0 2012-11-21 00:48:21 +05:30
Gaurish Sharma
61425f2c6d Better Error handling when parsing database.yaml
Provides a better error message incase the database.yaml
has some errors.
2012-11-20 17:04:47 +05:30
Rafael Mendonça França
133cdf0ec0 Merge pull request #8262 from senny/8229_correct_bundler_require_in_engines
require bundler groups to include rake-tasks in engines
2012-11-19 06:14:58 -08:00
Carlos Antonio da Silva
12d32ddea2 Refactor config abort message a bit for dbconsole
Remove not used variable.
Remove config attr_reader causing warning.
Fix indent in runner file.
2012-11-18 23:59:20 -02:00
Carlos Antonio da Silva
53aefdec91 Fix rails db command with sqlite3 database
When using sqlite3 it was attempting to find the database file based on
Rails.root, the problem is that Rails.root is not always present because
we try to first manually load "config/database.yml" instead of loading
the entire app, to make "rails db" faster.

This means that when we're in the root path of the app, calling "rails db"
won't allow us to use Rails.root, making the command fail for sqlite3
with the error:

    ./rails/commands/dbconsole.rb:62:in `start':
      undefined method `root' for Rails:Module (NoMethodError)

The fix is to simply not pass any dir string to File.expand_path, which
will make it use the current directory of the process as base, or the
root path of the app, which is what we want.

When we are in any other subdirectory, calling "rails db" should work
just fine, because "config/database.yml" won't be found, thus "rails db"
will fallback to loading the app, making Rails.root available.

Closes #8257.
2012-11-18 23:52:39 -02:00
Yves Senn
e63a97d4e5 refactor the naming within plugin new generator
Having a method called `full?`, which checks on :full and :mountable
is very confusing. I renamed `full?` to `engine?` and created a `full?`
method that only checks the `:full` option
2012-11-18 18:52:10 +01: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
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
Vijay Dev
7b70eeed43 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	actionpack/lib/action_dispatch/routing/redirection.rb
2012-11-17 01:50:49 +05:30
Santiago Pastorino
8eefdb6d70 Add UpgradeSignatureToEncryptionCookieStore
This allows easy upgrading from the old signed Cookie Store <= 3.2
or the deprecated one in 4.0 (the ones that doesn't use key derivation)
to the new one that signs using key derivation
2012-11-16 17:29:26 -02:00
Carlos Antonio da Silva
2bad4d2842 Remove config.threadsafe! from production env template
Closes #8232 [ci skip]
2012-11-16 09:44:59 -02:00
Santiago Pastorino
ef8b845de7 Merge pull request #8112 from rails/encrypted_cookies
Encrypted cookies
2012-11-15 12:17:25 -08:00
Guillermo Iguaran
8132bb6f79 Update production.rb: Split long comment in two lines 2012-11-12 11:35:06 -05:00
Guillermo Iguaran
40f5f31952 Update production.rb documentation: only files in app/assets are in config.assets.precompile 2012-11-12 11:19:20 -05:00
Nicolas Despres
df822961ee Rake test:uncommitted finds git directory in ancestors.
Sometimes your git directory is an ancestor of your application root
directory.

For example:
 ./repo/.git/
 ./repo/app/Rakefile

In this case rake test:uncommitted will be unable to detect your SCM.

This patch fixes this and add a test.
2012-11-10 20:39:04 +01:00
Arun Agrawal
c33c991eab Removing warning : assigned but unused variable 2012-11-10 17:34:39 +05:30
Aaron Patterson
3ae8d6d67c make the extremely useful logs debug level 2012-11-09 13:49:46 +09:00
Aaron Patterson
e61ffe060e copy the log level from the config settings 2012-11-09 13:46:18 +09: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
Carlos Antonio da Silva
1fef1bedbc Remove some line breaks between array items that make the assert file tests harder to read 2012-11-04 19:22:05 -02:00
Santiago Pastorino
4faa041845 Rename secret_token_key to secret_key_base 2012-11-03 14:57:54 -02:00
Santiago Pastorino
851e8fe897 Cache generated keys per KeyGenerator instance using salt + key_size 2012-11-03 14:57:54 -02:00
Santiago Pastorino
47da574474 Allow users to change the default salt if they want, shouldn't be necessary 2012-11-03 14:57:54 -02:00
Santiago Pastorino
5d23925f84 Use derived keys everywhere, http_authentication was missing it 2012-11-03 14:57:54 -02:00
Santiago Pastorino
fb0cea2b8c Add encrypted cookie store 2012-11-03 14:57:54 -02:00
Santiago Pastorino
e272000c80 Warn config.derive_keys will be true by default in 4.1 2012-11-03 14:57:53 -02:00
Santiago Pastorino
60609bb50d Sign cookies using key deriver 2012-11-03 14:57:53 -02: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
Alexey Gaziev
b955939d55 Make caller attribute in deprecation methods optional 2012-10-30 10:23:41 +08:00
Nikita Afanasenko
0b7067d849 Provide a call stack for deprecation warnings where needed.
It's sometimes hard to quickly find where deprecated call was performed, especially in case of migrating between Rails versions. So this is an attempt to improve the call stack part of the warning message by providing caller explicitly.
2012-10-29 19:22:59 +04: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
Rafael Mendonça França
2e44dda27a USe the released version of sprockets-rails in a new Rails 4 application 2012-10-27 16:49:34 -02:00
Jeremy Kemper
bf2009f995 Job consumer logs to Rails.logger by default 2012-10-26 16:18:52 -07:00
Geoffrey Roguelon
1f74315f85 Remove extra line in Gemfile under turbolinks. 2012-10-21 20:17:23 +02:00
Vijay Dev
f938019da2 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	activesupport/lib/active_support/core_ext/hash/slice.rb
	guides/source/active_support_core_extensions.md
2012-10-21 18:49:19 +05:30
Rafael Mendonça França
bfc6c17a87 We don't need this anymore since we had a sprockets-rails release 2012-10-19 22:27:20 -03:00
Robb Shecter
b83e0c3f29 Corrected the logic in production.rb comment. 2012-10-18 22:41:31 -07:00
Rafael Mendonça França
90733e70d7 Don't use action_controller.perform_caching to enable rack-rack.
Setting the action_dispatch.rack_cache options to true or a hash should
be the way to enable it.
2012-10-18 14:34:26 -03:00
Rafael Mendonça França
12fb9372bf Fix the app_generator and plugin_new tests 2012-10-18 14:34:26 -03:00
Rafael Mendonça França
fc32ff4ee3 Now the Sprockets railtie lives in sprockets/railtie 2012-10-18 01:03:24 -03:00
Joshua Peek
d88b65f986 Change back to official sprockets-rails 2012-10-17 21:51:37 -05:00
Rafael Mendonça França
0dfebbcd8e Merge pull request #7968 from josh/only-precompile-app-assets-by-default
Only compile non-js/css under app/assets by default
2012-10-17 19:18:09 -07:00
Joshua Peek
117d5e3bbb Only compile non-js/css under app/assets by default 2012-10-16 14:17:41 -05:00
AvnerCohen
d761eab42b Moving code base to 1.9 hash syntax 2012-10-16 05:08:10 +02:00
Joshua Peek
b8c7e31a57 Switch to new sprockets-rails plugin 2012-10-15 18:22:12 -05:00
Joshua Peek
eafc2b0580 Use sprockets-rails master 2012-10-15 11:46:05 -05:00
Joshua Peek
8d7fc73e98 Use sprockets-rails branch for now 2012-10-15 10:22:22 -05:00
Joshua Peek
c800e27ad3 Merge branch 'master' into asset-path-helper
Conflicts:
	railties/test/application/configuration_test.rb
2012-10-15 10:20:50 -05:00
Joshua Peek
7dba1599d9 Remove old asset_path from rails config 2012-10-15 09:51:20 -05:00
AvnerCohen
c615161585 Hash syntax to 1.9 style 2012-10-15 00:19:07 +02:00
Robin Dupret
5ad7f8ab41 Use Ruby 1.9 Hash syntax in railties 2012-10-14 18:26:58 +02:00
Jeremy Kemper
1fd8926056 Test that a Rails.queue consumer is automatically started in production 2012-10-13 09:54:34 -07:00
Jeremy Kemper
c8fe0d58bc Backpedal from class-oriented config.queue. Set an actual queue instance. 2012-10-12 22:27:41 -07:00
Jeremy Kemper
775829869e Remove the queue container. Premature consolidation. Set up and maintain queues in the classes that use them instead. 2012-10-12 19:38:40 -07:00
José Valim
32b4d46484 Merge pull request #7891 from schneems/schneems/rake_command_warning
Prompt to run rake when accidentally typed rails
2012-10-12 18:23:50 -07:00
schneems
20385ec6b1 Prompt to run rake when accidentally typed rails
Developers from all levels will accidentally run rake tasks using the `rails` keyword when they meant to use `rake`. Often times beginners struggle with the difference between the tools. The most common example would be `$ rails db:migrate`

Rather than telling the developer simply that they did not use a valid rails command, we can see if it was a valid rake command first. If it is a valid rake command we can auto execute it giving the user a period of time to cancel if that isn't what they intended.

Here is what `rake db:migrate` would look like if you cancel the command:


```sh
$ rails db:migrate
Assuming you meant: $ rake db:migrate 
press any key to cancel in 3 seconds
> 
command terminated ...
```

Here is what it looks like if you don't cancel the command:

```sh
$ rails db:migrate
Assuming you meant: $ rake db:migrate 
press any key to cancel in 3 seconds
> 
Running: $ rake db:migrate 
==  Foo: migrating ============================================================
==  Foo: migrated (0.0000s) ===================================================
```
2012-10-12 13:08:10 -10:00
Brent J. Nordquist
06129c0e3f Add .rake to rake notes and rake notes:custom 2012-10-12 10:52:22 -05:00
Jeremy Kemper
79db8db415 Immediately run queued jobs in tests. Otherwise you have to explicitly drain the queue to actually deliver your emails. 2012-10-12 07:49:44 -07:00
Vijay Dev
e40f515a75 Fixing build failures
Build failed with an error "invalid multibyte char (US-ASCII)" in these
files. Apparently, some UTF-8 char disguised as whitespace causes this.

Thanks @rafaelfranca
2012-10-11 02:05:25 +05:30
Vijay Dev
2441160c05 Merge pull request #7898 from olivierlacan/pg_homebrew_instructions
Offer instructions for pg gem when installed via Homebrew
2012-10-10 12:45:36 -07:00
Vijay Dev
f638ef951b Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	activerecord/lib/active_record/persistence.rb
	railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb
2012-10-11 01:05:14 +05:30
Vijay Dev
3401d5089b fix github url [ci skip] 2012-10-11 01:02:41 +05:30
Vijay Dev
6754777adf copy-edit the email delivery errors comment 2012-10-11 00:59:29 +05:30
David Heinemeier Hansson
affd05d28b Merge branch 'master' of github.com:rails/rails 2012-10-10 19:21:11 +02:00
Olivier Lacan
58d69a536c Offer instructions for pg gem when installed via Homebrew 2012-10-10 11:02:32 -04: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
fbfea9e98d Rails.config doesn't exist, it should be Rails.application.config instead 2012-10-09 11:17:22 -05:00
claudiob
44592334d5 Remove duplicate 'the' article in commented line
The sentence used to read "at the bottom of the the compiled file"
2012-10-08 14:00:59 -07:00
David Heinemeier Hansson
43e14f8ff2 Merge pull request #7873 from steveklabnik/update_initializer
Moving locale stuff from app.rb to an initializer.
2012-10-08 09:08:27 -07:00
David Heinemeier Hansson
1fc7954685 There is already an invitation to use rack-cache in config/environments/production.rb 2012-10-08 18:06:54 +02:00