Commit Graph

26485 Commits

Author SHA1 Message Date
José Valim
0df2ef3ef4 Merge pull request #3884 from sikachu/master-fix_layout
Allow layout fallback when using `layout` method
2011-12-07 08:00:45 -08:00
Santiago Pastorino
4f107384f0 Merge pull request #3894 from kelyar/master
reversible migration example
2011-12-07 07:10:27 -08:00
Evgeniy Kelyarsky
dd647d938e reversible migration example had missing block parameter 2011-12-07 17:03:51 +02:00
José Valim
eb22901920 Merge pull request #3878 from kennyj/should_use_default_charset
Use default charset when we read content type without charset.
2011-12-07 04:07:51 -08:00
kennyj
a1986e7d55 Use default charset when we read content type without charset. 2011-12-07 12:35:44 +09:00
Prem Sichanugrist
18ceed201b Allow layout fallback when using layout method
Rails will now use your default layout (such as "layouts/application") when you specify a layout with `:only` and `:except` condition, and those conditions fail.

For example, consider this snippet:

    class CarsController
      layout 'single_car', :only => :show
    end

Rails will use 'layouts/single_car' when a request comes in `:show` action, and use 'layouts/application' (or 'layouts/cars', if exists) when a request comes in for any other actions.
2011-12-06 21:16:29 -05:00
Prem Sichanugrist
0460b3a469 Fix bug in assert_template when using only :layout option
Currently if you're do this:

    assert_template :layout => "foo"

Regardless of what layout you were using, the test will always pass. This was broken since the introduction of :layout option in [d9375f3f].

We have a lot of test cases in actionpack/test/controller/layout_test.rb that use this feature. This will make sure that those test cases are not true negative.
2011-12-06 21:15:27 -05:00
José Valim
885a599303 Just track "require" if we have something in the watching stack.
A patch has been provided earlier and we have asked for feedback:

    https://gist.github.com/1437939

Except one case, all other cases showed improvements in boot time.
2011-12-06 21:09:44 +01:00
Aaron Patterson
9dee540084 avoid deprecated methods 2011-12-06 10:07:47 -08:00
Vasiliy Ermolovich
0968ee3456 add prefix and suffix to renamed tables, closes #1510 2011-12-06 10:02:45 -08:00
Vijay Dev
7eb596cddd Merge branch 'master' of github.com:lifo/docrails 2011-12-06 23:05:43 +05:30
Vijay Dev
89647a305f Revert "Added link to ActiveResource::Base documentation"
This reverts commit 03d4388786.

Conflicts:

	activeresource/README.rdoc

Reason: I don't think this is absolutely necessary given the
fact that such links won't work in both GitHub and Rails API
at the same time. See links in rails/README.rdoc and rails/Rakefile
for some hackery that needs to be done to get such links work in
both places.
2011-12-06 22:58:23 +05:30
Vijay Dev
078b4b54a6 use textile syntax in links 2011-12-06 22:51:07 +05:30
Vijay Dev
d1bf7db55d rxml and rhtml are no longer searched for source code annotations 2011-12-06 22:50:37 +05:30
Vijay Dev
cec909d938 copy edits in layouts guide, change links to be relative 2011-12-06 22:49:22 +05:30
Santiago Pastorino
9be2353fac Sync AP CHANGELOG with 3-1-stable 2011-12-06 11:28:05 -02:00
Santiago Pastorino
e58d663f3e Merge pull request #3428 from adrianpike/asset_path_conflicts
Issue #3427 - asset_path_conflicts
2011-12-06 05:16:24 -08:00
José Valim
f0f0e59c10 Ensure length validator also works on 1.8.7. 2011-12-06 14:13:44 +01:00
sandeepravi
b5e333d5b0 Added link to ActiveResource::Base documentation 2011-12-06 18:09:42 +05:30
sandeepravi
03d4388786 Added link to ActiveResource::Base documentation 2011-12-06 18:03:41 +05:30
Thomas von Deyen
7e12aa7424 Added git --rebase option for pulling rails master 2011-12-06 13:26:57 +01:00
sandeepravi
bc994470c4 Added wiki link to REST 2011-12-06 17:50:16 +05:30
José Valim
d722eb3b04 Merge pull request #3876 from tvdeyen/string_as_url_for_expire_action
Allow string as url for expire_action
2011-12-06 04:11:59 -08:00
Thomas von Deyen
0da31a1839 Allowing string as url argument for expire_action 2011-12-06 13:05:15 +01:00
sandeepravi
8a67b632ae Added wiki link for REST 2011-12-06 17:22:48 +05:30
José Valim
81fec5dfc4 Merge pull request #3872 from marcandre/i18n_key
ActiveModel::Name#i18n_key: Fix doc and add tests
2011-12-06 00:41:43 -08:00
José Valim
1ee832b2d8 Merge pull request #3873 from iangreenleaf/no_default_tokenizer
Don't tokenize string when counting characters
2011-12-06 00:41:05 -08:00
Marc-Andre Lafortune
d834755dad ActiveModel::Name#i18n_key: Fix doc and add tests 2011-12-05 22:02:53 -05:00
Aaron Patterson
a2f7c1dc67 make method signatures match the superclass signature 2011-12-05 18:36:27 -08:00
Aaron Patterson
b942ae836e return value is never tested, so stop calling presence 2011-12-05 18:36:08 -08:00
Adrian Pike
25007ad3fb Let's do the same trick for asset_path that we do for [image,javascript,stylesheet]_path to avoid namespace conflicts on named routes.
Closes #3427
2011-12-05 17:17:39 -08:00
Aaron Patterson
8aa7b8695d Quitoting the table name before querying. 2011-12-05 14:20:14 -08:00
Aaron Patterson
988061ddb8 Merge pull request #3867 from jadeforrest/master
Increase performance for table_exists?
2011-12-05 14:15:50 -08:00
Uģis Ozols
d645aed91f Use do end for multiline block. 2011-12-05 23:11:20 +02:00
José Valim
38185f670e Merge pull request #3866 from ugisozols/master
Remove .rxml, .rjs and .rhtml from source annotation regexp.
2011-12-05 12:31:37 -08:00
Uģis Ozols
d2f46d053f Remove .rxml, .rjs and .rhtml from source annotation regexp. 2011-12-05 21:24:09 +02:00
Jade Rubick
73a331c2ac Speed up table_exists? for databases with a large number of tables
At New Relic, we have hundreds of thousands of tables, and our migrations took 30 minutes without this similar patch. This cuts it down to a more reasonable amount of time.

