Commit Graph

1757 Commits

Author SHA1 Message Date
David Heinemeier Hansson
201f8d7753 config.assets.enabled is now true by default 2013-01-05 17:56:53 +01:00
Carlos Antonio da Silva
7a34e0b1bd Remove warning "ambiguous first argument" 2013-01-05 09:45:34 -02:00
Rafael Mendonça França
1401f96492 Rename the configuration to raise_on_unpermitted_parameters
Also changed the exception to UnpermittedParameters
2013-01-05 06:39:51 -03:00
Rafael Mendonça França
58f52677e8 Ensure that raise_on_unexpected_params configuration will work 2013-01-05 06:23:28 -03:00
Rafael Mendonça França
fab7c53585 Merge pull request #8633 from mykola-kyryk/issue_8628
Allow environment name to start with a substring of the default
environment names.

Fixes #8628
2013-01-04 14:03:24 -08:00
Akira Matsuda
ab3cf010ad fix failing test broken in 15fb7889c5566ddade1d8f74f49bbbc1c0be6057 2013-01-05 05:44:03 +09: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
Rafael Mendonça França
39374aa925 Set the default timezone after the initialization since the configuration
now lives in the application initializers.

Fix #8711
2013-01-04 00:25:08 -03:00
Guillermo Iguaran
cb2bd4aa61 Merge pull request #8705 from amparo-luna/change_update_attributes_to_update
Rename update_attributes method to update
2013-01-03 09:09:59 -08:00
Amparo Luna + Guillermo Iguaran
0433d79724 Updating default application templates to use update instead of update_attributes 2013-01-03 12:04:25 -05:00
Akira Matsuda
1030b7b2d6 test PATCH method for update action in generated scaffold controller test rather than PUT 2013-01-03 20:21:18 +09:00
Andre Arko
75dcdbc84e Restore original remote_ip algorithm.
Proxy servers add X-Forwarded-For headers, resulting in a list of IPs. We
remove trusted IP values, and then take the last given value, assuming that
it is the most likely to be the correct, unfaked value. See [1] for a very
thorough discussion of why that is the best option we have at the moment.

[1]: http://blog.gingerlime.com/2012/rails-ip-spoofing-vulnerabilities-and-protection/

Fixes #7979
2013-01-02 15:26:27 -08:00
Santiago Pastorino
cf2dcf4e9f Merge pull request #8666 from mekishizufu/fix_lambdas
Fix usage of lambda as a Rack endpoint
2012-12-31 09:09:11 -08:00
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
Rafael Mendonça França
eb4930e3c7 Inherit from MiniTest::Unit::TestCase instead of MiniTest::Spec 2012-12-31 13:57:23 -03:00
Jiri Pospisil
dbacb95a21 Fix usage of lambda as a Rack endpoint
The response body needs to respond_to? :each.
2012-12-31 17:46:19 +01: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
Rafael Mendonça França
899cae25ec Consistent use of single and double quotes 2012-12-26 12:23:39 -03:00
Yves Senn
edae4777ad quote column names in generated fixture files 2012-12-26 16:17:47 +01:00
Carlos Antonio da Silva
7ab469c839 Merge pull request #8588 from marcandre/fix_reversible
Fix Migration#reversible by not using `transaction`.
2012-12-23 08:16:07 -08:00
Marc-Andre Lafortune
a4932d6a63 Fixes for PR [#8267]
* Fix Migration#reversible by not using `transaction`.

* Adapt mysql adapter to updated api for remove_column

* Update test after aedcd683684d08eaf30623a4b48ce31a31426372
2012-12-22 20:40:42 -05:00
Yehuda Katz
a562f9fa09 Forgot to check in railties fixture for binstubs 2012-12-22 12:18:35 -08: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
6b692ee37c Correctly shows RAILS_ENV=development even when ENV['RAILS_ENV'] is not set (e.g., in Pow)
* Fixes #8025
2012-12-21 17:41:39 -05:00
Marc-Andre Lafortune
aedcd68368 Migration generators use change even for destructive methods [#8267] 2012-12-21 13:54:52 -05:00
Marc-Andre Lafortune
29ed612bd9 Simple replacement of variable name for consistency 2012-12-21 13:54:50 -05:00
Carlos Antonio da Silva
ebef8e944a Revert "Add test to deprecation of Path#children"
This reverts commit 29b1dc273e1ad6b9e13bf48fe3f12047850f9554.

Conflicts:
	railties/test/application/paths_test.rb

Reason: since 7f96e4317e1354852e9600becb16662de3c17691 was reverted,
Path#children is no longer deprecated.
2012-12-19 09:37:19 -02:00
Francesco Rodriguez
411e499677 update concerned tests 2012-12-18 17:25:16 -05: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
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
Steve Klabnik
a8864aafe9 Revert "Fix failing test in railties"
This reverts commit 6bdc04624dcc0f45aab93af42d00224f67da36d5.

This has been reverted because 8554537e48
2012-12-14 15:51:12 -05:00
Andrew White
01d3a36bfe Clear url helper methods when routes are reloaded
Remove all the old url helper methods when clear! is called on the
route set because it's possible that some routes have been removed.
2012-12-14 13:22:36 +00:00
Carlos Antonio da Silva
6bdc04624d Fix failing test in railties
Related to the HTML route inspector changes:
ae68fc3864e99ab43c18fd12577744e1583f6b64
2012-12-14 09:38:31 -02:00
Arun Agrawal
601cc60a1b Fixed test names for generated_attribute_test.rb 2012-12-13 10:29:07 +05:30
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
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
190f638d39 Ensure the scaffold tests will pass when using references attributes 2012-12-10 00:35:03 -03: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
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
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
95b7b02d12 Add test case for scaffold_controller generator without attributes.
This is a test for 978c568a7bffe354180aaefa471092182fed1015
2012-12-09 16:32:54 -03:00
Carlos Antonio da Silva
1233fc6de1 Fix scaffold controller generator tests 2012-12-08 14:37:15 -02:00
Francesco Rodriguez
cd526fe425 fix scaffold controller generator tests 2012-12-07 20:35:43 -05:00