Commit Graph

11294 Commits

Author SHA1 Message Date
Aaron Patterson
ec1caddb7f only pull :protocol from the options hash once 2014-06-11 11:42:49 -07:00
Aaron Patterson
aaaff369da cache protocol on the stack to reduce options hash lookups 2014-06-11 11:36:50 -07:00
Aaron Patterson
1c432d1af1 eliminate nil checks in normalize_port 2014-06-11 11:33:36 -07:00
Aaron Patterson
a6f30bea06 reduce hash lookups and disconnect normalize_port from the options hash 2014-06-11 11:33:35 -07:00
Yves Senn
71f99be858 Merge pull request #15545 from zuhao/refactor_actionpack_assert_select_test
Restore test deliveries for ActionMailer.
2014-06-08 15:55:20 +02:00
Matthew Draper
6a89850dfe Handle client disconnect during live streaming
.. even when the producer is blocked for a write.
2014-06-08 07:21:14 +09:30
Xavier Noria
f84d081faf adds some details to the rationale of converted_arrays [ci skip] 2014-06-07 13:30:03 +02:00
Xavier Noria
f712f89961 adds a regression test for the strong params converted arrays cache
This is a regression test for 29844dd.
2014-06-07 13:19:16 +02:00
Xavier Noria
1ecada20d1 Revert "Convert StrongParameters cache to a hash. This fixes an unbounded"
We cannot cache keys because arrays are mutable. We rather want to cache
the arrays. This behaviour is tailor-made for the usage pattern strongs
params is designed for.

In a forthcoming commit I am going to add a test that covers why we need
to cache by value.

Every strong params instance has a live span of a request, the cache goes
away with the object. Since strong params have such a concrete intention,
it would be interesting to see if there are actually any real-world use
cases that are an actual leak, one that practically may matter.

I am not convinced that the theoretical leak has any practical consequences,
but if it can be shown there are, then I believe we should either get rid of
the cache (which is an optimization), or else wipe it in the mutating API.

This reverts commit e63be2769c039e4e9ada523a8497ce3206cc8a9b.
2014-06-07 13:19:16 +02:00
Akshay Vishnoi
b6760d8f14 [ci skip] Fix capitalization 2014-06-07 14:23:27 +05:30
Aaron Patterson
092f74080c remove another wasteful AS::SafeBuffer allocation 2014-06-06 12:06:58 -07:00
Aaron Patterson
e9f215d9f2 eliminate wasteful AS::SafeBuffer allocation 2014-06-06 12:06:04 -07:00
Zuhao Wan
64edb6cb19 Restore test deliveries for ActionMailer. 2014-06-07 00:18:50 +08:00
Nathaniel Bibler
e7b0947afd Use a frozen Set instance for CGI_VARIABLES.
Also expand the CGI_VARIABLE name listing to multiple lines for cleaner diffs and legibility.
2014-06-05 22:05:02 -04:00
Corey Ward
a076b8cde9 Avoid misuse of underscore argument
Per convention, underscore-only argument names should be used for unused parameters.
2014-06-05 14:17:11 -05:00
Matthew Draper
141e6e8a2f Merge pull request #15530 from zuhao/refactor_actionpack_reloader_test
Reset callbacks after test.
2014-06-06 03:24:48 +09:30
Yves Senn
4f58b90bab Merge pull request #15532 from zuhao/refactor_actionpack_response_test
Restore Response.default_headers after test.
2014-06-05 16:55:17 +02:00
Zuhao Wan
e767be0779 Restore Response.default_headers after test. 2014-06-05 22:52:13 +08:00
Zuhao Wan
d9be7ad7cf Avoid hard-coded value in test setup/teardown. 2014-06-05 22:39:03 +08:00
Zuhao Wan
5faf77fe7a Reset callbacks after test.
Otherwise the state of callback chain is leaked.
2014-06-05 22:30:53 +08:00
Yves Senn
da19e0d132 Merge pull request #15529 from zuhao/refactor_actionpack_mime_type_test
Make sure Mime::Type is not altered after tests.
2014-06-05 16:08:22 +02:00
Zuhao Wan
1bcde3a771 Mime::PNG is already defined. 2014-06-05 22:04:06 +08:00
Zuhao Wan
6a75e2ce10 Avoid hardcoded value in test setup/teardown. 2014-06-05 21:03:41 +08:00
Aaron Patterson
1ce0cc0d38 Merge branch 'master' of github.com:rails/rails
* 'master' of github.com:rails/rails:
  For our build, stick with mail 2.5.x for now
  Correct result, previously showing wrong result
  Collapse PG default extractoin of most types to single regex
  Change wording of explanation about precision & scale of decimal numbers [ci skip]
  Cleaned up duplicated CHANGELOG entry [ci skip]
  reuse available belongs_to? method
  Convert StrongParameters cache to a hash. This fixes an unbounded memory leak demonstrated on @tenderlove's latest blog post:
  Partially revert deprecation of *_filter
  Pluralize params
  Add default_i18n_subject to the guides
  Fix regression on eager loading association based on SQL query rather than existing column.
  Relax mail gem constraint from ~> 2.5.4 to ~> 2.5, >= 2.5.4
  Keep column defaults in type cast form
  Return a null column when no column exists for an attribute
  Refactor XML serializer to not depend on `serialized_attributes`
  Test the serialized types of virtual columns in XML
  implement ActiveRecord::Base#pretty_print + changelog
  Remove duplicated HashWithIndifferentAccess#with_indifferent_access.
