Commit Graph

32424 Commits

Author SHA1 Message Date
Jon Leighton
85098e4b31 Avoid #fetch for non-nil values.
This is purely a performance optimisation.

See https://gist.github.com/3552829
2012-08-31 17:15:22 +01:00
Jon Leighton
86c3dfbd47 Key the attributes hash with symbols
This is a performance/GC optimisation.

In theory, this could be optimised by the implementation (last time I
checked, this would have no effect on JRuby). But in practise, this make
attribute access faster.
2012-08-31 16:55:08 +01:00
Jon Leighton
e96558f813 Cache the connection pool for a given class 2012-08-31 15:56:28 +01:00
Jon Leighton
ba1544d716 One hash is enough
We don't need separate @class_to_pool and @connection_pool hashes.
2012-08-31 15:56:27 +01:00
Jon Leighton
4a274ed1d2 Refactor connection handler 2012-08-31 15:56:27 +01:00
Jon Leighton
221571beb6 Make connection pool retrieval faster
* Loop rather than recurse in retrieve_connection_pool
* Key the hash by class rather than class name. This avoids creating
  unnecessary strings.
2012-08-31 15:56:27 +01:00
Jon Leighton
ae79c7a201 Revert "Merge pull request #7452 from arunagw/memcached_dalli"
This reverts commit 7256cb53e0c34e510a4d59a50d120c0358cf1d99, reversing
changes made to 6ebe22c3ae716d089af1e5090ddb0d12b31af8ac.

Reason: A test was failing.
2012-08-31 15:54:31 +01:00
Jon Leighton
cd150c96e3 Revert "Add missing require"
This reverts commit e4b33b08d6d2b88b627b1e52c4f349e57c5b89fc.

https://github.com/rails/rails/pull/7452#issuecomment-8094302
2012-08-31 15:54:31 +01:00
Xavier Noria
d659406e24 Merge pull request #7479 from eriko/master
the example for contraint( :ip => XXXX) has an invalid regex
2012-08-31 04:45:32 -07:00
José Valim
c0b6963049 Instrumentation requires RackDelegation
Since it uses request and response methods
2012-08-30 18:40:30 -03:00
Rafael Mendonça França
404ddd2860 Merge pull request #7485 from kennyj/fix_build_20120830
Fix build about TemplateDigestorTest.
2012-08-30 08:10:28 -07:00
kennyj
5225c1a472 Fix build about TemplateDigestorTest. 2012-08-30 23:55:42 +09:00
Rafael Mendonça França
66c31dd2b8 Merge pull request #7484 from kennyj/fix_warning_20120830
Fixes warning: & interpreted as argument prefix
2012-08-30 07:16:32 -07:00
kennyj
d30977c758 Fixes warning: & interpreted as argument prefix 2012-08-30 23:11:54 +09:00
David Heinemeier Hansson
a317e7897f Merge pull request #7483 from christos/improve_template_digestor
Better ActionView::Digestor nested template inference
2012-08-30 05:28:31 -07:00
Christos Zisopoulos
e7c23a4a7a Further improve RENDER_DEPENDENCY regexp comments 2012-08-30 14:27:07 +02:00
Christos Zisopoulos
979d327e1e Improve RENDER_DEPENDENCY regexp comment to keep the doc editor happy. 2012-08-30 14:17:03 +02:00
Christos Zisopoulos
17f2499f04 Digestor can now parse old style hash syntax for render 2012-08-30 13:13:47 +02:00
Christos Zisopoulos
21bad7445b Digestor ignores most whitespace when parsing render invocations 2012-08-30 13:01:25 +02:00
Piotr Sarnacki
a0c5cc6a6d Merge pull request #7477 from kennyj/fix_7469
A missing require is added to fix build. When performing rake test:isolated in actionmailer, test/base_test.rb was break.
2012-08-30 03:45:58 -07:00
Vijay Dev
8074f3b478 Merge pull request #7481 from joliss/typo
Fix grammar
2012-08-30 00:41:16 -07:00
Xavier Noria
c584568ae2 documents after_(commit|rollback) 2012-08-30 06:57:41 +02:00
Jo Liss
ec950cf2ba Fix grammar 2012-08-30 01:03:51 +02:00
Carlos Antonio da Silva
d4b8052e04 Merge pull request #7480 from aaronbrethorst/master
Fix markdown rendering of the ActionPack changelog [ci skip]
2012-08-29 15:09:39 -07:00
David Heinemeier Hansson
0093dafd80 Use class_attribute so we dont bleed 2012-08-29 15:36:11 -05:00
Aaron Brethorst
ee2da014c4 Fix Markdown rendering of 'controller-level etag additions' feature 2012-08-29 13:34:11 -07:00
Erik Ordway
341f42b076 Update actionpack/lib/action_dispatch/routing/mapper.rb
escape the '.'s
2012-08-29 13:14:33 -07:00
David Heinemeier Hansson
ed5c938fa3 Added controller-level etag additions that will be part of the action etag computation *Jeremy Kemper/DHH* 2012-08-29 15:06:30 -05:00
David Heinemeier Hansson
502d5e24e2 Add automatic template digests to all CacheHelper#cache calls (originally spiked in the cache_digests plugin) *DHH* 2012-08-29 14:23:56 -05:00
David Heinemeier Hansson
3da10e3261 Fix spacing 2012-08-29 14:23:27 -05:00
David Heinemeier Hansson
d3354957fc Fix spacing 2012-08-29 14:23:27 -05:00
Andrew White
46d85438fe Merge pull request #7230 from schneems/schneems/expose_required_keys
Add Missing Keys from Journey on Failed URL Format
2012-08-29 12:03:06 -07:00
Xavier Noria
3b2c42cb56 fixes a regexp
We need to anchor to remove the extension. In addition to
be the correct way to do that, files in ~/.rbenv get that
.rb removed, so it is a real source of bugs, as reported in