The rescue false part is ugly, but necessary as far as I can tell. I don't know of a cross-database statement you can make that will work without trapping errors.
2011-12-05 11:20:10 -08:00
Uģis Ozols
1c65962b9d .rhtml and .rxml was removed in Rails 3. 2011-12-05 20:40:48 +02:00
José Valim
f6cc4fd7a2 Merge pull request #3861 from andyjeffries/master
Named Routes shouldn't override existing ones (currently route recognition goes with the earliest match, named routes use the latest match)
2011-12-05 08:48:25 -08:00
José Valim
168c088735 Merge pull request #3863 from lest/params-wrapper-inflections
use classify in ParamsWrapper to derive model name from controller name
2011-12-05 08:46:10 -08:00
lest
1f0e21ce30 use classify in ParamsWrapper to derive model name from controller name 2011-12-05 19:15:36 +03:00
Andy Jeffries
71d769e3b5 Named Routes shouldn't override existing ones (currently route recognition goes with the earliest match, named routes use the latest match) 2011-12-05 15:41:38 +00:00
José Valim
d4964b3386 Namespaced attribute lookup now works as 'model/association.attribute'. 2011-12-05 15:39:41 +01:00
Sergey Parizhskiy
0bcac982b6 Merge branch 'master' of github.com:lifo/docrails 2011-12-05 16:25:25 +02:00
Sergey Parizhskiy
c9cc535d2b changes in the way of how the stylesheets_link_tag works 2011-12-05 16:25:02 +02:00
José Valim
2985151000 Merge pull request #3859 from kuroda/human_attribute_name
Fix human_attribute_name to handle names with dots
2011-12-05 06:09:33 -08:00
Tsutomu Kuroda
dff19f7be2 Fix human_attribute_name to handle names with dots
Nested I18n namespace lookup under activerecord.models is deprecated now (c19bd4f).
But when a model uses accepts_nested_attributes_for, its Errors object can have
an attribute name with "addresses.street" style. In this case, the dots should be
substituted with slashes so that we can provide the translation under the
"activemodel.attributes.person.addresses/street" key.
2011-12-05 22:57:47 +09:00
Jason Noble
c921ba97b8 Remove redundant or 2011-12-05 05:22:13 -07:00
Xavier Noria
be482bd6d6 Merge pull request #3858 from Overbryd/redirect_to_url_with_network_path_reference
redirect_to url with network path reference: Do not escape forward slashes within a curly regexp
2011-12-05 02:55:08 -08:00
Overbryd
9fb5ee8beb Minor enhancement by not unnecessarely escaping forward slashing within a curly regexp and by mentoining the protocol relative scheme in the internal comment 2011-12-05 11:48:05 +01:00