2014-06-04 11:45:53 -07:00
Guillermo Iguaran
4818bb36ac Merge pull request #15498 from zenspider/fix_memory_leak
Convert StrongParameters cache to a hash. This fixes an unbounded memory leak
2014-06-03 21:48:17 -05:00
Ryan Davis
e63be2769c Convert StrongParameters cache to a hash. This fixes an unbounded
memory leak demonstrated on @tenderlove's latest blog post:

http://tenderlovemaking.com/2014/06/02/yagni-methods-are-killing-me.html
2014-06-03 16:57:22 -07:00
Aaron Patterson
3f7e482aed push splitting "to" up the callstack 2014-06-03 16:23:39 -07:00
Rafael Mendonça França
489a8f2a44 Partially revert deprecation of *_filter
We are going to deprecate only on Rails 5 to make easier plugin
maintainers support different Rails versions. Right now we are only
discouraging their usage.

This reverts commit 6c5f43bab8206747a8591435b2aa0ff7051ad3de.

Conflicts:
	actionpack/CHANGELOG.md
2014-06-03 19:53:28 -03:00
Rafael Mendonça França
18d19bf2a4 Merge pull request #15349 from tgxworld/remove_duplicated_method_call
Remove duplicated HashWithIndifferentAccess#with_indifferent_access.
2014-06-03 19:10:33 -03:00
Aaron Patterson
df8e89e8f1 oops! 💣 2014-06-03 14:07:20 -07:00
Aaron Patterson
cc26b6b7bc Routes specifying 'to:' must be a string that contains a "#" or a rack
application.  Use of a symbol should be replaced with `action: symbol`.
Use of a string without a "#" should be replaced with `controller: string`.
2014-06-03 14:05:42 -07:00
Aaron Patterson
4097ff5c5f use the factory method to construct the mapping 2014-06-03 11:42:45 -07:00
Aaron Patterson
e3df1dd047 add tests for mixing :to and controller / action 2014-06-03 11:36:32 -07:00
Aaron Patterson
af1c8665cd push some options munging to an alternate constructor 2014-06-03 11:33:54 -07:00
Aaron Patterson
a21707116a add tests for nested lambda constraints 2014-06-03 11:33:53 -07:00
Aaron Patterson
522038aa9d move options_constraints tests next to each other 2014-06-03 11:33:53 -07:00
Aaron Patterson
5029c371fe only do is_a checks on formatted once 2014-06-03 11:33:53 -07:00
Aaron Patterson
10c1787b30 push options_constraints processing up
this lets us reduce is_a checks on the options_constraints and push
"callable constraints" verification to the right place.
2014-06-03 11:33:53 -07:00
Aaron Patterson
eaaf8995b1 remove options as an ivar 2014-06-03 11:33:53 -07:00
Aaron Patterson
981029b3ff only do Regexp === option once 2014-06-03 11:33:53 -07:00
Aaron Patterson
404feeb2e4 return early from add_request_method 2014-06-03 11:33:53 -07:00
Aaron Patterson
92d16ec158 only loop over options once (hopefully) 2014-06-03 11:33:53 -07:00
Aaron Patterson
c0fc116fb4 only loop through constraints once 2014-06-03 11:33:52 -07:00
Aaron Patterson
4d3955aef4 change defaults allocation to a one-liner 2014-06-03 11:33:52 -07:00
Aaron Patterson
d00bbe64ae no longer need the scope ivar 2014-06-03 11:33:52 -07:00
Aaron Patterson
03de3a02c7 only look up scope[:module] once 2014-06-03 11:33:52 -07:00
Aaron Patterson
43d2105a1e remove IGNORE_OPTIONS 2014-06-03 11:33:52 -07:00
Aaron Patterson
5b71006cac :only is never used in Mapping, so rm the key 2014-06-03 11:33:52 -07:00
Aaron Patterson
c94504cf88 remove :defaults from the IGNORE_OPTIONS list 2014-06-03 11:33:52 -07:00
Aaron Patterson
82f115758e remove :constraints from IGNORE_OPTIONS 2014-06-03 11:33:52 -07:00