b33700f558 (commitcomment-1781840)
2012-08-29 17:42:43 +02:00
kennyj
c34022c2ec Added missing require. When performing rake test:isolated, test/base_test.rb was break. 2012-08-29 23:19:48 +09:00
Xavier Noria
8e974f2e3c Merge pull request #7476 from ayrton/fixed_indentation
Fixed indendation
2012-08-29 01:39:34 -07:00
Ayrton De Craene
8d9f9f9dfb Fixed indendation 2012-08-29 10:25:36 +02:00
Pratik Naik
754173c5ff Add a test to make sure preloading properly merges association and default scope conditions 2012-08-28 12:49:55 -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
Xavier Noria
b33700f558 detect circular constant autoloading
Nowadays circular autoloads do not work, but the user gets a NameError
that says some constant is undefined. That's puzzling, because he is
normally trying to autoload a constant he knows can be autoloaded.
With this check we can give a better error message.
2012-08-28 20:34:39 +02:00
Rafael Mendonça França
844e944465 Merge pull request #7470 from kennyj/fix_method_redefined_warning
Fix method redefined warnings.
2012-08-28 10:40:29 -07:00
kennyj
9063f3729b Fix method redefined warnings. 2012-08-29 02:38:12 +09:00
José Valim
1ef9b7ec78 Merge pull request #7469 from kennyj/fix_many_warnings_in_am
Fixes warnings when executing rake test in ActionMailer.
2012-08-28 10:05:55 -07:00
kennyj
167f250d98 Fixes warnings when executing rake test in ActionMailer. Related to 582a7f459990487659886b90e54c22e055c65870 2012-08-29 01:57:44 +09:00
José Valim
52c0bf9843 Merge pull request #7468 from kennyj/tiny_fixings
Tiny fixes in railties/test/application.
2012-08-28 09:32:24 -07:00
kennyj
1006382655 Remove unused require. 2012-08-29 01:22:06 +09:00
kennyj
f686bc85b7 Fixes wrong test class names. 2012-08-29 01:21:43 +09:00
schneems
cc57b2a422 refactor route_set generate_extras functionality
The result of Generator with or without the @extras instance variable set contains the desired information. Rather than preserving state when initializing the original object, we can simply extract the keys from the resultant parameters.

ATP Actionpack, railties
2012-08-28 08:53:45 -07:00
schneems
0b6175ac2d Add Missing Keys from Journey on failed URL format
Many named routes have keys that are required to successfully resolve. If a key is left off like this:

    <%= link_to 'user', user_path %>

This will produce an error like this:

    No route matches {:action=>"show", :controller=>"users"}

Since we know that the :id is missing, we can add extra debugging information to the error message.

    No route matches {:action=>"show", :controller=>"users"} missing required keys: [:id]


This will help new and seasoned developers look closer at their parameters. I've also subclassed the routing error to be clear that this error is a result of attempting to generate a url and not because the user is trying to visit a bad url. 

While this may sound trivial this error message is misleading and confuses most developers. The important part isn't what's in the options its's what's missing. Adding this information to the error message will make debugging much more obvious. 

This is the sister pull request of https://github.com/rails/journey/pull/44 which will be required to get they missing keys into the correct error message. 

Example Development Error in Rails: http://cl.ly/image/3S0T0n1T3421
2012-08-28 08:53:45 -07:00
Xavier Noria
db8ff15a49 fixes a bug in dependencies.rb
loaded stores file names without the .rb extension, but search_for_file
returns file names with the extension.

The solution is hackish, but this file needs a revamp.
2012-08-28 17:19:39 +02:00
Rafael Mendonça França
265c8b771d Merge pull request #7466 from arunagw/warning_removed_ap
removed :  warning: `*' interpreted as argument prefix
2012-08-28 07:50:01 -07:00